public override void AfterEventProcess(IPart Part, string eventName, object sender, EventArgs args) { base.AfterEventProcess(Part, eventName, sender, args); uiPart = Part; UFWebButton4ToolbarAdapter adapter = sender as UFWebButton4ToolbarAdapter; IUIRecord porec = uiPart.Model.Views["PayBillHead"].FocusedRecord; //弃审后,更新标记 if ((adapter != null) && (adapter.Action == "UnApproveClick")) { ILogger logger = LoggerManager.GetLogger(typeof(CacheManager)); logger.Error(string.Format("单号为:{0}的付款单弃审了!", porec["DocNo"].ToString())); //string UpSQL = string.Format(@"UPDATE InvDoc_MiscShip set DescFlexField_PrivateDescSeg3='' WHERE ID = {0}", porec["ID"].ToString()); //DataAccessor.RunSQL(DatabaseManager.GetCurrentConnection(), UpSQL, null); } }
public override void AfterEventProcess(IPart Part, string eventName, object sender, EventArgs args) { base.AfterEventProcess(Part, eventName, sender, args); uiPart = Part; UFWebButton4ToolbarAdapter adapter = sender as UFWebButton4ToolbarAdapter; IUIRecord porec = uiPart.Model.Views["MiscShipment"].FocusedRecord; //弃审后,更新标记 if ((adapter != null) && porec != null && Int64.Parse(porec["ID"].ToString()) > 0) { //if (porec["Status"].ToString() == "1") //{ // //查询OA的流程ID // string sql = string.Format(@"SELECT b.DescFlexField_PrivateDescSeg1 AS IsOA // FROM dbo.InvDoc_MiscShip a inner join InvDoc_MiscShipDocType b on a.MiscShipDocType=b.ID WHERE a.ID={0}", porec["ID"].ToString()); // DataSet ds = new DataSet(); // string IsOA = ""; // DataAccessor.RunSQL(DatabaseManager.GetCurrentConnection(), sql, null, out ds); // foreach (DataRow row in ds.Tables[0].Rows) // { // IsOA = row["IsOA"].ToString(); // } // if (IsOA == "1") // { // //if ((adapter.Action == "ApproveClick")) // //{ // // throw new Exception("U9审核无效,此单据类型只能在OA中审核!"); // // //string UpSQL = string.Format(@"UPDATE InvDoc_MiscShip set DescFlexField_PrivateDescSeg3='' WHERE ID = {0}", porec["ID"].ToString()); // // //DataAccessor.RunSQL(DatabaseManager.GetCurrentConnection(), UpSQL, null); // //} // if (adapter.Action == "DeleteClick") // { // throw new Exception("核准中的单据不能删除!"); // } // } //} } }