public void BindGv() { this.hfldPrjId.Value = base.Request.QueryString["prjguid"].ToString(); this.hfldPurchaseChecked.Value = string.Empty; if (this.hfldPrjId.Value.ToString() != "") { PrjInfoModel modelByPrjGuid = this.ptPrjInfo.GetModelByPrjGuid(this.hfldPrjId.Value); if (modelByPrjGuid != null) { this.prjName = modelByPrjGuid.PrjName; } this.setTitle(); string text = " FlowState=1 and Total is not null "; if (!string.IsNullOrEmpty(this.hfldPrjId.Value)) { text += string.Format(" and ProjectId = '{0}' ", this.hfldPrjId.Value); } if (!string.IsNullOrEmpty(this.txtSignDate.Text)) { text += string.Format(" and InputDate >='{0}'", this.txtSignDate.Text); } if (!string.IsNullOrEmpty(this.txtEndDate.Text)) { text += string.Format(" and InputDate <='{0}'", this.txtEndDate.Text); } if (!string.IsNullOrEmpty(this.txtmoneyPrj.Text.Trim())) { text += string.Format(" and Name like '%{0}%'", this.txtmoneyPrj.Text.Trim()); } this.gvBudget.DataSource = OrganizationDiary.getDtByWhere(text); } this.gvBudget.DataBind(); }
protected void BindRptContrast() { DataTable contrast = OrganizationDiary.GetContrast(base.Request["ic"]); this.rptContrast.DataSource = contrast; this.rptContrast.DataBind(); if (contrast.Rows.Count == 0) { base.RegisterScript("$('#rptContrast tr:last-child').remove();"); } }
protected void InitPage() { if (!string.IsNullOrEmpty(base.Request["ic"])) { this.lblBllProducer.Text = PageHelper.QueryUser(this, base.UserCode); this.lblPrintDate.Text = System.DateTime.Now.ToShortDateString(); OrganizationDiary byId = OrganizationDiary.GetById(base.Request["ic"]); if (byId != null) { this.lblName.Text = byId.Name; this.lblCode.Text = byId.Code; this.lblDeparment.Text = byId.Department; this.lblInputDate.Text = byId.InputDate.ToString("yyyy-M-dd"); this.lblInputUser.Text = byId.InputUser; this.lblPeople.Text = byId.IssuedBy; } } }
protected string Code(string signCode, int count, bool isOrgDiary) { string str; if (count.ToString().Length == 1) { str = "0000" + count; } else { if (count.ToString().Length == 2) { str = "000" + count; } else { if (count.ToString().Length == 3) { str = "00" + count; } else { if (count.ToString().Length == 4) { str = "0" + count; } else { str = count.ToString(); } } } } string text = signCode + str; int num = isOrgDiary ? OrganizationDiary.GetOrgainCostCount(text) : CostDiary.GetCostcount(text); if (num > 0) { text = this.Code(signCode, count + 1, isOrgDiary); } return(text); }
protected void SumTotal() { DataTable contrast = OrganizationDiary.GetContrast(base.Request["ic"]); if (contrast.Rows.Count > 0) { System.Collections.Generic.Dictionary <string, decimal> dictionary = new System.Collections.Generic.Dictionary <string, decimal>(); string text = "ThisAmount"; decimal value = decimal.Parse(contrast.Compute("sum(" + text + ")", "1=1").ToString()); dictionary.Add(text, value); DataTable dataTable = contrast.Clone(); int num = -1; foreach (DataRow dataRow in contrast.Rows) { num++; if (num <= 0 || !(dataRow["CBSCode"].ToString() == contrast.Rows[num - 1]["CBSCode"].ToString())) { DataRow dataRow2 = dataTable.NewRow(); dataRow2.ItemArray = dataRow.ItemArray; dataTable.Rows.Add(dataRow2); } } decimal num2 = decimal.Parse((dataTable.Compute("SUM(MonthAmount)", "1=1") == null) ? 0m.ToString() : dataTable.Compute("SUM(MonthAmount)", "1=1").ToString()); decimal d = decimal.Parse((dataTable.Compute("SUM(MonthAlreadyAmount)", "1=1") == null) ? 0m.ToString() : dataTable.Compute("SUM(MonthAlreadyAmount)", "1=1").ToString()); dictionary["MonthAmount"] = num2; dictionary["MonthCha"] = num2 - d; if (dictionary["MonthAmount"] > 0m) { dictionary.Add("ChaLv", decimal.Round(dictionary["MonthCha"] / dictionary["MonthAmount"], 3)); } else { dictionary.Add("ChaLv", 0m); } decimal value2 = decimal.Parse(dataTable.Compute("SUM(PrjAmount)", "1=1").ToString()); dictionary.Add("PrjAmount", value2); decimal value3 = decimal.Parse(dataTable.Compute("SUM(PrjAlreadyAmount)", "1=1").ToString()); dictionary.Add("PrjAlreadyAmount", value3); this.ViewState["sum"] = dictionary; } }
protected string GetIndiaryCode(bool isOrgDiary, string prjId) { string str = "ZZJG"; if (!isOrgDiary && !string.IsNullOrEmpty(prjId)) { string prjCode = this.GetPrjCode(prjId); str = (string.IsNullOrEmpty(prjCode) ? string.Empty : prjCode.Substring(prjCode.Length - 4)); } string str2 = Common2.GetTime(System.DateTime.Now).Replace("-", ""); string text = str + str2; int count; if (isOrgDiary) { count = OrganizationDiary.GetOrgainCostCount(text) + 1; } else { count = CostDiary.GetCostcount(text) + 1; } return(this.Code(text, count, isOrgDiary)); }
protected void btnPlan_Click(object sender, EventArgs e) { string value = this.hdnRPUID.Value; if (this.HdnSub.Value == "0") { PayoutPayment payoutPayment = new PayoutPayment(); PayoutPaymentModel model = payoutPayment.GetModel(value); this.txtRPCode.Text = model.PaymentCode.ToString(); this.txtPayMoney.Text = model.PaymentMoney.ToString(); this.txtPayOut.Text = this.AccountBll.getMoneyByPayCode(model.ID).ToString(); this.txtInMoney.Text = (model.PaymentMoney - Convert.ToDecimal(this.txtPayOut.Text)).ToString(); this.txtJianMoney.Text = this.txtInMoney.Text; this.txtHandler.Text = model.InputPerson; return; } this.txtPayOut.Text = this.AccountBll.getMoneyByPayCode(value).ToString(); string strwhere = " inDiaryId ='" + value + "' "; DataTable dtByWhere = OrganizationDiary.getDtByWhere(strwhere); if (dtByWhere.Rows.Count > 0) { if (string.IsNullOrEmpty(dtByWhere.Rows[0]["Total"].ToString())) { this.txtPayMoney.Text = "0.00"; } else { this.txtPayMoney.Text = dtByWhere.Rows[0]["Total"].ToString(); } this.txtRPCode.Text = dtByWhere.Rows[0]["Name"].ToString(); this.txtInMoney.Text = (Convert.ToDecimal(this.txtPayMoney.Text) - Convert.ToDecimal(this.txtPayOut.Text)).ToString(); this.txtJianMoney.Text = this.txtInMoney.Text; this.txtHandler.Text = dtByWhere.Rows[0]["issuedBy"].ToString(); } }
protected void Page_Load(object sender, EventArgs e) { if (!base.IsPostBack) { this.hdnAccountID.Value = base.Request.QueryString["ic"].ToString(); this.accountModel = this.AccountBll.GetModel(new Guid(this.hdnAccountID.Value)); this.lblcode.Text = this.accountModel.PayOutCode.ToString(); this.lblInDate.Text = Convert.ToDateTime(this.accountModel.PayOutTime).ToString("yyyy-MM-dd"); this.lblInPeople.Text = com.jwsoft.pm.entpm.PageHelper.QueryUser(this, this.accountModel.PayOutPeople); PrjInfoModel modelByPrjGuid = this.ptPrjInfo.GetModelByPrjGuid(this.accountModel.prjGuid); if (modelByPrjGuid != null) { this.lblProject.Text = modelByPrjGuid.PrjName; } this.lblPayMoney.Text = this.AccountBll.getMoneyByPayCode(this.accountModel.RPGuid.ToString()).ToString(); PayoutPayment payoutPayment = new PayoutPayment(); PayoutPaymentModel model = payoutPayment.GetModel(this.accountModel.RPGuid.ToString()); if (model != null) { this.lblContPayCode.Text = model.PaymentCode.ToString(); this.lblContMoney.Text = model.PaymentMoney.ToString(); } else { this.lblWord.Text = "费用名称"; string strwhere = " inDiaryId ='" + this.accountModel.RPGuid.ToString() + "' "; DataTable dtByWhere = OrganizationDiary.getDtByWhere(strwhere); if (dtByWhere.Rows.Count > 0) { if (string.IsNullOrEmpty(dtByWhere.Rows[0]["Total"].ToString())) { this.lblContMoney.Text = "0.00"; } else { this.lblContMoney.Text = dtByWhere.Rows[0]["Total"].ToString(); } this.lblContPayCode.Text = dtByWhere.Rows[0]["Name"].ToString(); } } this.lblInMoney.Text = this.accountModel.PayOutMoney.ToString(); this.lblHandler.Text = this.accountModel.Handler.ToString(); this.lblRemark.Text = this.accountModel.Remark.ToString(); this.lblContractName.Text = this.accountModel.ContractName.ToString(); this.upload.InnerHtml = this.FilesBind(this.hdnAccountID.Value); this.lblPrintDate.Text = DateTime.Now.ToShortDateString(); this.lblPrintPeople.Text = com.jwsoft.pm.entpm.action.PageHelper.QueryUser(this, base.UserCode); this.lblContMoney.Text = (string.IsNullOrEmpty(this.lblContMoney.Text) ? "0.00" : this.lblContMoney.Text); if (this.accountModel.PayOutMoney > Convert.ToDecimal(this.lblContMoney.Text) - Convert.ToDecimal(this.lblPayMoney.Text)) { this.lblInMoney.Attributes.Add("style", "Color:red"); } this.lbljianMoney.Text = (Convert.ToDecimal(this.lblContMoney.Text) - Convert.ToDecimal(this.lblPayMoney.Text)).ToString(); Fund_Prj_Accoun fund_Prj_Accoun = new Fund_Prj_Accoun(); string strwhere2 = " and AccountID='" + fund_Prj_Accoun.getAccountByPrjGuid(this.accountModel.prjGuid.ToString()) + "' "; DataTable accounSumInfo = fund_Prj_Accoun.getAccounSumInfo(strwhere2); this.lblAccountYue.Text = accounSumInfo.Rows[0]["JE"].ToString(); if (base.Request.QueryString["see"] != null && base.Request.QueryString["see"].ToString() == "see") { this.lblAccountYue.Attributes.Add("style", "font-weight:bold"); } else { this.bllProducer.Visible = false; this.btnPrnt.Visible = false; if (Convert.ToDecimal(this.lblAccountYue.Text.ToString()) < Convert.ToDecimal(this.lblInMoney.Text.ToString())) { Label expr_4D5 = this.lblAccountYue; expr_4D5.Text += " 本次记账金额大于账户余额!"; this.lblAccountYue.Attributes.Add("style", "font-weight:bold;color:red"); } } this.ShowGuideLine(this.accountModel.RPGuid.ToString()); } }
protected void Page_Load(object sender, EventArgs e) { if (!base.IsPostBack) { this.hdnZHID.Value = base.Request.QueryString["ZHID"].ToString(); this.HdnSub.Value = base.Request.QueryString["Sub"].ToString(); string strwhere = " and AccountID='" + base.Request["ZHID"].ToString() + "' "; Fund_Prj_Accoun fund_Prj_Accoun = new Fund_Prj_Accoun(); DataTable accounSumInfo = fund_Prj_Accoun.getAccounSumInfo(strwhere); this.hdnyue.Value = accounSumInfo.Rows[0]["JE"].ToString(); if (this.HdnSub.Value == "0") { this.lblSel.Text = "资金支付申请"; } else { this.lblSel.Text = "费用名称"; } if (base.Request.QueryString["Action"] == "Add") { this.txtAccCode.Text = DateTime.Now.ToString("yyyyMMddHHmmssfff"); this.hdnAccountID.Value = Guid.NewGuid().ToString(); this.txtInDate.Text = DateTime.Now.ToString("yyyy-MM-dd"); this.txtInPeople.Text = com.jwsoft.pm.entpm.PageHelper.QueryUser(this, base.UserCode); this.hdnPeopleCode.Value = base.UserCode; this.aM = this.al.GetModel(this.hdnZHID.Value); if (!this.aM.PrjGuid.StartsWith("'")) { PrjInfoModel modelByPrjGuid = this.ptPrjInfo.GetModelByPrjGuid(this.aM.PrjGuid); if (modelByPrjGuid != null) { this.txtPrjName.Text = modelByPrjGuid.PrjName; this.hdnProjectCode.Value = this.aM.PrjGuid; } } } else { this.hdnAccountID.Value = base.Request.QueryString["AccountID"].ToString(); this.accountModel = this.AccountBll.GetModel(new Guid(this.hdnAccountID.Value)); this.txtAccCode.Text = this.accountModel.PayOutCode.ToString(); this.txtInDate.Text = Convert.ToDateTime(this.accountModel.PayOutTime).ToString("yyyy-MM-dd"); this.txtInPeople.Text = com.jwsoft.pm.entpm.PageHelper.QueryUser(this, this.accountModel.PayOutPeople); this.hdnPeopleCode.Value = this.accountModel.PayOutPeople; this.hdnProjectCode.Value = this.accountModel.prjGuid.ToString(); PrjInfoModel modelByPrjGuid2 = this.ptPrjInfo.GetModelByPrjGuid(this.accountModel.prjGuid); if (modelByPrjGuid2 != null) { this.txtPrjName.Text = modelByPrjGuid2.PrjName; } this.txtRemark.Text = this.accountModel.Remark.ToString(); this.txtInMoney.Text = this.accountModel.PayOutMoney.ToString(); this.txtHandler.Text = this.accountModel.Handler.ToString(); this.hdnRPUID.Value = this.accountModel.RPGuid.ToString(); this.txtPayOut.Text = this.AccountBll.getMoneyByPayCode(this.accountModel.RPGuid.ToString()).ToString(); this.txtPayMoney.Text = "0.00"; if (this.HdnSub.Value == "0") { PayoutPayment payoutPayment = new PayoutPayment(); PayoutPaymentModel model = payoutPayment.GetModel(this.accountModel.RPGuid.ToString()); if (model != null) { this.txtRPCode.Text = model.PaymentCode.ToString(); this.txtPayMoney.Text = model.PaymentMoney.ToString(); } } else { string strwhere2 = " inDiaryId ='" + this.accountModel.RPGuid.ToString() + "' "; DataTable dtByWhere = OrganizationDiary.getDtByWhere(strwhere2); if (dtByWhere.Rows.Count > 0) { if (string.IsNullOrEmpty(dtByWhere.Rows[0]["Total"].ToString())) { this.txtPayMoney.Text = "0.00"; } else { this.txtPayMoney.Text = dtByWhere.Rows[0]["Total"].ToString(); } this.txtRPCode.Text = dtByWhere.Rows[0]["Name"].ToString(); } } this.txtJianMoney.Text = (Convert.ToDecimal(this.txtPayMoney.Text) - Convert.ToDecimal(this.txtPayOut.Text)).ToString(); } this.FileUpload1.Class = "AccountPayOut"; this.FileUpload1.RecordCode = this.hdnAccountID.Value; } }