public int Update(IncometModifyModel model) { StringBuilder builder = new StringBuilder(); builder.Append("update Con_Incomet_Modify set "); builder.Append("ContractID=@ContractID,"); builder.Append("ChangeCode=@ChangeCode,"); builder.Append("ChangeTime=@ChangeTime,"); builder.Append("ChangePrice=@ChangePrice,"); builder.Append("ChangeReason=@ChangeReason,"); builder.Append("Transactor=@Transactor,"); builder.Append("Annex=@Annex,"); builder.Append("Remark=@Remark,"); builder.Append("InputPerson=@InputPerson,"); builder.Append("InputDate=@InputDate"); builder.Append(" where ID=@ID "); SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@ID", SqlDbType.NVarChar, 0x40), new SqlParameter("@ContractID", SqlDbType.NVarChar, 0x40), new SqlParameter("@ChangeCode", SqlDbType.NVarChar, 0x40), new SqlParameter("@ChangeTime", SqlDbType.DateTime), new SqlParameter("@ChangePrice", SqlDbType.Decimal, 9), new SqlParameter("@ChangeReason", SqlDbType.NVarChar, 500), new SqlParameter("@Transactor", SqlDbType.NVarChar, 0x40), new SqlParameter("@Annex", SqlDbType.NVarChar, 200), new SqlParameter("@Remark", SqlDbType.NVarChar), new SqlParameter("@InputPerson", SqlDbType.NVarChar, 0x40), new SqlParameter("@InputDate", SqlDbType.DateTime) }; commandParameters[0].Value = model.ID; commandParameters[1].Value = model.ContractID; commandParameters[2].Value = model.ChangeCode; commandParameters[3].Value = model.ChangeTime; commandParameters[4].Value = model.ChangePrice; commandParameters[5].Value = model.ChangeReason; commandParameters[6].Value = model.Transactor; commandParameters[7].Value = model.Annex; commandParameters[8].Value = model.Remark; commandParameters[9].Value = model.InputPerson; commandParameters[10].Value = model.InputDate; return(SqlHelper.ExecuteNonQuery(CommandType.Text, builder.ToString(), commandParameters)); }
public IncometModifyModel ReaderBind(IDataReader dataReader) { IncometModifyModel model = new IncometModifyModel { ID = dataReader["ID"].ToString(), ContractID = dataReader["ContractID"].ToString(), ChangeCode = dataReader["ChangeCode"].ToString() }; object obj2 = dataReader["ChangeTime"]; if ((obj2 != null) && (obj2 != DBNull.Value)) { model.ChangeTime = new DateTime?((DateTime)obj2); } obj2 = dataReader["ChangePrice"]; if ((obj2 != null) && (obj2 != DBNull.Value)) { model.ChangePrice = new decimal?((decimal)obj2); } model.ChangeReason = dataReader["ChangeReason"].ToString(); model.Transactor = dataReader["Transactor"].ToString(); model.Annex = dataReader["Annex"].ToString(); model.Remark = dataReader["Remark"].ToString(); model.InputPerson = dataReader["InputPerson"].ToString(); obj2 = dataReader["InputDate"]; if ((obj2 != null) && (obj2 != DBNull.Value)) { model.InputDate = new DateTime?((DateTime)obj2); } return(model); }
public void InitPage() { if (base.Request.QueryString["id"] != null) { this.lblTitle.Text = "编辑收入合同变更"; IncometModifyModel model = this.incometModifyBll.GetModel(base.Request.QueryString["id"]); this.txtChangeCode.Text = model.ChangeCode; this.hdChangeCode.Value = model.ChangeCode; this.txtChangePrice.Text = model.ChangePrice.ToString(); this.txtChangeReason.Text = model.ChangeReason; this.txtChangeTime.Text = Common2.GetTime(model.ChangeTime.ToString()); this.txtInputDate.Text = Common2.GetTime(model.InputDate.ToString()); this.txtInputPerson.Text = model.InputPerson; this.txtRemark.Text = model.Remark; this.txtTransactor.Text = model.Transactor; this.hdGuid.Value = model.ID; this.DataBindSheet(model.ID); } 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(); } IncometContractModel model2 = this.incometContractBll.GetModel(base.Request.QueryString["ContractID"]); this.txtContractCode.Text = model2.ContractCode; this.txtContractName.Text = model2.ContractName; this.txtContractPrice.Text = model2.ContractPrice.ToString(); this.txtEndPrice.Text = WebUtil.GetEnPrice(model2.ContractPrice.ToString(), model2.ContractID); this.txtSignedTime.Text = Common2.GetTime(model2.SignedTime.ToString()); if (model2.Project != null) { this.hfldPrjGuid.Value = model2.Project.PrjGuid.ToString(); } else { List <string> prjInfoZTBIncoment = this.prjInfoBll.GetPrjInfoZTBIncoment(base.Request.QueryString["ContractID"]); if (prjInfoZTBIncoment.Count > 0) { this.hfldPrjGuid.Value = prjInfoZTBIncoment[4].ToString(); } } this.FileLink1.MID = 1907; this.FileLink1.FID = this.hdGuid.Value; this.FileLink1.Type = 1; }
public IncometModifyModel GetModel(string ID) { StringBuilder builder = new StringBuilder(); builder.Append("select ID,ContractID,ChangeCode,ChangeTime,ChangePrice,ChangeReason,Transactor,Annex,Remark,InputPerson,InputDate from Con_Incomet_Modify "); builder.Append(" where ID=@ID "); IncometModifyModel 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); }
public int Add(IncometModifyModel model) { StringBuilder builder = new StringBuilder(); builder.Append("insert into Con_Incomet_Modify("); builder.Append("ID,ContractID,ChangeCode,ChangeTime,ChangePrice,ChangeReason,Transactor,Annex,Remark,InputPerson,InputDate)"); builder.Append(" values ("); builder.Append("@ID,@ContractID,@ChangeCode,@ChangeTime,@ChangePrice,@ChangeReason,@Transactor,@Annex,@Remark,@InputPerson,@InputDate)"); SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@ID", SqlDbType.NVarChar, 0x40), new SqlParameter("@ContractID", SqlDbType.NVarChar, 0x40), new SqlParameter("@ChangeCode", SqlDbType.NVarChar, 0x40), new SqlParameter("@ChangeTime", SqlDbType.DateTime), new SqlParameter("@ChangePrice", SqlDbType.Decimal, 9), new SqlParameter("@ChangeReason", SqlDbType.NVarChar, 500), new SqlParameter("@Transactor", SqlDbType.NVarChar, 0x40), new SqlParameter("@Annex", SqlDbType.NVarChar, 200), new SqlParameter("@Remark", SqlDbType.NVarChar), new SqlParameter("@InputPerson", SqlDbType.NVarChar, 0x40), new SqlParameter("@InputDate", SqlDbType.DateTime) }; commandParameters[0].Value = model.ID; commandParameters[1].Value = model.ContractID; commandParameters[2].Value = model.ChangeCode; commandParameters[3].Value = model.ChangeTime; commandParameters[4].Value = model.ChangePrice; commandParameters[5].Value = model.ChangeReason; commandParameters[6].Value = model.Transactor; commandParameters[7].Value = model.Annex; commandParameters[8].Value = model.Remark; commandParameters[9].Value = model.InputPerson; commandParameters[10].Value = model.InputDate; return(SqlHelper.ExecuteNonQuery(CommandType.Text, builder.ToString(), commandParameters)); }
public int Update(IncometModifyModel model) { return(this.incometModify.Update(model)); }
public int Add(IncometModifyModel model) { return(this.incometModify.Add(model)); }