public IncometPaymentModel GetModel() { IncometPaymentModel incometPaymentModel = new IncometPaymentModel(); incometPaymentModel.Annex = ""; incometPaymentModel.CllectionCode = this.txtCllectionCode.Text; incometPaymentModel.CllectionPrice = new decimal?(Convert.ToDecimal(this.txtCllectionPrice.Text)); incometPaymentModel.CllectionTime = new DateTime?(Convert.ToDateTime(this.txtCllectionTime.Text)); incometPaymentModel.CllectionUser = this.txtCllectionUser.Text; incometPaymentModel.ContractID = base.Request.QueryString["ContractID"]; incometPaymentModel.ID = this.hdGuid.Value; incometPaymentModel.InputDate = new DateTime?(Convert.ToDateTime(this.txtInputDate.Text)); incometPaymentModel.InputPerson = this.txtInputPerson.Text; incometPaymentModel.Remark = this.txtRemark.Text; if (this.hldfIsFundPlan.Value != "0") { if (this.hlfdFundPlanUID.Value.Trim() != "") { incometPaymentModel.MonthPlanUID = this.hlfdFundPlanUID.Value; } else { incometPaymentModel.MonthPlanUID = null; } } else { incometPaymentModel.MonthPlanUID = null; } return(incometPaymentModel); }
public IncometPaymentModel ReaderBind(IDataReader dataReader) { IncometPaymentModel model = new IncometPaymentModel { ID = dataReader["ID"].ToString(), ContractID = dataReader["ContractID"].ToString(), CllectionCode = dataReader["CllectionCode"].ToString() }; object obj2 = dataReader["CllectionTime"]; if ((obj2 != null) && (obj2 != DBNull.Value)) { model.CllectionTime = new DateTime?((DateTime)obj2); } model.CllectionUser = dataReader["CllectionUser"].ToString(); model.InputPerson = dataReader["InputPerson"].ToString(); obj2 = dataReader["CllectionPrice"]; if ((obj2 != null) && (obj2 != DBNull.Value)) { model.CllectionPrice = new decimal?((decimal)obj2); } model.Annex = dataReader["Annex"].ToString(); model.Remark = dataReader["Remark"].ToString(); obj2 = dataReader["InputDate"]; if ((obj2 != null) && (obj2 != DBNull.Value)) { model.InputDate = new DateTime?((DateTime)obj2); } obj2 = dataReader["state"]; if ((obj2 != null) && (obj2 != DBNull.Value)) { model.State = (int)dataReader["state"]; } model.MonthPlanUID = DBHelper.GetString(dataReader["MonthPlanUID"]); return(model); }
public IncometPaymentModel GetModel(string ID) { StringBuilder builder = new StringBuilder(); builder.Append("select ID,ContractID,CllectionCode,CllectionTime,CllectionUser,InputPerson,CllectionPrice,Annex,Remark,InputDate,state,MonthPlanUID from Con_Incomet_Payment "); builder.Append(" where ID=@ID "); IncometPaymentModel model = null; using (IDataReader reader = SqlHelper.ExecuteReader(CommandType.Text, builder.ToString(), new SqlParameter[] { new SqlParameter("@ID", ID) })) { if (reader.Read()) { model = this.ReaderBind(reader); } } return(model); }
protected void Page_Load(object sender, EventArgs e) { if (!base.IsPostBack) { this.lblBllProducer.Text = WebUtil.GetUserNames(this.Session["yhdm"].ToString()); this.lblPrintDate.Text = Common2.GetTime(DateTime.Now); IncometContractModel model = this.incometContractBll.GetModel(base.Request.QueryString["ContractID"]); if (model != null) { this.lblContractCode.Text = model.ContractCode; this.lblContractName.Text = model.ContractName; this.lblContractMoney.Text = WebUtil.GetEnPrice(model.ContractPrice.ToString(), model.ContractID); this.lblSignedDate.Text = Common2.GetTime(model.SignedTime.ToString()); this.lblPrjCode.Text = ((model.Project != null) ? model.Project.PrjCode : string.Empty); this.lblPrjName.Text = ((model.Project != null) ? model.Project.PrjName : string.Empty); this.lblPaymentSum.Text = WebUtil.GetPaymentSum(model.ContractID, "Con_Incomet_Payment", "CllectionPrice"); this.lbldiff.Text = string.Concat(Convert.ToDecimal(this.lblContractMoney.Text) - Convert.ToDecimal(this.lblPaymentSum.Text)); } IncometPaymentModel model2 = this.incometPaymentBll.GetModel(base.Request.QueryString["id"]); if (model2 != null) { this.lblPaymentCode.Text = model2.CllectionCode; this.lblPayMoney.Text = model2.CllectionPrice.ToString(); this.lblPayTime.Text = Common2.GetTime(model2.CllectionTime.ToString()); this.lblPaymentUser.Text = model2.CllectionUser; this.lblInputTime.Text = Common2.GetTime(model2.InputDate.ToString()); this.lblInputUser.Text = model2.InputPerson; this.lblnote.Text = model2.Remark; List <string> fundPlanByMonthPlanUID = this.incometPaymentBll.GetFundPlanByMonthPlanUID(model2.MonthPlanUID, false); if (fundPlanByMonthPlanUID.Count > 0) { this.lblPlanMonth.Text = fundPlanByMonthPlanUID[1].ToString(); this.lblPlanMoney.Text = fundPlanByMonthPlanUID[2].ToString(); this.lblFinshMoney.Text = fundPlanByMonthPlanUID[4].ToString(); this.lblAllowCollectMoney.Text = fundPlanByMonthPlanUID[5].ToString(); this.lblPlanote.Text = fundPlanByMonthPlanUID[6].ToString(); } } this.lblUpFiled.Text = FileView.FilesBind(1908, model2.ID); } }
public void InitPage() { if (base.Request.QueryString["id"] != null) { this.lblTitle.Text = "编辑收入合同收款"; IncometPaymentModel model = this.incometPaymentBll.GetModel(base.Request.QueryString["id"]); this.txtCllectionCode.Text = model.CllectionCode; this.hdCode.Value = model.CllectionCode; this.txtCllectionPrice.Text = model.CllectionPrice.ToString(); this.txtCllectionTime.Text = Common2.GetTime(model.CllectionTime.ToString()); this.txtCllectionUser.Text = model.CllectionUser; this.txtInputDate.Text = Common2.GetTime(model.InputDate.ToString()); this.txtInputPerson.Text = model.InputPerson; this.txtRemark.Text = model.Remark; this.hdGuid.Value = model.ID; this.hlfdFundPlanUID.Value = model.MonthPlanUID; if (this.hldfIsExamineApprove.Value == "0") { List <string> fundPlanByMonthPlanUID = this.incometPaymentBll.GetFundPlanByMonthPlanUID(this.hlfdFundPlanUID.Value.Trim(), false); if (fundPlanByMonthPlanUID.Count > 0) { this.txtMonthDate.Value = fundPlanByMonthPlanUID[1].ToString(); this.txtPlanMoney.Value = fundPlanByMonthPlanUID[2].ToString(); this.txtCollectedMoney.Value = fundPlanByMonthPlanUID[4].ToString(); this.lblAllowCollectMoney.Value = fundPlanByMonthPlanUID[5].ToString(); this.txtFundPlanRemark.Value = fundPlanByMonthPlanUID[6].ToString(); } } } else { this.lblTitle.Text = "新增收入合同收款"; this.txtInputDate.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); this.txtInputPerson.Text = PageHelper.QueryUser(this, base.UserCode); this.hdGuid.Value = Guid.NewGuid().ToString(); if (this.hldfIsExamineApprove.Value == "0") { this.hlfdFundPlanUID.Value = this.incometPaymentBll.GetCurrentMonthUID(this.contractId, false); List <string> fundPlanByMonthPlanUID2 = this.incometPaymentBll.GetFundPlanByMonthPlanUID(this.hlfdFundPlanUID.Value.Trim(), false); if (fundPlanByMonthPlanUID2.Count > 0) { this.txtMonthDate.Value = fundPlanByMonthPlanUID2[1].ToString(); this.txtPlanMoney.Value = fundPlanByMonthPlanUID2[2].ToString(); this.txtCollectedMoney.Value = fundPlanByMonthPlanUID2[4].ToString(); this.lblAllowCollectMoney.Value = fundPlanByMonthPlanUID2[5].ToString(); this.txtFundPlanRemark.Value = fundPlanByMonthPlanUID2[6].ToString(); } } } IncometContractModel model2 = this.incometContractBll.GetModel(base.Request.QueryString["ContractID"]); this.txtContractCode.Text = model2.ContractCode; this.txtContractName.Text = model2.ContractName; this.txtContractPrice.Text = WebUtil.GetEnPrice(model2.ContractPrice.ToString(), model2.ContractID); this.txtSignedTime.Text = Common2.GetTime(model2.SignedTime.ToString()); this.txtPrjCode.Text = ((model2.Project != null) ? model2.Project.PrjCode : string.Empty); this.txtPrjName.Text = ((model2.Project != null) ? model2.Project.PrjName : string.Empty); this.txtSumCllection.Text = WebUtil.GetPaymentSum(model2.ContractID, "Con_Incomet_Payment", "CllectionPrice"); this.txtDiffAmount.Text = string.Concat(Convert.ToDecimal(this.txtContractPrice.Text) - Convert.ToDecimal(this.txtSumCllection.Text)); this.FileLink1.MID = 1908; this.FileLink1.FID = this.hdGuid.Value; this.FileLink1.Type = 1; this.hldfContractId.Value = model2.ContractID; }
public int Update(IncometPaymentModel model) { return(this.incometPayment.Update(model)); }
public int Add(IncometPaymentModel model) { return(this.incometPayment.Add(model)); }
public int Update(IncometPaymentModel model) { StringBuilder builder = new StringBuilder(); builder.Append("update Con_Incomet_Payment set "); builder.Append("ContractID=@ContractID,"); builder.Append("CllectionCode=@CllectionCode,"); builder.Append("CllectionTime=@CllectionTime,"); builder.Append("CllectionUser=@CllectionUser,"); builder.Append("InputPerson=@InputPerson,"); builder.Append("CllectionPrice=@CllectionPrice,"); builder.Append("Annex=@Annex,"); builder.Append("Remark=@Remark,"); builder.Append("InputDate=@InputDate"); if (model.MonthPlanUID != null) { builder.Append(",MonthPlanUID=@MonthPlanUID "); } builder.Append(" where ID=@ID "); List <SqlParameter> list = new List <SqlParameter>(); if (model.MonthPlanUID != null) { list.Add(new SqlParameter("@ID", SqlDbType.NVarChar, 0x40)); list.Add(new SqlParameter("@ContractID", SqlDbType.NVarChar, 0x40)); list.Add(new SqlParameter("@CllectionCode", SqlDbType.NVarChar, 0x40)); list.Add(new SqlParameter("@CllectionTime", SqlDbType.DateTime)); list.Add(new SqlParameter("@CllectionUser", SqlDbType.NVarChar, 0x40)); list.Add(new SqlParameter("@InputPerson", SqlDbType.NVarChar, 0x40)); list.Add(new SqlParameter("@CllectionPrice", SqlDbType.Decimal, 9)); list.Add(new SqlParameter("@Annex", SqlDbType.NVarChar, 200)); list.Add(new SqlParameter("@Remark", SqlDbType.NVarChar)); list.Add(new SqlParameter("@InputDate", SqlDbType.DateTime)); list.Add(new SqlParameter("@MonthPlanUID", SqlDbType.NVarChar, 0x40)); list[0].Value = model.ID; list[1].Value = model.ContractID; list[2].Value = model.CllectionCode; list[3].Value = model.CllectionTime; list[4].Value = model.CllectionUser; list[5].Value = model.InputPerson; list[6].Value = model.CllectionPrice; list[7].Value = model.Annex; list[8].Value = model.Remark; list[9].Value = model.InputDate; list[10].Value = model.MonthPlanUID; } else { list.Add(new SqlParameter("@ID", SqlDbType.NVarChar, 0x40)); list.Add(new SqlParameter("@ContractID", SqlDbType.NVarChar, 0x40)); list.Add(new SqlParameter("@CllectionCode", SqlDbType.NVarChar, 0x40)); list.Add(new SqlParameter("@CllectionTime", SqlDbType.DateTime)); list.Add(new SqlParameter("@CllectionUser", SqlDbType.NVarChar, 0x40)); list.Add(new SqlParameter("@InputPerson", SqlDbType.NVarChar, 0x40)); list.Add(new SqlParameter("@CllectionPrice", SqlDbType.Decimal, 9)); list.Add(new SqlParameter("@Annex", SqlDbType.NVarChar, 200)); list.Add(new SqlParameter("@Remark", SqlDbType.NVarChar)); list.Add(new SqlParameter("@InputDate", SqlDbType.DateTime)); list[0].Value = model.ID; list[1].Value = model.ContractID; list[2].Value = model.CllectionCode; list[3].Value = model.CllectionTime; list[4].Value = model.CllectionUser; list[5].Value = model.InputPerson; list[6].Value = model.CllectionPrice; list[7].Value = model.Annex; list[8].Value = model.Remark; list[9].Value = model.InputDate; } return(SqlHelper.ExecuteNonQuery(CommandType.Text, builder.ToString(), list.ToArray())); }
public int Add(IncometPaymentModel model) { StringBuilder builder = new StringBuilder(); builder.Append("insert into Con_Incomet_Payment("); if (model.MonthPlanUID != null) { builder.Append("ID,ContractID,CllectionCode,CllectionTime,CllectionUser,InputPerson,CllectionPrice,Annex,Remark,InputDate,MonthPlanUID)"); } else { builder.Append("ID,ContractID,CllectionCode,CllectionTime,CllectionUser,InputPerson,CllectionPrice,Annex,Remark,InputDate)"); } builder.Append(" values ("); if (model.MonthPlanUID != null) { builder.Append("@ID,@ContractID,@CllectionCode,@CllectionTime,@CllectionUser,@InputPerson,@CllectionPrice,@Annex,@Remark,@InputDate,@MonthPlanUID)"); } else { builder.Append("@ID,@ContractID,@CllectionCode,@CllectionTime,@CllectionUser,@InputPerson,@CllectionPrice,@Annex,@Remark,@InputDate)"); } List <SqlParameter> list = new List <SqlParameter>(); if (model.MonthPlanUID != null) { list.Add(new SqlParameter("@ID", SqlDbType.NVarChar, 0x40)); list.Add(new SqlParameter("@ContractID", SqlDbType.NVarChar, 0x40)); list.Add(new SqlParameter("@CllectionCode", SqlDbType.NVarChar, 0x40)); list.Add(new SqlParameter("@CllectionTime", SqlDbType.DateTime)); list.Add(new SqlParameter("@CllectionUser", SqlDbType.NVarChar, 0x40)); list.Add(new SqlParameter("@InputPerson", SqlDbType.NVarChar, 0x40)); list.Add(new SqlParameter("@CllectionPrice", SqlDbType.Decimal, 9)); list.Add(new SqlParameter("@Annex", SqlDbType.NVarChar, 200)); list.Add(new SqlParameter("@Remark", SqlDbType.NVarChar)); list.Add(new SqlParameter("@InputDate", SqlDbType.DateTime)); list.Add(new SqlParameter("@MonthPlanUID", SqlDbType.NVarChar, 0x40)); list[0].Value = model.ID; list[1].Value = model.ContractID; list[2].Value = model.CllectionCode; list[3].Value = model.CllectionTime; list[4].Value = model.CllectionUser; list[5].Value = model.InputPerson; list[6].Value = model.CllectionPrice; list[7].Value = model.Annex; list[8].Value = model.Remark; list[9].Value = model.InputDate; list[10].Value = model.MonthPlanUID; } else { list.Add(new SqlParameter("@ID", SqlDbType.NVarChar, 0x40)); list.Add(new SqlParameter("@ContractID", SqlDbType.NVarChar, 0x40)); list.Add(new SqlParameter("@CllectionCode", SqlDbType.NVarChar, 0x40)); list.Add(new SqlParameter("@CllectionTime", SqlDbType.DateTime)); list.Add(new SqlParameter("@CllectionUser", SqlDbType.NVarChar, 0x40)); list.Add(new SqlParameter("@InputPerson", SqlDbType.NVarChar, 0x40)); list.Add(new SqlParameter("@CllectionPrice", SqlDbType.Decimal, 9)); list.Add(new SqlParameter("@Annex", SqlDbType.NVarChar, 200)); list.Add(new SqlParameter("@Remark", SqlDbType.NVarChar)); list.Add(new SqlParameter("@InputDate", SqlDbType.DateTime)); list[0].Value = model.ID; list[1].Value = model.ContractID; list[2].Value = model.CllectionCode; list[3].Value = model.CllectionTime; list[4].Value = model.CllectionUser; list[5].Value = model.InputPerson; list[6].Value = model.CllectionPrice; list[7].Value = model.Annex; list[8].Value = model.Remark; list[9].Value = model.InputDate; } return(SqlHelper.ExecuteNonQuery(CommandType.Text, builder.ToString(), list.ToArray())); }