private void examine(string okOrNot) { if (inputCheck()) { DataRow sessionDr = Session["seldSelfReceipt"] as DataRow; string strReceiptId = sessionDr["receiptId"].ToString(); string strReceiptComment = txtReceiptComment.Text.Trim(); DataSet dst = new DataSet(); ReceiptApplyProcess rap = new ReceiptApplyProcess(dst); rap.SelfReceiptExamine(strReceiptId, okOrNot, strReceiptComment); Xm_db xmDataCont = Xm_db.GetInstance(); int usrId = int.Parse(sessionDr["usrId"].ToString()); var usrInfo = from usr in xmDataCont.Tbl_usr where usr.UsrId == usrId && usr.EndTime > DateTime.Now select usr; string projetTag = sessionDr["projectTag"].ToString(); if (okOrNot.Equals(bool.TrueString)) { //int flag = 0x80; var usr_autority = from usr in xmDataCont.Tbl_usr //join auth in xmDataCont.View_usr_autority on usr.UsrId equals auth.UsrId where (usr.TotleAuthority & (UInt32)AuthAttributes.pay_receiptOk) != 0 && usr.EndTime > DateTime.Now select usr; //where usr.TotleAuthority.ToAuthAttr().HasOneFlag(AuthAttributes.pay_receiptOk) && // usr.EndTime > DateTime.Now //select usr; foreach (var usr in usr_autority) { BeckSendMail.getMM().NewMail(usr.UsrEmail, "mis系统票务通知", "开票申请已通过审批,请尽快完成后续工作" + System.Environment.NewLine + Request.Url.toNewUrlForMail("/Main/paymentReceiptManager/receiptOk.aspx")); } BeckSendMail.getMM().NewMail(usrInfo.First().UsrEmail, "mis系统票务通知", projetTag + "的开票申请已通过审批,请尽快完成后续工作"); } else { BeckSendMail.getMM().NewMail(usrInfo.First().UsrEmail, "mis系统票务通知", projetTag + "的开票申请暂缓,请尽快完成后续工作"); } Response.Redirect("~/Main/infoViewManager/receiptView.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if (!(null == Session["totleAuthority"])) { AuthAttributes usrAuthAttr = (AuthAttributes)Session["totleAuthority"]; bool flag = usrAuthAttr.HasOneFlag(AuthAttributes.pay_receiptExamine); if (!flag) { Response.Redirect("~/Main/NoAuthority.aspx"); } } else { string url = Request.FilePath; Session["backUrl"] = url; Response.Redirect("~/Account/Login.aspx"); } if (!IsPostBack) { DataSet MyDst = new DataSet(); #region selfReceiptGV ReceiptApplyProcess receiptApplyView = new ReceiptApplyProcess(MyDst); receiptApplyView.RealSelfReceiptView(); DataTable taskTable = receiptApplyView.MyDst.Tables["view_mainReceipt"].DefaultView.ToTable(); DataColumn colDone = new DataColumn("Done", System.Type.GetType("System.String")); taskTable.Columns.Add(colDone); string strNotDone = "未完成"; DateTime doneTime = DateTime.Now; foreach (DataRow dr in taskTable.Rows) { doneTime = (DateTime)dr["doneTime"]; if (doneTime > DateTime.Now) { dr["Done"] = strNotDone; } else { dr["Done"] = doneTime.ToString(); } } Session["dtSources"] = taskTable; selfReceiptGV.DataSource = Session["dtSources"]; selfReceiptGV.DataBind(); #endregion } }
protected void Page_Load(object sender, EventArgs e) { if (!(null == Session["totleAuthority"])) { AuthAttributes usrAuthAttr = (AuthAttributes)Session["totleAuthority"]; bool flag = usrAuthAttr.HasOneFlag(AuthAttributes.pay_receiptOk); if (!flag) { Response.Redirect("~/Main/NoAuthority.aspx"); } } else { string url = Request.FilePath; Session["backUrl"] = url; Response.Redirect("~/Account/Login.aspx"); } if (!IsPostBack) { DataSet MyDst = new DataSet(); #region selfReceiptGV ReceiptApplyProcess receiptApplyView = new ReceiptApplyProcess(MyDst); receiptApplyView.RealSelfReceiptView(); DataTable taskTable = receiptApplyView.MyDst.Tables["view_mainReceipt"].DefaultView.ToTable(); string end = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss.fff"); string strFilter = " isAccept = " + "'" + bool.TrueString + "'" + " and doneTime > " + "'" + end + "'"; dt_modify(taskTable, strFilter); //dt.DefaultView.RowFilter = strFilter; //DataTable taskTable = dt.DefaultView.ToTable(); //dt.Clear(); Session["ReceiptApplyProcess"] = receiptApplyView; Session["dtSources"] = taskTable.DefaultView.ToTable(); taskTable.Clear(); selfReceiptGV.DataSource = Session["dtSources"]; selfReceiptGV.DataBind(); #endregion } }
protected void Page_Load(object sender, EventArgs e) { if (!(null == Session["totleAuthority"])) { AuthAttributes usrAuthAttr = (AuthAttributes)Session["totleAuthority"]; bool flag = usrAuthAttr.HasOneFlag(AuthAttributes.pay_receiptApply); if (!flag) { Response.Redirect("~/Main/NoAuthority.aspx"); } } else { string url = Request.FilePath; Session["backUrl"] = url; Response.Redirect("~/Account/Login.aspx"); } if (null == Session["seldMainContract"]) { Response.Redirect("~/Main/paymentReceiptManager/mainContractReceiptView.aspx"); } if (!IsPostBack) { DataRow sessionDr = Session["seldMainContract"] as DataRow; string mainContractId = sessionDr["mainContractId"].ToString(); DataTable receiptApplyTable = null; if (null == Session["receiptApplyTable"]) { DataRow receiptApplyRow = null; DataColumn colMainContractId = new DataColumn("mainContractId", System.Type.GetType("System.String")); DataColumn colCustMaxReceipt = new DataColumn("custMaxReceipt", System.Type.GetType("System.String")); DataColumn colReceiptPercent = new DataColumn("receiptPercent", System.Type.GetType("System.String")); DataColumn colHasReceiptPercent = new DataColumn("selfHasReceipt", System.Type.GetType("System.String")); DataColumn colReceiptExplication = new DataColumn("receiptExplication", System.Type.GetType("System.String")); receiptApplyTable = new DataTable("tbl_receiptApply"); receiptApplyTable.Columns.Add(colMainContractId); receiptApplyTable.Columns.Add(colCustMaxReceipt); receiptApplyTable.Columns.Add(colReceiptPercent); receiptApplyTable.Columns.Add(colHasReceiptPercent); receiptApplyTable.Columns.Add(colReceiptExplication); receiptApplyRow = receiptApplyTable.NewRow(); receiptApplyRow["mainContractId"] = mainContractId; receiptApplyRow["receiptPercent"] = string.Empty; receiptApplyRow["receiptExplication"] = string.Empty; receiptApplyTable.Rows.Add(receiptApplyRow); Session["receiptApplyTable"] = receiptApplyTable; } else { receiptApplyTable = Session["receiptApplyTable"] as DataTable; } string selfReceipt = sessionDr["selfReceiptPercent"].ToString(); DataSet MyDst = new DataSet(); #region lblContractReceipt ReceiptApplyProcess receiptApplyView = new ReceiptApplyProcess(MyDst); receiptApplyView.SubContractReceiptMax(mainContractId); string maxReceipt = receiptApplyView.StrRtn; //receiptApplyTable.Rows[0]["custMaxReceipt"] = maxReceipt; //lblSubContractReceipt.Text = maxReceipt + "%"; //lblMainContractReceipt.Text = selfReceipt + "%"; //#endregion //#region ddlSelfReceipt //ListItemCollection licNomal = new ListItemCollection(); //int num = 0; //int max = int.Parse(maxReceipt) - int.Parse(selfReceipt) + 5; //string strValue = string.Empty; //string strPercent = "%"; //string strText = string.Empty; //for (int i = num; i < max; i = i + 5) //{ // strValue = i.ToString(); // strText = strValue + strPercent; // licNomal.Add(strText); //} //ListItemCollection licSpecial = new ListItemCollection(); //num = max; //max = 110 - max; //strValue = string.Empty; //strText = string.Empty; //for (int i = num; i < max; i = i + 5) //{ // strValue = i.ToString(); // strText = strValue + strPercent; // licSpecial.Add(strText); //} //Session["licNomal"] = licNomal; //Session["licSpecial"] = licSpecial; //#endregion //ddlSelfReceipt.DataSource = Session["licNomal"]; //ddlSelfReceipt.DataBind(); //ddlSelfReceipt.SelectedIndex = 0; float m = float.Parse(maxReceipt); float s = float.Parse(selfReceipt); receiptApplyTable.Rows[0]["custMaxReceipt"] = maxReceipt; lblSubContractReceipt.Text = m.ToString("p"); lblMainContractReceipt.Text = s.ToString("p"); #endregion #region ddlSelfReceipt DataTable dtNomal = new DataTable(); dtNomal.Columns.Add("DataTextField", Type.GetType("System.String")); dtNomal.Columns.Add("DataValueField", Type.GetType("System.Single")); float num = 0; float max = m - s + 0.05f; max = max <= 0.05f ? 0.05f : max; DataRow dr = null; for (float i = num; i < max; i = i + 0.05f) { dr = dtNomal.NewRow(); dr["DataTextField"] = i.ToString("p"); dr["DataValueField"] = i; dtNomal.Rows.Add(dr); } DataTable dtSpecial = new DataTable(); dtSpecial.Columns.Add("DataTextField", Type.GetType("System.String")); dtSpecial.Columns.Add("DataValueField", Type.GetType("System.Single")); num = 0; max = 1.05f - s; dr = null; for (float i = num; i < max; i = i + 0.05f) { dr = dtSpecial.NewRow(); dr["DataTextField"] = i.ToString("p"); dr["DataValueField"] = i; dtSpecial.Rows.Add(dr); //licNomal.Add(new ListItem(i.ToString("p"), i.ToString())); } Session["dtNomal"] = dtNomal; Session["dtSpecial"] = dtSpecial; #endregion ddlSelfReceipt.DataSource = Session["dtNomal"]; ddlSelfReceipt.DataValueField = "DataValueField"; ddlSelfReceipt.DataTextField = "DataTextField"; ddlSelfReceipt.DataBind(); ddlSelfReceipt.SelectedIndex = 0; Session["ReceiptApplyProcess"] = receiptApplyView; } }