//提交数据 void btnSubmit_ServerClick(object sender, EventArgs e) { String taskid = Request.QueryString["TaskID"]; if (String.IsNullOrEmpty(taskid) == false && WebFrame.Util.JValidator.IsDateTime(this.PlanDate.Text)) { String doman = this.ExecuteManID.SelectedValue; string doman1 = this.ExecuteManID.SelectedItem.Text; Tb_TaskBU bu1 = new Tb_TaskBU(); bool succ1 = bu1.JieDanTask(taskid, doman, doman1, this.PlanDate.Text); if (succ1) //submit succ { String js1 = "layer.alert('操作成功!',function(index){;"; js1 = js1 + " var index = parent.layer.getFrameIndex(window.name);"; js1 = js1 + " parent.$('#butSearch').click();"; js1 = js1 + " parent.layer.close(index);});"; JAjax.ExecuteJS(js1); } else { UTools.Alert("操作失败,请重试!"); } } else { UTools.Alert("操作失败,可能的原因是数据类型错误!"); } }
//提交工单信息 void btnSubmit_ServerClick(object sender, EventArgs e) { int succ = 0; WebFrame.Data.JConnect.GetConnect().BeginTrans(); try { String guidid = Request.QueryString["GuidID"]; Dictionary <string, object> dic1 = new Dictionary <string, object>(); Tb_TaskBU bu1 = new Tb_TaskBU(); //1--更新数据 List <SearchField> condition = new List <SearchField>(); condition.Add(new SearchField("Guidid", guidid)); String t1 = String.Empty; if (this.CheckResult.SelectedValue == "1") { dic1["LastWorkLoad"] = this.LastWorkload.Text; dic1["Status"] = "4"; t1 = "工单通过审核"; } else { dic1["Status"] = "1"; t1 = "工单未通过审核"; } bu1.EditData(condition, dic1); //2--创建日志 Tb_Task_LogBU bu2 = new Tb_Task_LogBU(); succ = bu2.NewLog(guidid, t1, this.Remark.Text, "0", this.file1); WebFrame.Data.JConnect.GetConnect().CommitTrans(); } catch (Exception err) { WebFrame.Data.JConnect.GetConnect().RollBackTrans(); succ = 0; WebFrame.Util.JTool.WriteErrorLog(err.ToString()); } if (succ == 1) //submit succ { String js1 = "layer.alert('操作成功!',function(index){;"; js1 = js1 + " var index = parent.layer.getFrameIndex(window.name);"; js1 = js1 + " parent.$('#butSearch').click();"; js1 = js1 + " parent.layer.close(index);});"; JAjax.ExecuteJS(js1); } else { //throw bean1.MyException; UTools.Alert("操作失败,请重试!"); } }
//操作3--退单 private String TuiTaskTask(String TaskID) { String result = "failer"; Tb_TaskBU bu1 = new Tb_TaskBU(); bool succ = bu1.TuiTaskTask(TaskID); if (succ) { result = "ok"; } return(result); }
//提交考核数据 private String SubmitKaoHeData(String TaskID, int workload, int score) { String result = "failer"; Tb_TaskBU bu1 = new Tb_TaskBU(); bool succ = bu1.SubmitKaoHeData(TaskID, workload, score); if (succ) { result = "ok"; } return(result); }
//操作--Complet or not Task private String CompleteTask(String TaskID, int Flag, String Remark) { String result = "failer"; Tb_TaskBU bu1 = new Tb_TaskBU(); bool succ = bu1.CompleteTask(TaskID, Flag, Remark); if (succ) { result = "ok"; } return(result); }
protected override void OnPreRenderComplete(EventArgs e) { if (!Page.IsPostBack) { String guidid = Request.QueryString["GuidID"]; Tb_TaskBU bu1 = new Tb_TaskBU(); DataRow dr1 = bu1.GetFirstDataRow(guidid, "Workload"); if (dr1 != null) { this.LastWorkload.Text = dr1["Workload"].ToString(); } } base.OnPreRenderComplete(e); }
//操作2--接单 private String JieDanTask(String TaskID, String endDate) { String result = "failer"; Tb_TaskBU bu1 = new Tb_TaskBU(); int noTask = bu1.GetNoCompleteTaskCount("1"); if (noTask < 3) { bool succ = bu1.JieDanTask(TaskID, endDate); if (succ) { result = "ok"; } } return(result); }
protected override void OnPreRenderComplete(EventArgs e) { if (!Page.IsPostBack) { String guidid = Request.QueryString["GuidID"]; Tb_TaskBU bu1 = new Tb_TaskBU(); DataRow dr1 = bu1.GetFirstDataRow(guidid, "TestUrl,TestMan"); if (dr1 != null) { this.TestUrl.Text = dr1["TestUrl"].ToString(); String testman = dr1["TestMan"].ToString(); if (this.TestMan.Items.FindByValue(testman) != null) { this.TestMan.SelectedValue = testman; } } } base.OnPreRenderComplete(e); }
//提交工单信息 void btnSubmit_ServerClick(object sender, EventArgs e) { int succ = 0; int succ1 = 0; int bugA = 0; int bugB = 0; int bugC = 0; bool checkdata = true; //表示测试未通过,验证数据的合理性 if (this.TestResult.SelectedValue == "0") { int.TryParse(this.BugA.Text, out bugA); int.TryParse(this.BugB.Text, out bugB); int.TryParse(this.BugC.Text, out bugC); if (bugA < 0 || bugB < 0 || bugC < 0 || (bugA + bugB + bugC) <= 0) { checkdata = false; UTools.Alert("提示:测试未通过,请至少输入一个BUG数量!"); } } if (checkdata) { WebFrame.Data.JConnect.GetConnect().BeginTrans(); try { String guidid = Request.QueryString["GuidID"]; Dictionary <string, object> dic1 = new Dictionary <string, object>(); Tb_TaskBU bu1 = new Tb_TaskBU(); //1--更新数据 List <SearchField> condition = new List <SearchField>(); condition.Add(new SearchField("Guidid", guidid)); String result = String.Empty; if (this.TestResult.SelectedValue == "1") { dic1["Status"] = "3"; result = "测试通过"; succ1 = 1; } else { dic1["Status"] = "1"; result = "测试未通过"; } bu1.EditData(condition, dic1); //2--创建日志 String relatefile = String.Empty; String relatruename = String.Empty; Tb_Task_LogBU bu2 = new Tb_Task_LogBU(); succ = bu2.NewLog(guidid, result, this.Remark.Text, "1", this.file1, ref relatefile, ref relatruename); //3--登记Bug记录 if (this.TestResult.SelectedValue == "0") { Tb_Task_BugBU bu3 = new Tb_Task_BugBU(); succ1 = bu3.NewBug(guidid, bugA, bugB, bugC, 0, this.Remark.Text, relatefile, relatruename); } WebFrame.Data.JConnect.GetConnect().CommitTrans(); } catch (Exception err) { WebFrame.Data.JConnect.GetConnect().RollBackTrans(); succ = 0; succ1 = 0; WebFrame.Util.JTool.WriteErrorLog(err.ToString()); } if (succ == 1 && succ1 == 1) //submit succ { String js1 = "layer.alert('操作成功!',function(index){;"; js1 = js1 + " var index = parent.layer.getFrameIndex(window.name);"; js1 = js1 + " parent.$('#butSearch').click();"; js1 = js1 + " parent.layer.close(index);});"; JAjax.ExecuteJS(js1); } else { //throw bean1.MyException; UTools.Alert("操作失败,请重试!"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { String guidid = Request.QueryString["GuidID"]; Tb_TaskBU bu1 = new Tb_TaskBU(); DataRow dr1 = bu1.GetFirstDataRow(guidid, "TaskKind"); int succ = 0; if (dr1 != null) { String taskkind = dr1[0].ToString(); if (taskkind == "1") //处理非开发工单 { WebFrame.Data.JConnect.GetConnect().BeginTrans(); try { Dictionary <string, object> dic1 = new Dictionary <string, object>(); //1--更新数据 List <SearchField> condition = new List <SearchField>(); condition.Add(new SearchField("Guidid", guidid)); String result = String.Empty; dic1["Status"] = "3"; dic1["finishDate"] = DateTime.Now; result = "提交审核"; bu1.EditData(condition, dic1); //2--创建日志 String relatefile = String.Empty; String relatruename = String.Empty; Tb_Task_LogBU bu2 = new Tb_Task_LogBU(); succ = bu2.NewLog(guidid, result, this.Remark.Text, "2", this.file1, ref relatefile, ref relatruename); WebFrame.Data.JConnect.GetConnect().CommitTrans(); } catch (Exception err) { WebFrame.Data.JConnect.GetConnect().RollBackTrans(); } if (succ == 1) //submit succ { String js1 = "layer.alert('操作成功!',function(index){;"; js1 = js1 + " var index = parent.layer.getFrameIndex(window.name);"; js1 = js1 + " parent.$('#butSearch').click();"; js1 = js1 + " parent.layer.close(index);});"; JAjax.ExecuteJS(js1); } else { //throw bean1.MyException; UTools.Alert("操作失败,请重试!"); } } } } }