public static ItemProgInfo GetItemProgInfo(string ID) { ItemProgInfo info = new ItemProgInfo(); DataTable table = publicDbOpClass.DataTableQuary("select * from Prj_ItemProg where ID=" + ID); if (table.Rows[0]["ApproveDate"].ToString() != "") { info.ApproveDate = DateTime.Parse(table.Rows[0]["ApproveDate"].ToString()); } info.ApproveIdea = table.Rows[0]["ApproveIdea"].ToString(); info.ApprovePerson = table.Rows[0]["ApprovePerson"].ToString(); if (table.Rows[0]["ApproveResult"].ToString() != "") { info.ApproveResult = int.Parse(table.Rows[0]["ApproveResult"].ToString()); } info.ByProgObject = table.Rows[0]["ByProgObject"].ToString(); if (table.Rows[0]["ID"].ToString() != "") { info.ID = int.Parse(table.Rows[0]["ID"].ToString()); } info.PrjCode = table.Rows[0]["PrjCode"].ToString(); info.ProgCause = table.Rows[0]["ProgCause"].ToString(); info.ProgDate = DateTime.Parse(table.Rows[0]["ProgDate"].ToString()); info.ProgMoney = decimal.Parse(table.Rows[0]["ProgMoney"].ToString()); info.ProgGist = table.Rows[0]["ProgGist"].ToString(); info.ProgBurstunit = table.Rows[0]["ProgBurstunit"].ToString(); info.ProgSortCode = int.Parse(table.Rows[0]["ProgSortCode"].ToString()); info.ProgUnit = table.Rows[0]["ProgUnit"].ToString(); info.Remark = table.Rows[0]["Remark"].ToString(); info.Principal = table.Rows[0]["Principal"].ToString(); return(info); }
protected void Button_save_Click(object sender, EventArgs e) { ItemProgInfo itemProgInfo = new ItemProgInfo(); if (base.Request["pk"] != null) { itemProgInfo.ID = int.Parse(base.Request["pk"].ToString()); } itemProgInfo.ApproveDate = DateTime.Parse(this.DateBox_sprq.Text); itemProgInfo.ApproveIdea = this.TextBox_spyj.Text; itemProgInfo.ApprovePerson = this.TextBox_spr.Text; if (this.RadioButton_ok.Checked) { itemProgInfo.ApproveResult = 1; } else { itemProgInfo.ApproveResult = -1; } bool flag = ItemProgAction.ItemProgInfoOp(itemProgInfo, "Sp"); if (flag) { string text = " parent.desktop.flowclass.location='/EPC/17/Frame.aspx?url=../../epc/17/PPM/Prog/ItemProgList.aspx&Type=ShenHe&PrjState=0&Levels=0';"; text += "alert('保存成功');"; text += "top.frameWorkArea.window.desktop.getActive().close();"; this.JavaScriptControl1.Text = text; return; } this.JavaScriptControl1.Text = "alert('保存失败!');"; }
private void bind(string pk) { ItemProgInfo itemProgInfo = ItemProgAction.GetItemProgInfo(pk); DateTime now = DateTime.Now; this.DateBox_sprq.Text = string.Format("{0:yyyy-MM-dd}", now); this.TextBox_spyj.Text = itemProgInfo.ApproveIdea; this.TextBox_spr.Text = itemProgInfo.ApprovePerson; if (itemProgInfo.ApproveResult == 1) { this.RadioButton_ok.Checked = true; return; } if (itemProgInfo.ApproveResult == 0) { this.RadioButton_no.Checked = true; } }
public static bool ItemProgInfoOp(ItemProgInfo objinfo, string OpType) { string sqlString = ""; if (OpType == "Insert") { sqlString = string.Concat(new object[] { "Insert into Prj_ItemProg(PrjCode,ProgUnit,ByProgObject,ProgGist,ProgCause,ProgMoney,ProgSortCode,ProgDate,Remark,ProgBurstunit,ProgSign,Principal,ApproveResult) values('", objinfo.PrjCode, "','", objinfo.ProgUnit, "','", objinfo.ByProgObject, "','", objinfo.ProgGist, "','", objinfo.ProgCause, "',", objinfo.ProgMoney, ",", objinfo.ProgSortCode, ",'", objinfo.ProgDate, "','", objinfo.Remark, "','", objinfo.ProgBurstunit, "',", objinfo.ProgSign, ",'", objinfo.Principal, "',", objinfo.ApproveResult, ")" }); } else if (OpType == "Update") { sqlString = string.Concat(new object[] { "update Prj_ItemProg set ProgUnit='", objinfo.ProgUnit, "',ByProgObject='", objinfo.ByProgObject, "',ProgGist='", objinfo.ProgGist, "',ProgCause='", objinfo.ProgCause, "',ProgMoney=", objinfo.ProgMoney, ",ProgSortCode=", objinfo.ProgSortCode, ",ProgDate='", objinfo.ProgDate, "',Remark='", objinfo.Remark, "',ProgBurstunit='", objinfo.ProgBurstunit, "',Principal='", objinfo.Principal, "' where ID=", objinfo.ID }); } else if (OpType == "Sp") { sqlString = string.Concat(new object[] { "update Prj_ItemProg set ApprovePerson='", objinfo.ApprovePerson, "',ApproveResult=", objinfo.ApproveResult, ",ApproveDate='", objinfo.ApproveDate, "',ApproveIdea='", objinfo.ApproveIdea, "' where ID=", objinfo.ID }); } return(publicDbOpClass.NonQuerySqlString(sqlString)); }
private void bind(string pk) { ItemProgInfo itemProgInfo = ItemProgAction.GetItemProgInfo(pk); this.TextBox_bcfdx.Text = itemProgInfo.ByProgObject; this.Textbox_bz.Text = itemProgInfo.Remark; this.TextBox_cfdw.Text = itemProgInfo.ProgUnit; this.Textbox_cfje.Text = itemProgInfo.ProgMoney.ToString(); this.Textbox_cfrq.Text = itemProgInfo.ProgDate.ToShortDateString().Replace("/", "-"); this.TextBox_cfyj.Text = itemProgInfo.ProgGist; this.TextBox_cfyy.Text = itemProgInfo.ProgCause; this.Textbox_fzr.Text = itemProgInfo.Principal; this.Textbox_cfdkcdw.Text = itemProgInfo.ProgBurstunit; this.DropDownList_lb.SelectedValue = itemProgInfo.ProgSortCode.ToString(); string sqlString = string.Empty; sqlString = "SELECT mark,filesType FROM Prj_ItemProg WHERE ID=" + itemProgInfo.ID; DataTable dataTable = publicDbOpClass.DataTableQuary(sqlString); if (dataTable != null && dataTable.Rows.Count > 0 && dataTable.Rows[0]["mark"] != null) { if (dataTable.Rows[0]["mark"].ToString() != "2") { this.cbkmark.Checked = true; if (dataTable.Rows[0]["filesType"] != null) { this.hidenClass.Value = dataTable.Rows[0]["filesType"].ToString(); } } else { this.cbkmark.Checked = false; } this.hdnmark.Value = dataTable.Rows[0]["mark"].ToString(); } }
protected void Button_save_Click(object sender, EventArgs e) { if (this.TextBox_cfyj.Text.Length > this.TextBox_cfyj.MaxLength) { this.JavaScriptControl1.Text = "alert('奖罚依据输入内容过长!')"; return; } if (this.TextBox_cfyy.Text.Length > this.TextBox_cfyy.MaxLength) { this.JavaScriptControl1.Text = "alert('奖罚原因输入内容过长!')"; return; } if (this.Textbox_bz.Text.Length > this.Textbox_bz.MaxLength) { this.JavaScriptControl1.Text = "alert('备注输入内容过长!')"; return; } ItemProgInfo itemProgInfo = new ItemProgInfo(); if (!string.IsNullOrWhiteSpace(this.pk)) { itemProgInfo.ID = int.Parse(this.pk); } itemProgInfo.ApproveResult = 0; itemProgInfo.ByProgObject = this.TextBox_bcfdx.Text.Trim(); itemProgInfo.Remark = this.Textbox_bz.Text.Trim(); itemProgInfo.ProgUnit = this.TextBox_cfdw.Text; if (this.Textbox_cfje.Text.Trim() != "") { itemProgInfo.ProgMoney = decimal.Parse(this.Textbox_cfje.Text.Trim()); } if (this.Textbox_cfrq.Text.Trim() != "") { itemProgInfo.ProgDate = DateTime.Parse(this.Textbox_cfrq.Text.Trim()); } itemProgInfo.ProgGist = this.TextBox_cfyj.Text.Trim(); itemProgInfo.ProgCause = this.TextBox_cfyy.Text.Trim(); itemProgInfo.Principal = this.Textbox_fzr.Text.Trim(); itemProgInfo.ProgBurstunit = this.Textbox_cfdkcdw.Text.Trim(); if (base.Request["Levels"] != null) { itemProgInfo.ProgSign = int.Parse(base.Request["Levels"].ToString()); } if (base.Request["Prjcode"] != null) { itemProgInfo.PrjCode = base.Request["Prjcode"].ToString(); } if (this.DropDownList_lb.SelectedValue != "") { itemProgInfo.ProgSortCode = int.Parse(this.DropDownList_lb.SelectedValue); } string sqlString = string.Empty; bool flag; if (string.IsNullOrWhiteSpace(this.pk)) { flag = ItemProgAction.ItemProgInfoOp(itemProgInfo, "Insert"); DatumLogic datumLogic = new DatumLogic(); int maxID = datumLogic.getMaxID("Prj_ItemProg", "ID"); if (this.cbkmark.Checked) { sqlString = string.Concat(new object[] { "UPDATE Prj_ItemProg SET filesType = ", this.DDTClass.SelectedValue, ",[mark] = 3 WHERE ID=", maxID }); } else { sqlString = string.Concat(new object[] { "UPDATE Prj_ItemProg SET filesType = ", this.DDTClass.SelectedValue, ",[mark] = 2 WHERE ID=", maxID }); } } else { flag = ItemProgAction.ItemProgInfoOp(itemProgInfo, "Update"); if (this.cbkmark.Checked) { sqlString = string.Concat(new object[] { "UPDATE Prj_ItemProg SET filesType = ", this.DDTClass.SelectedValue, ",[mark] = 3 WHERE ID=", itemProgInfo.ID }); } else { sqlString = string.Concat(new object[] { "UPDATE Prj_ItemProg SET filesType = ", this.DDTClass.SelectedValue, ",[mark] = 2 WHERE ID=", itemProgInfo.ID }); } } if (flag) { publicDbOpClass.ExecSqlString(sqlString); base.RegisterScript("top.ui.tabSuccess({ parentName: '_ItemProgManage' })"); return; } this.JavaScriptControl1.Text = "alert('保存失败!');"; }