好友
阅读权限20
听众
最后登录1970-1-1
|
namespace UFIDA.U9.Cust.AP_PayReqBillHeadUI
{
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections.Specialized;
using UFSoft.UBF.UI.ControlModel;
using UFSoft.UBF.UI.WebControlAdapter;
using UFSoft.UBF.UI.WebControls.ClientCallBack;
using UFSoft.UBF.UI.WebControls.Association;
using System.Web.UI.WebControls.WebParts;
using UFSoft.UBF.UI.IView;
using System.Web.UI;
using System.Web.UI.WebControls;
using UFSoft.UBF.UI.Controls;
using UFSoft.UBF.UI.WebControls;
using UFIDA.U9.UI.PDHelper;
using UFIDA.U9.FI.AP.PayReqFundUIModel;
using UFSoft.UBF.Util.DataAccess;
using System.Data;
using UFSoft.UBF.UI.ActionProcess;
using UFSoft.UBF.UI.WebControls.Association.Adapter;
public partial class PayReqFundMainUIFormWebPart : UFSoft.UBF.UI.Custom.ExtendedPartBase
{
public override void AfterInit(UFSoft.UBF.UI.IView.IPart part, EventArgs args)
{
this.Do_AfterInit(part, args);;
}
//请款明细对应应付单<br>" + ds.Tables[0].Rows[0]["DocNo"] + ",付款日期还未到提示功能
//public override void AfterEventProcess(IPart Part, string eventName, object sender, EventArgs args)
public override void BeforeEventProcess(IPart Part, string eventName, object sender, EventArgs args, out bool executeDefault)
{
UFSoft.UBF.UI.WebControlAdapter.UFWebButton4ToolbarAdapter webButton = sender as UFSoft.UBF.UI.WebControlAdapter.UFWebButton4ToolbarAdapter;
//保存按钮
if (_strongPart.Model.PayReqFundHead.FocusedRecord.DocumentType_Code == "001")
{
if (webButton != null && webButton.Action == "SaveClick")
{
foreach (UFIDA.U9.FI.AP.PayReqFundUIModel.PayReqFundHead_PayReqFundUses_PayReqFundDetailForUIsRecord ma in _strongPart.Model.PayReqFundHead_PayReqFundUses_PayReqFundDetailForUIs.Records)
{
//PayRFDate
//_strongPart.Model.PayReqFundHead.FocusedRecord.PayRFDate
//ma.LineNum
//ma.APBillHead
string sql = "select top 1 head.ID,head.DocNo,lin.Maturity from AP_APBillHead head ";
sql += " left join AP_APBillLine lin on head.ID=lin.APBillHead ";
sql += " where head.ID='" + ma.APBillHead + "' ";
sql += " group by head.ID,head.DocNo,lin.Maturity";
DataSet ds = new DataSet();
DataAccessor.RunSQL(DataAccessor.GetConn(), sql, null, out ds);
if (_strongPart.Model.PayReqFundHead.FocusedRecord.PayRFDate < Convert.ToDateTime(ds.Tables[0].Rows[0]["Maturity"]))
{
//显示提示窗口
if (((UFIDA.U9.FI.AP.PayReqFundUIModel.PayReqFundMainUIFormWebPart)_strongPart).CurrentState["PuOrderID"] == null)
{
//throw new Exception("提示:该应付单付款日期还未到是否继续请款!");
NameValueCollection name = new NameValueCollection();
name.Add("Meno", "请款明细对应应付单<br>" + ds.Tables[0].Rows[0]["DocNo"] + ",付款日期还未到!");
this._strongPart.ShowAtlasModalDialog(webButton, "23171438-9c2f-439f-8623-5951c4331c61", "应付单付款日期未到提示!", "300", "180", "" + _strongPart.Model.PayReqFundHead.FocusedRecord.ID + "", name, false, false, false);
executeDefault = false; //把按钮事件变为不继续执行
return;
}
}
}
}
}
base.BeforeEventProcess(Part, eventName, sender, args, out executeDefault);
}
public override void AfterEventProcess(IPart Part, string eventName, object sender, EventArgs args)
{
UFSoft.UBF.UI.WebControlAdapter.UFWebButton4ToolbarAdapter webButton = sender as UFSoft.UBF.UI.WebControlAdapter.UFWebButton4ToolbarAdapter;
//保存按钮
if (webButton != null && webButton.Action == "SaveClick")
{
if (_strongPart.CurrentState["PuOrderID"] != null)
{
_strongPart.CurrentState["PuOrderID"] = null;
_strongPart.CurrentState["Closes"] = null;
return;
//_strongPart.BtnSubmit_Click(sender, args);
// _strongPart.BtnRevocate_Click(sender, args);//收回事件
}
}
base.AfterEventProcess(Part, eventName, sender, args);
}
}
}
看是不是这个 |
|