public static int Update(SafetyMeasureInfo model) { StringBuilder builder = new StringBuilder(); builder.Append("update Ent_Safty_Measure set "); Guid prjCode = model.PrjCode; builder.Append("PrjCode='" + model.PrjCode + "',"); if (model.ScheduleCode != null) { builder.Append("ScheduleCode='" + model.ScheduleCode + "',"); } if (model.SaftyMeasure != null) { builder.Append("SaftyMeasure='" + model.SaftyMeasure + "',"); } if (model.Remark != null) { builder.Append("Remark='" + model.Remark + "',"); } builder.Append("mark=" + model.Mark + ","); builder.Append("filesType=" + model.FilesType + ","); int startIndex = builder.ToString().LastIndexOf(","); builder.Remove(startIndex, 1); builder.Append(" where i_id=" + model.i_id); return(publicDbOpClass.ExecSqlString(builder.ToString())); }
protected void Page_Load(object sender, EventArgs e) { if (!base.IsPostBack) { string a; if ((a = this.page_type) != null) { if (!(a == "Add")) { if (a == "Update") { this.LblHead.Text = "修改安全目标方案"; SafetyMeasureAction.GetSingleRow(this.Page_Code); this.InfoObj = this.ActObj.GetSafetyMeasureModel(this.Page_Code); if (this.InfoObj != null) { this.TxtScheduleCode.Text = this.InfoObj.TaskName; this.TxtMeasure.Text = this.InfoObj.SaftyMeasure; this.Txtremark.Text = this.InfoObj.Remark; this.hdnTempScheduleCode.Value = this.InfoObj.ScheduleCode; this.hdnprjcode.Value = this.InfoObj.PrjCode.ToString(); int arg_13D_0 = this.InfoObj.Mark; if (this.InfoObj.Mark.ToString() != "") { int mark = this.InfoObj.Mark; if (mark != 2) { this.cbkmark.Checked = true; int arg_184_0 = this.InfoObj.FilesType; if (this.InfoObj.FilesType.ToString() != "") { this.hidenClass.Value = this.InfoObj.FilesType.ToString(); } } this.hdnmark.Value = mark.ToString(); } } } } else { if (base.Request["PrjCode"] == "") { this.JS.Text = "alert('请选择项目!');window.close();"; } this.LblHead.Text = "新增安全目标方案"; } } this.TxtScheduleCode.Attributes["onclick"] = "javascript:pickSchedule(this);"; } }
public static SafetyMeasureInfo GetSingleSafetyMeasureInfo(Guid projectCode, string scheduleCode) { SafetyMeasureInfo safetyMeasureInfoFromDataRow = new SafetyMeasureInfo(); string saftyViewName = GetSaftyViewName(); using (DataTable table = publicDbOpClass.DataTableQuary("select * from " + saftyViewName + " where PrjCode = '" + projectCode.ToString() + "' and ScheduleCode = '" + scheduleCode + "'")) { if (table.Rows.Count == 1) { safetyMeasureInfoFromDataRow = GetSafetyMeasureInfoFromDataRow(table.Rows[0]); } } return(safetyMeasureInfoFromDataRow); }
public SafetyMeasureInfo GetSafetyMeasureModel(string i_id) { SafetyMeasureInfo info = new SafetyMeasureInfo(); DataTable singleRow = GetSingleRow(i_id); if (singleRow.Rows.Count <= 0) { return(null); } if ((singleRow.Rows[0]["i_id"] != null) && (singleRow.Rows[0]["i_id"].ToString() != "")) { info.i_id = int.Parse(singleRow.Rows[0]["i_id"].ToString()); } if ((singleRow.Rows[0]["PrjCode"] != null) && (singleRow.Rows[0]["PrjCode"].ToString() != "")) { info.PrjCode = new Guid(singleRow.Rows[0]["PrjCode"].ToString()); } if ((singleRow.Rows[0]["ScheduleCode"] != null) && (singleRow.Rows[0]["ScheduleCode"].ToString() != "")) { info.ScheduleCode = singleRow.Rows[0]["ScheduleCode"].ToString(); } if ((singleRow.Rows[0]["SaftyMeasure"] != null) && (singleRow.Rows[0]["SaftyMeasure"].ToString() != "")) { info.SaftyMeasure = singleRow.Rows[0]["SaftyMeasure"].ToString(); } if ((singleRow.Rows[0]["TaskName"] != null) && (singleRow.Rows[0]["TaskName"].ToString() != "")) { info.TaskName = singleRow.Rows[0]["TaskName"].ToString(); } if ((singleRow.Rows[0]["Remark"] != null) && (singleRow.Rows[0]["Remark"].ToString() != "")) { info.Remark = singleRow.Rows[0]["Remark"].ToString(); } if ((singleRow.Rows[0]["mark"] != null) && (singleRow.Rows[0]["mark"].ToString() != "")) { info.Mark = int.Parse(singleRow.Rows[0]["mark"].ToString()); } if ((singleRow.Rows[0]["filesType"] != null) && (singleRow.Rows[0]["filesType"].ToString() != "")) { info.FilesType = int.Parse(singleRow.Rows[0]["filesType"].ToString()); } return(info); }
protected void Page_Load(object sender, EventArgs e) { if (!base.IsPostBack && base.Request.QueryString["Code"] != null && base.Request.QueryString["Code"].ToString() != "") { com.jwsoft.pm.entpm.PageHelper.BindDropDownTree(this.DDTClass, 20, true); this.InfoObj = this.ActObj.GetSafetyMeasureModel(base.Request.QueryString["Code"].ToString()); if (this.InfoObj != null) { this.litName.Text = this.InfoObj.TaskName; this.litSaftyMeasure.Text = this.InfoObj.SaftyMeasure; this.litRemark.Text = this.InfoObj.Remark; int arg_DF_0 = this.InfoObj.Mark; if (this.InfoObj.Mark.ToString() != "") { this.hdnmark.Value = this.InfoObj.Mark.ToString(); if (this.InfoObj.Mark == 2) { this.litGD.Text = "否"; } else { this.litGD.Text = "是"; } } else { this.litGD.Text = "否"; } int arg_16A_0 = this.InfoObj.FilesType; if (this.InfoObj.FilesType.ToString() != "" && this.InfoObj.FilesType > 0) { this.DDTClass.SelectedValue = this.InfoObj.FilesType.ToString(); if (this.DDTClass.SelectedItem.Text != null && this.DDTClass.SelectedItem.Text.ToString() != "") { this.litType.Text = this.DDTClass.SelectedItem.Text.ToString(); } } } } }
public static int Add(SafetyMeasureInfo model) { StringBuilder builder = new StringBuilder(); StringBuilder builder2 = new StringBuilder(); StringBuilder builder3 = new StringBuilder(); Guid prjCode = model.PrjCode; builder2.Append("PrjCode,"); builder3.Append("'" + model.PrjCode.ToString() + "',"); if (model.ScheduleCode != null) { builder2.Append("ScheduleCode,"); builder3.Append("'" + model.ScheduleCode + "',"); } if (model.SaftyMeasure != null) { builder2.Append("SaftyMeasure,"); builder3.Append("'" + model.SaftyMeasure + "',"); } if (model.Remark != null) { builder2.Append("Remark,"); builder3.Append("'" + model.Remark + "',"); } int mark = model.Mark; builder2.Append("mark,"); builder3.Append(model.Mark + ","); int filesType = model.FilesType; builder2.Append("filesType,"); builder3.Append(model.FilesType + ","); builder.Append("insert into Ent_Safty_Measure("); builder.Append(builder2.ToString().Remove(builder2.Length - 1)); builder.Append(")"); builder.Append(" values ("); builder.Append(builder3.ToString().Remove(builder3.Length - 1)); builder.Append(")"); return(publicDbOpClass.ExecSqlString(builder.ToString())); }