protected void btEnd_Click(object sender, EventArgs e) { ProduceTrack info = new ProduceTrack(); ProduceTrackBLL bll = null; try { UIBindHelper.BindModelByControls(this.Page, info); bll = BLLFactory.CreateBLL <ProduceTrackBLL>(); info.PID = this.hiID.Value; info.WORKINGENDTIME = DateTime.Now; info.STATUS = "1"; info.WPID = this.hiGX.Value; info.EQUID = this.hiCB.Value; info.WSID = this.hiGW.Value; info.PRODUCTIONID = this.hiPid.Value; info.CREATETIME = DateTime.Parse(this.HiCREATETIME.Value); info.CREATEUSER = this.HiCREATEUSER.Value; bll.Update(info); ClientScript.RegisterStartupScript(this.GetType(), "myjs", "alert('完成');window.location.href='MaterialTrace.aspx';", true); } catch (Exception ex) { throw ex; } }
protected void btReset_Click(object sender, EventArgs e) { ProduceTrack info = new ProduceTrack(); ProduceTrackBLL bll = null; try { UIBindHelper.BindModelByControls(this.Page, info); bll = BLLFactory.CreateBLL <ProduceTrackBLL>(); info.PID = this.hiID.Value; info.STATUS = "0"; info.WPID = this.hiGX.Value; info.EQUID = this.hiCB.Value; info.WSID = this.hiGW.Value; info.PRODUCTIONID = this.hiPid.Value; info.WORKINGSTARTTIME = DateTime.MinValue; bll.Update(info); BindData(info.PID); } catch (Exception ex) { throw ex; } }
protected void btStart_Click(object sender, EventArgs e) { LoginInfo user = (Session["UserInfo"] as LoginInfo) as LoginInfo; ProduceTrack info = new ProduceTrack(); ProduceTrackBLL bll = null; try { UIBindHelper.BindModelByControls(this.Page, info); bll = BLLFactory.CreateBLL <ProduceTrackBLL>(); info.PRODUCTIONID = this.PRODUCTIONID.Value; if (this.hiID.Value == "") { info.PID = Guid.NewGuid().ToString(); info.STATUS = "0"; info.WPID = this.hiGX.Value; info.EQUID = this.hiCB.Value; info.WSID = this.hiGW.Value; info.FACTORYPID = user.OrgaID; info.WORKINGSTARTTIME = DateTime.Now; //校验是否跳序 string result = new ProcessCheckBLL().CheckSkipProcess(info.BATCHNUMBER, info.PRODUCTIONID, info.WPID); if (result != "") { ClientScript.RegisterStartupScript(this.GetType(), "myjs", "alert('" + result + "');", true); return; } bll.Insert(info); this.HiCREATEUSER.Value = info.CREATEUSER; this.HiCREATETIME.Value = info.CREATETIME.ToString(); } else { info.PID = this.hiID.Value; info.WORKINGSTARTTIME = DateTime.Now; info.STATUS = "0"; info.WPID = this.hiGX.Value; info.EQUID = this.hiCB.Value; info.WSID = this.hiGW.Value; info.CREATETIME = DateTime.Parse(this.HiCREATETIME.Value); info.CREATEUSER = this.HiCREATEUSER.Value; bll.Update(info); } BindData(info.PID); //获取产品信息 if (string.IsNullOrEmpty(this.BatchNumber.SelectedValue) == false) { ProducePlanBLL ppbll = BLLFactory.CreateBLL <ProducePlanBLL>(); ProductInfo result = ppbll.GetPNameByIDBatchNumber(this.BatchNumber.SelectedValue); this.PRODUCTIONID.Value = result.PID; this.PNAME.Text = result.PNAME; } this.hiID.Value = info.PID; //ClientScript.RegisterStartupScript(this.GetType(), "myjs", "window.location.href='MaterialTrace.aspx';", true); } catch (Exception ex) { throw ex; } }