private void BindData() { ProgressImplementAction progressImplementAction = new ProgressImplementAction(); ProgressImplementInfo implementInfo = progressImplementAction.GetImplementInfo(this.MainId); this.txtActualizeCircs.Text = implementInfo.ActualizeCircs; this.txtExaminePeople.Text = implementInfo.ExaminePeople; this.txtExamineTime.Text = implementInfo.ExamineTime.ToShortDateString(); this.txtFillPeople.Text = implementInfo.FillPeople; this.txtFillTime.Text = implementInfo.FillTime.ToShortDateString(); this.txtRemark.Text = implementInfo.Remark; this.hdnProgressGuid.Value = implementInfo.ProgressGuid; }
public ProgressImplementInfo GetImplementInfo(string MainId) { string sqlString = string.Format("select * from Prj_ProgressPlan_Child where mainid='{0}'", MainId); ProgressImplementInfo info = new ProgressImplementInfo(); DataTable table = publicDbOpClass.DataTableQuary(sqlString); if (table.Rows.Count > 0) { info = this.FormatToImpMedel(table.Rows[0]); } table.Dispose(); return(info); }
public static bool SaveImplement(ProgressImplementInfo objInfo) { string sqlString = "select * from Prj_ProgressPlan_Child where MainId='" + objInfo.MainID + "'"; if (publicDbOpClass.DataTableQuary(sqlString).Rows.Count > 0) { objInfo.MainID = GetNewImplementId(); SaveImplement(objInfo); } else { string str2 = "insert into Prj_ProgressPlan_Child values('" + objInfo.MainID + "','" + objInfo.PlanId + "','"; string str3 = str2 + objInfo.FillPeople + "','" + objInfo.FillTime.ToString() + "','" + objInfo.ExaminePeople + "','"; sqlString = str3 + objInfo.ExamineTime.ToString() + "','" + objInfo.ActualizeCircs + "','" + objInfo.Remark + "','" + objInfo.ProgressGuid + "')"; } return(publicDbOpClass.NonQuerySqlString(sqlString)); }
protected void btnSave_Click(object sender, EventArgs e) { ProgressImplementInfo progressImplementInfo = new ProgressImplementInfo(); progressImplementInfo.ActualizeCircs = this.txtActualizeCircs.Text; progressImplementInfo.ExaminePeople = this.txtExaminePeople.Text; if (this.txtExamineTime.Text.Trim() != "") { progressImplementInfo.ExamineTime = DateTime.Parse(this.txtExamineTime.Text); } progressImplementInfo.FillPeople = this.txtFillPeople.Text; if (this.txtFillTime.Text.Trim() != "") { progressImplementInfo.FillTime = DateTime.Parse(this.txtFillTime.Text); } progressImplementInfo.PlanId = this.PlanId; progressImplementInfo.MainID = this.MainId; progressImplementInfo.Remark = this.txtRemark.Text; progressImplementInfo.ProgressGuid = this.hdnProgressGuid.Value.Trim(); if (this.isNew) { if (ProgressImplementAction.SaveImplement(progressImplementInfo)) { base.RegisterScript("top.ui.tabSuccess({ parentName: '_progressimplementitem' });"); } else { base.RegisterScript("top.ui.alert('保存失败');"); } } else { if (ProgressImplementAction.UpdateImplement(progressImplementInfo)) { base.RegisterScript("top.ui.tabSuccess({ parentName: '_progressimplementitem' });"); } else { base.RegisterScript("top.ui.alert('保存失败');"); } } this.BindData(); }
public static bool UpdateImplement(ProgressImplementInfo objInfo) { string str; if (publicDbOpClass.DataTableQuary(string.Format("select * from Prj_ProgressPlan_Child where MainId='{0}'", objInfo.MainID)).Rows.Count > 0) { string str2 = "update Prj_ProgressPlan_Child set FillPeople='" + objInfo.FillPeople + "',FillTime='"; string str3 = str2 + objInfo.FillTime.ToString() + "',ExaminePeople='" + objInfo.ExaminePeople + "',ExamineTime='"; string str4 = str3 + objInfo.ExamineTime.ToString() + "',ActualizeCircs='" + objInfo.ActualizeCircs + "',Remark='"; str = str4 + objInfo.Remark + "' where MainId='" + objInfo.MainID + "'"; } else { string str5 = "insert into Prj_ProgressPlan_Child values('" + objInfo.MainID + "','" + objInfo.PlanId + "','"; string str6 = str5 + objInfo.FillPeople + "','" + objInfo.FillTime.ToString() + "','" + objInfo.ExaminePeople + "','"; str = str6 + objInfo.ExamineTime.ToString() + "','" + objInfo.ActualizeCircs + "','" + objInfo.Remark + "')"; } return(publicDbOpClass.NonQuerySqlString(str)); }
private ProgressImplementInfo FormatToImpMedel(DataRow dr) { ProgressImplementInfo info = new ProgressImplementInfo { MainID = dr["MainID"].ToString(), PlanId = dr["PlanId"].ToString(), Remark = dr["Remark"].ToString(), ExaminePeople = dr["ExaminePeople"].ToString(), ActualizeCircs = dr["ActualizeCircs"].ToString(), ExamineTime = DateTime.Parse(dr["ExamineTime"].ToString()), FillPeople = dr["FillPeople"].ToString(), FillTime = DateTime.Parse(dr["FillTime"].ToString()) }; foreach (DataRow row in publicDbOpClass.DataTableQuary(string.Format("select AnnexName from XPM_Basic_AnnexList where AnnexType=1724 and RecordCode='{0}'", info.MainID)).Rows) { info.AnnexName = info.AnnexName + row[0].ToString(); } info.ProgressGuid = dr["ProgressGuid"].ToString(); return(info); }