2025-03-27 15:05:14 +08:00

201 lines
8.7 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Configuration;
using SuperMap.RealEstate.ServiceModel;
using SuperMap.RealEstate.Utility;
using SuperMap.RealEstate.Web.UI;
using Business = SuperMap.RealEstate.HighWay.SellData.Business;
using MSPB = SuperMap.RealEstate.MobileServicePlatform.Business;
using HZQR.Common;
using Newtonsoft.Json.Linq;
using SellB = SuperMap.RealEstate.HighWay.SellData.Business;
namespace SuperMap.RealEstate.HighWay.Modules.ProblemDeal
{
public partial class ENDACCOUNTPage : SuperMap.RealEstate.Web.UI.Page
{
protected string _UmiformCommodity = ConfigurationManager.AppSettings["UmiformCommodity"].ToString();
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack) return;
//载入数据
ButtonDelete.Enabled = ENDACCOUNT1.LoadData();
//显示图片上传功能
if (ENDACCOUNT1.CurrObject.ENDACCOUNT_ID != null)
{
//短款需要上传附件
//if (ENDACCOUNT1.CurrObject.DIFFERENT_PRICE < 0)
//{
BtnSearch.OnClientClick = GetOpenPopDialogClientScript("IMAGEPage.aspx?ENDACCOUNT_ID=" +
ENDACCOUNT1.CurrObject.ENDACCOUNT_ID_Encrypt, "IMAGEPage", 1100, 600);
//}
//else
//{
// Storage.Business.IMAGE _IMAGE = new Storage.Business.IMAGE(Transaction);
// _IMAGE.AddSearchParameter("TABLE_NAME", "HIGHWAY_SELLDATA.T_ENDACCOUNT");
// _IMAGE.AddSearchParameter("TABLE_ID", ENDACCOUNT1.CurrObject.ENDACCOUNT_ID);
// if (_IMAGE.Search())
// {
// BtnSearch.OnClientClick = GetOpenPopDialogClientScript("IMAGEPage.aspx?ENDACCOUNT_ID=" +
// ENDACCOUNT1.CurrObject.ENDACCOUNT_ID_Encrypt, "IMAGEPage", 900, 600);
// }
// else
// {
// BtnSearch.Visible = false;
// }
//}
}
if (ENDACCOUNT1.CurrObject.TREATMENT_MARK == 2)
{
ButtonSave.Visible = false;
ButtonDelete.Visible = false;
//BtnCorrect.Visible = false;
//ENDACCOUNT1.FindControl("li_ButtonAdd").Visible = false;
}
//设置删除提示
SetControlConfirm(ButtonDelete, "您确认删除该记录,删除后将无法恢复数据?");
//设置按钮状态
SetControlClientAction(ButtonDelete, false, true, true);
SetControlClientAction(ButtonSave);
//注册遮罩式窗口关闭脚本
SetControlClosePopDialog(ButtonClose);
}
protected void ButtonSave_Click(object sender, EventArgs e)
{
try
{
//刷新类型
bool _RefreshType = ButtonDelete.Enabled;
//保存数据
ButtonDelete.Enabled = ENDACCOUNT1.Save();
//刷新弹出页列表
RefreshOpenerGridPage(_RefreshType ? RefreshGridPageType.Update : RefreshGridPageType.Insert);
#region
SellB.ENDACCOUNT _ENDACCOUNT = ENDACCOUNT1.CurrObject;
try
{
//当前环节日结校验,推送给日结审核权限
string moduleGuid = "43ecf139-66a7-421b-ba0f-bf7ddd77437d";
if (_ENDACCOUNT.REVIEW_STATE == 1)
{
Storage.Business.CommonHelper.PushEndAccountMessage(this.Transaction, "2", null, _ENDACCOUNT, moduleGuid,
this.PassportInfo.ID.ToString(), this.PassportInfo.Name);
}
}
catch (Exception ex)
{
ex = ex ?? ex.InnerException;
LogUtil.WriteLog("推送ex=" + ex.Message.ToString());
}
#endregion
#region
/*Business.ENDACCOUNT _ENDACCOUNT = ENDACCOUNT1.CurrObject;
try
{
//当前环节日结校验,推送给日结审核权限
string moduleGuid = "2eada261-97e7-4881-998b-06b1cfc290af";
if (//_ENDACCOUNT.PROVINCE_CODE == 6618 &&
_ENDACCOUNT.ExecuteDataTable("SELECT 1 FROM HIGHWAY_SELLDATA.V_ENDACCOUNT WHERE SERVERPART_ID = " +
_ENDACCOUNT.SERVERPART_ID + " AND TREATMENT_MARK < 2 AND TRUNC(NVL(STATISTICS_DATE,ENDACCOUNT_DATE)) = TO_DATE('" +
(_ENDACCOUNT.STATISTICS_DATE == null ? _ENDACCOUNT.ENDACCOUNT_DATE.Value.ToShortDateString() :
_ENDACCOUNT.STATISTICS_DATE.Value.ToShortDateString()) + "','YYYY/MM/DD') AND (DIFFERENCE_REASON IS NULL" +
(_UmiformCommodity.Split('|').Length > 3 && ("," + _UmiformCommodity.Split('|')[3] + ",").Contains("," +
_ENDACCOUNT.SERVERPART_ID + ",") ? "" : " OR TOTALSELLAMOUNT <> NVL(FACTAMOUNT_SALE,0)") +
" OR NVL(TOTALSELLAMOUNT,0) + NVL(CORRECT_AMOUNT,0) <> NVL(CASHPAY,0))").Rows.Count == 0)
{
Storage.Business.CommonHelper.PushEndAccountMessage(this.Transaction, "2", null, _ENDACCOUNT,
moduleGuid, this.PassportInfo.ID.ToString(), this.PassportInfo.Name);
#region APP端推送一条空消息来获取待办事项的数量
JObject info = new JObject();
string curModuleGuid = "6f020a1c-69db-4910-8d27-1f1140cb27d7";
info["moduleGuid"] = "b0b63a75-56c9-4f1d-aacb-a26e62b47e3e";
info["id"] = _ENDACCOUNT.ENDACCOUNT_ID;
//1:指定的MEMBERSHIP_ID;2:指定的手机号;3指定的CID;4:指定的USER_ID
string membershipIds = Storage.Business.CommonHelper.GetMemberShipIds(
Transaction, curModuleGuid, _ENDACCOUNT.SERVERPART_ID.ToString());
string _STATISTICS_DATE = _ENDACCOUNT.STATISTICS_DATE == null ?
_ENDACCOUNT.ENDACCOUNT_DATE.Value.ToShortDateString() :
_ENDACCOUNT.STATISTICS_DATE.Value.ToShortDateString();
MSPB.CommonHelper.PushMsgToAPP(this.Transaction, "数据校验处理", _ENDACCOUNT.SERVERPART_NAME + "" +
_ENDACCOUNT.SHOPNAME + "【" + _STATISTICS_DATE + "】实收" +
_ENDACCOUNT.CASHPAY.Value.ToString("0.00") + "元已于PC端完成校验请点击查看详情",
info.ToString(), 1, membershipIds);
#endregion
//}
}
catch (Exception ex)
{
ex = ex ?? ex.InnerException;
LogUtil.WriteLog("推送ex=" + ex.Message.ToString());
}*/
#endregion
//提示信息
Alert("保存成功!", 3);
ClosePopDialog();
}
catch (Exception ex)
{
//回滚事务
Transaction.Rollback();
//记录日志
ErrorLogHelper.Write(ex);
#if DEBUG
Alert("保存失败!\n" + ex.Message);
#else
Alert("保存失败!");
#endif
}
}
protected void ButtonDelete_Click(object sender, EventArgs e)
{
try
{
//删除数据
ButtonDelete.Enabled = !ENDACCOUNT1.Delete();
//刷新弹出页列表
RefreshOpenerGridPage(RefreshGridPageType.Delete);
//提示信息
Alert("删除成功!", 3);
ClosePopDialog();
}
catch (Exception ex)
{
//回滚事务
Transaction.Rollback();
//记录日志
ErrorLogHelper.Write(ex);
#if DEBUG
Alert("删除失败!可能的原因:\n" + ex.Message);
#else
Alert("删除失败!");
#endif
}
}
protected void BtnCorrect_Click(object sender, EventArgs e)
{
if (ENDACCOUNT1.CorrectPrice())
{
Alert("校验成功!", 3);
ENDACCOUNT1.Save();
Refresh();
RefreshOpenerGridPage(RefreshGridPageType.Update);
}
else
{
Alert("校验失败!");
}
}
}
}