protected void Button3_Click(object sender, EventArgs e) { try { //获取problem_handle_record的ID Session["ID"] = Request.QueryString["ID"]; if (Session["ID"] == null) { Response.Write("<script>alert('ID missing!');window.location.href='../ProblemHandle_AllRecord.aspx';</script>"); } } catch (HttpException ex) { MessageBox.Show("Page load failed due to" + ex.Message); } try { //获取当前记录的内容 BLL.problem_handle_record_BLL bll1 = new BLL.problem_handle_record_BLL(); List <Model.problem_handle_record> list1 = new List <Model.problem_handle_record>(); list1 = bll1.GetOneByID(Convert.ToInt16(Session["ID"])); //把新的内容填进获取的记录 list1[0].Status = "ProblemSolved"; list1[0].End_Date = Convert.ToDateTime(End_Date.Text); list1[0].Is_New = Is_New.Text; list1[0].Problem_Machine_Name = Machine_Name.Text; //更新记录到problem_handle_record表 DAL.problem_handle_record_DAL dal1 = new DAL.problem_handle_record_DAL(); dal1.update(list1[0]); //history_case_info对应次数加一 List <object> Source_Case_ID = new List <object>(); Source_Case_ID = ASPxGridView1.GetSelectedFieldValues("Id"); BLL.history_case_info_BLL bll2 = new BLL.history_case_info_BLL(); bll2.IncreaseOccurranceTimes_ByID(Convert.ToInt16(Source_Case_ID[0])); Response.Write("<script>alert('Case upload completed!');window.location.href='../ProblemHandle_AllRecord.aspx';</script>"); } catch (Exception ex) { MessageBox.Show("Page load failed due to" + ex.Message); } }
protected void Button3_Click(object sender, EventArgs e) { try { //获取最新信息融合概率 BLL.fusion_importance_BLL bll1 = new BLL.fusion_importance_BLL(); List <fusion_importance> data1 = bll1.GetLatestFusionInfo(); //组合信息 DAL.problem_handle_record_DAL dal1 = new DAL.problem_handle_record_DAL(); Model.problem_handle_record model1 = new problem_handle_record(-1, data1[0].MasterID, "RecordSubmitted", Convert.ToDateTime(Start_Date.Text), Convert.ToDateTime("2018/1/1 00:00:00"), data1[0].AOI, data1[0].CLN, data1[0].COA, data1[0].DEV, data1[0].DHC, data1[0].DUV, data1[0].EXP, data1[0].OVN, data1[0].PHC, data1[0].SMA, data1[0].ALL, "", "", -1); dal1.add(model1); //跳转 Response.Redirect("ProblemHandle_AllRecord.aspx", false); } catch (Exception ex) { MessageBox.Show("Page load failed due to" + ex.Message); } }