using System; using System.Collections; using System.Configuration; using System.Data; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using DSWeb.Models; using DSWeb.EntityDA; using DSWeb.WorkFlow; using System.Collections.Generic; namespace DSWeb.Settlements { public partial class CommonPayApplicationAudit : System.Web.UI.Page { private string strAppID;//付费申请表GID private string strBillNO;//申请单号 private string strUserID;//用户GID private int iAuditStatus = 0;//审核状态 值为1表示审核人批准本次付费申请 值为2表示审核人拒绝本次付费申请 private string strModuleName;//模块名称 private string strCompanyID;//公司GID private string strDeptName;//部门名称 private string stroplb;//业务类别 protected void Page_Load(object sender, EventArgs e) { if (Session["COMPANYID"] != null) { strCompanyID = Session["COMPANYID"].ToString(); } if (Session["DEPTNAME"] != null) { strDeptName = Session["DEPTNAME"].ToString(); } if (Request.QueryString["oplb"] != null) { stroplb = Request.QueryString["oplb"].ToString(); } if (Request.QueryString["id"] != null) { strAppID = Request.QueryString["id"].ToString(); this.h_id.Value = strAppID; } if (Request.QueryString["billno"] != null) { strBillNO = Request.QueryString["billno"].ToString(); this.h_billno.Value = strBillNO; } if (Request.QueryString["mod"] != null) { strModuleName = Request.QueryString["mod"].ToString(); h_mod.Value = strModuleName; } if (Session["USERID"] != null) { strUserID = Session["USERID"].ToString(); this.h_user.Value = strUserID; } if (strBillNO != null) { FeePayApplicationEntity feePayApplicationEntity = new FeePayApplicationEntity(); FeePaySettleApplicationDA feePaySettleApplicationDA = new FeePaySettleApplicationDA(); feePayApplicationEntity = feePaySettleApplicationDA.GetFeePayApplicationByBillNO(strBillNO, strCompanyID); if (feePayApplicationEntity != null) { if (feePayApplicationEntity.GID != null) { this.txt_remark.Value = feePayApplicationEntity.Remark; this.h_settlecustomer.Value = feePayApplicationEntity.CustomerName; this.txt_CHEQUENUMREMARK.Value = feePayApplicationEntity.CHEQUENUMREMARK==null?"":feePayApplicationEntity.CHEQUENUMREMARK.ToString();//支票号备注 } } } if (this.h_audit.Value.Trim() != "") { iAuditStatus = int.Parse(this.h_audit.Value.Trim()); } if (iAuditStatus == 1) { AcceptFeePayApply(); } } //private void GetPaySettlementApplication(string tempBillNO) //{ // FeePayApplicationEntity feePayApplicationEntity = new FeePayApplicationEntity(); // FeePaySettleApplicationDA feePaySettleApplicationDA = new FeePaySettleApplicationDA(); // feePayApplicationEntity = feePaySettleApplicationDA.GetFeePayApplicationByBillNO(tempBillNO); // if (feePayApplicationEntity != null) // { // if (feePayApplicationEntity.GID != null) // { // fee // } // } //} private void AcceptFeePayApply() { //工作流 WorkFlowHelper workFlowHelper = new WorkFlowHelper(); //WorkFlowEntity workFlowEntity = workFlowHelper.FindWorkFlow(WorkFlowType.PAYSETTLEAUDIT,strCompanyID); WorkFlowEntity workFlowEntity = new WorkFlowEntity(); if (stroplb == "op_Seae") { workFlowEntity = workFlowHelper.FindWorkFlow(WorkFlowType.PAYSETTLEAUDIT, strCompanyID); } else if (stroplb == "op_Seai") { workFlowEntity = workFlowHelper.FindWorkFlow(WorkFlowType.SeaiPAYSETTLEAUDIT, strCompanyID); } else if (stroplb.ToLower() == "tmswlbshead" || stroplb.ToLower() == "tmswlpchead")//51 陆运 { workFlowEntity = workFlowHelper.FindWorkFlow(WorkFlowType.tMsWlPAYSETTLEAUDIT, strCompanyID); } else if (stroplb.ToLower() == "wms_fee" || stroplb.ToLower() == "wms" || stroplb.ToLower() == "wms_out")//61 { workFlowEntity = workFlowHelper.FindWorkFlow(WorkFlowType.WmszxPAYSETTLEAUDIT, strCompanyID); } else if (stroplb.ToLower() == "op_apply") { workFlowEntity = workFlowHelper.FindWorkFlow(WorkFlowType.APPLYPAYSETTLEAUDIT, strCompanyID); } int iResult = 0;//状态值 if (workFlowEntity != null) { IList workFlowDoEntities = new List(); WorkFlowDoDA workFlowDoDA = new WorkFlowDoDA(); workFlowDoEntities = workFlowDoDA.GetAllWorkFlowDoByBillNO(workFlowEntity.GID, strBillNO); if (workFlowDoEntities.Count > 0) { foreach (WorkFlowDoEntity workFlowDoEntity in workFlowDoEntities) { if (workFlowDoEntity.Auditor == strUserID) { if (!workFlowDoEntity.IsFinish) { iResult = workFlowHelper.DoWorkFlowStep(workFlowDoEntity, workFlowEntity); break; } } } } } if (iResult == 1) { btn_accept.Disabled = true; Response.Write(""); return; } } private void RejectFeePayApply() { } } }