protected void btnStart_Click(object sender, EventArgs e) { MES.Model.MES_SB_WX m = new MES.Model.MES_SB_WX(); string wx_dh = Request["dh"]; //txtHidden.Value = wx_dh; m.wx_dh = wx_dh; m.wx_begin_date = DateTime.Now; m.wx_banbie = ""; //txtBanBie.Value; m.wx_banzhu = ""; //txtBanZu.Value; m.wx_gonghao = WeiXin.GetCookie("workcode"); //dropWXGongHao.SelectedValue; m.wx_name = ((LoginUser)WeiXin.GetJsonCookie()).UserName; m.p_status = "维修中"; MES.DAL.MES_SB_WX dal = new MES.DAL.MES_SB_WX(); try { if (DbHelperSQL.GetSingle("select count(1) from MES.[dbo].[MES_SB_wx] where wx_dh='" + wx_dh + "'").ToString() == "0") { int result = dal.Add(m);//因经常出现资料未插入事件 Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", @"alert('接修成功.');self.location='BXMonitor.aspx'; ", true); } } catch (Exception ex) { Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", @"layer.alert('失败,请重试.[ex:" + ex.Message + "]'); ", true); } finally { } }
public void btnEnd_Click(object sender, EventArgs e) { MES.Model.MES_SB_WX m = new MES.Model.MES_SB_WX(); string wx_dh = Request["dh"]; foreach (RepeaterItem item in listWXInfo.Items) { TextBox txt = (TextBox)item.FindControl("wx_cs"); m.wx_cs = txt.Text; } m.wx_dh = wx_dh; m.wx_end_date = DateTime.Now; foreach (RepeaterItem item in listWXInfo.Items) { TextBox txt = (TextBox)item.FindControl("wx_cs"); m.wx_result = txt.Text; } m.mo_down_cs = ""; m.p_status = "维修完成"; MES.DAL.MES_SB_WX dal = new MES.DAL.MES_SB_WX(); dal.Update(m); Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", @"alert('提交完成成功.');self.location='BXMonitor.aspx'; ", true); }