private object GetEditObject() { // TODO: 如果不使用TextBox则需修改 if (_facade == null) { _facade = new ReworkFacadeFactory(base.DataProvider).Create(); } ReworkSource reworkSource = this._facade.CreateNewReworkSource(); reworkSource.ReworkSourceCode = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtReworkSourceCodeEdit.Text, 40)); reworkSource.Description = FormatHelper.CleanString(this.txtDescriptionEdit.Text, 100); reworkSource.MaintainUser = this.GetUserCode(); return(reworkSource); }
protected void cmdSave_ServerClick(object sender, System.EventArgs e) { if (!this.ValidateInput()) { return; } if (_facade == null) { _facade = new ReworkFacadeFactory(base.DataProvider).Create(); } this._facade.UpdateReworkSource((ReworkSource)this.GetEditObject()); this.RequestData(); this.buttonHelper.PageActionStatusHandle(PageActionType.Save); }
private int GetRowCount() { if (_facade == null) { _facade = new ReworkFacadeFactory(base.DataProvider).Create(); } return(this._facade.QueryReworkApproveCount( string.Empty, FormatHelper.CleanString(this.txtReworkApproverQuery.Text), string.Empty, FormatHelper.CleanString(this.drpApproveStatusQuery.SelectedValue), string.Empty, false, true )); }
private object GetEditObject(GridRecord row) { if (_facade == null) { _facade = new ReworkFacadeFactory(base.DataProvider).Create(); } // TODO: 用主键列的Index的替换keyIndex object obj = _facade.GetReworkSource(row.Items.FindItemByKey("ReworkSourceCode").Value.ToString()); if (obj != null) { return((ReworkSource)obj); } return(null); }
protected override object GetEditObject(Infragistics.WebUI.UltraWebGrid.UltraGridRow row) { if (_facade == null) { _facade = new ReworkFacadeFactory(base.DataProvider).Create(); } // TODO: 用主键列的Index的替换keyIndex object obj = _facade.GetReworkCause(row.Cells[1].Text.ToString()); if (obj != null) { return((ReworkCause)obj); } return(null); }
protected override int GetRowCount() { if (_facade == null) { _facade = new ReworkFacadeFactory(base.DataProvider).Create(); } return(this._facade.GetUnSelectedRejectExByReworkSheetCount( FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtReworkSheetCode.Text)), FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtMOCodeQuery.Text)), FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtLotNoQuery.Text)), this.drpOPCodeQuery.SelectedValue, this.dateFrom.Text, this.timeFrom.Text, this.dateTo.Text, this.timeTo.Text)); }
private void InitViewPanel() { if (_facade == null) { _facade = new ReworkFacadeFactory(base.DataProvider).Create(); } this.txtReworkCodeQuery.Text = ReworkCode; this.txtReworkCodeQuery.ReadOnly = true; ReworkSheet rs = (ReworkSheet)this._facade.GetReworkSheet(ReworkCode); if (rs == null) { ExceptionManager.Raise(this.GetType(), "$Error_ReworkCode_Invalid"); } this.txtMOCode.Text = rs.MOCode; this.RequestData(); }
private object GetEditObject(GridRecord row) { if (_facade == null) { _facade = new ReworkFacadeFactory(base.DataProvider).Create(); } object obj = _facade.GetReworkPass(GetText(row.Items.FindItemByKey("ReworkCode").Value.ToString()), row.Items.FindItemByKey("ReworkSequence").Value.ToString()); if (obj != null) { ((ReworkPass)obj).PassUser = GetUserCode(); //((ReworkPass)obj).PassContent = FormatHelper.CleanString(this.txtApproveContentEdit.Text); return((ReworkPass)obj); } return(null); }
protected override object[] LoadDataSource(int inclusive, int exclusive) { if (_facade == null) { _facade = new ReworkFacadeFactory(base.DataProvider).Create(); } return(this._facade.GetSelectedRejectExByReworkSheet( FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtReworkSheetCode.Text)), FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtMOCodeQuery.Text)), FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtLotNoQuery.Text)), this.drpOPCodeQuery.SelectedValue, this.dateFrom.Text, this.timeFrom.Text, this.dateTo.Text, this.timeTo.Text, inclusive, exclusive)); }
private object[] LoadDataSource(int inclusive, int exclusive) { if (_facade == null) { _facade = new ReworkFacadeFactory(base.DataProvider).Create(); } SetEditObject(null); return(this._facade.QueryReworkApprove( string.Empty, FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtReworkApproverQuery.Text)), string.Empty, FormatHelper.CleanString(this.drpApproveStatusQuery.SelectedValue), string.Empty, false, true, inclusive, exclusive)); }
private object GetEditObject() { if (_facade == null) { _facade = new ReworkFacadeFactory(base.DataProvider).Create(); } ReworkPass reworkPass = this._facade.CreateNewReworkPass(); reworkPass.ReworkCode = ReworkCode; //sammer kong reworkPass.IsPass = IsPass.ISPASS_NOPASS; reworkPass.MaintainUser = this.GetUserCode(); reworkPass.PassSequence = Int32.Parse(FormatHelper.CleanString(this.txtPassSequenceEdit.Text)); //sammer kong reworkPass.Status = ApproveStatus.APPROVESTATUS_WAITING; reworkPass.UserCode = FormatHelper.CleanString(drpApproverEdit.SelectedValue); reworkPass.Sequence = this.ReworkSeq; return(reworkPass); }
protected void cmdDelete_ServerClick(object sender, System.EventArgs e) { if (_facade == null) { _facade = new ReworkFacadeFactory(base.DataProvider).Create(); } ArrayList array = this.gridHelper.GetCheckedRows(); ArrayList reworkSources = new ArrayList(array.Count); foreach (GridRecord row in array) { reworkSources.Add((ReworkSource)this.GetEditObject(row)); } this._facade.DeleteReworkSource((ReworkSource[])reworkSources.ToArray(typeof(ReworkSource))); this.RequestData(); this.buttonHelper.PageActionStatusHandle(PageActionType.Delete); }
private BenQGuru.eMES.Rework.ReworkFacade _facade; //= ReworkFacadeFactory.Create(); #region Stable protected void Page_Load(object sender, System.EventArgs e) { if (this.GetRequestParam("ReworkSheetCode") == string.Empty) { ExceptionManager.Raise(this.GetType(), "$Error_RequestUrlParameter_Lost"); } if (_facade == null) { _facade = new ReworkFacadeFactory(base.DataProvider).Create(); } ReworkSheet rs = (ReworkSheet)this._facade.GetReworkSheet(this.GetRequestParam("ReworkSheetCode")); if (rs == null) { ExceptionManager.Raise(this.GetType(), "$Error_ReworkCode_Invalid"); } if (rs.Status != ReworkStatus.REWORKSTATUS_NEW) { cmdDelete.Disabled = true; cmdAppend.Visible = false; } else { cmdDelete.Disabled = false; cmdAppend.Visible = true; } if (!this.IsPostBack) { // 初始化页面语言 this.InitPageLanguage(this.languageComponent1, false); this.txtReworkSheetCode.Text = this.GetRequestParam("ReworkSheetCode"); //this.dateFrom.Text = FormatHelper.ToDateString( FormatHelper.TODateInt( DateTime.Now )) ; //this.dateTo.Text = FormatHelper.ToDateString( FormatHelper.TODateInt( DateTime.Now )) ; this.timeFrom.Text = FormatHelper.ToTimeString(0); this.timeTo.Text = FormatHelper.ToTimeString(FormatHelper.TOTimeInt(DateTime.Now)); } }
protected override object GetEditObject(UltraGridRow row) { if (_facade == null) { _facade = new ReworkFacadeFactory(base.DataProvider).Create(); } ReworkRange reworkRange = this._facade.CreateNewReworkRange(); reworkRange.ReworkCode = this.txtReworkSheetCode.Text; reworkRange.RunningCard = GetText(row.Cells[1].Text); reworkRange.MaintainUser = this.GetUserCode(); try { reworkRange.RunningCardSequence = decimal.Parse(row.Cells[2].Text); } catch { ExceptionManager.Raise(this.GetType(), "$Error_Format"); // throw new Exception(ErrorCenter.GetErrorUserDescription( this.GetType().BaseType, string.Format(ErrorCenter.ERROR_FORMAT, "RunningCardSequence") ) ); } return(reworkRange); }
protected override int GetRowCount() { if (this.txtBoxNoQuery.Text.Trim().Length > 0) { return(0); } if (_facade == null) { _facade = new ReworkFacadeFactory(base.DataProvider).Create(); } return(this._facade.QueryRejectExCount( FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtMOCodeQuery.Text)), FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtItemCodeQuery.Text)), FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtLotNoQuery.Text)), this.drpOpCodeQuery.SelectedValue, this.dateFrom.Text, this.timeFrom.Text, this.dateTo.Text, this.timeTo.Text, this.drpRejectStatusQuery.SelectedValue )); }
protected void Page_Load(object sender, System.EventArgs e) { try { if (_facade == null) { _facade = new ReworkFacadeFactory(base.DataProvider).Create(); } object reworkSheet = this._facade.GetReworkSheet(this.GetRequestParam("reworkcode")); if (reworkSheet != null) { this.reworkStatus = ((ReworkSheet)reworkSheet).Status; } } catch { ExceptionManager.Raise(this.GetType(), "$Error_RequestUrlParameter_Lost"); } this.InitOnPostBack(); if (!IsPostBack) { // 初始化页面语言 this.InitPageLanguage(this.languageComponent1, false); this.InitButton(); this.InitWebGrid(); InitParamterts(); InitViewPanel(); if (this.GetRequestParam("hiddenEdit") != string.Empty) { HiddenEdit(); } } }
protected override object[] LoadDataSource(int inclusive, int exclusive) { if (this.txtBoxNoQuery.Text.Trim().Length > 0) { return(null); } if (_facade == null) { _facade = new ReworkFacadeFactory(base.DataProvider).Create(); } return(this._facade.QueryRejectEx( FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.drpModelQuery.SelectedValue)), FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtMOCodeQuery.Text)), FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtItemCodeQuery.Text)), FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtLotNoQuery.Text)), this.drpOpCodeQuery.SelectedValue, this.dateFrom.Text, this.timeFrom.Text, this.dateTo.Text, this.timeTo.Text, this.drpRejectStatusQuery.SelectedValue, inclusive, exclusive)); }
protected override void Grid_ClickCell(GridRecord row, string commandName) { object obj = this.GetEditObject(row); if (obj != null) { if (commandName == "ReworkPassContent") { Response.Redirect(this.MakeRedirectUrl("FReworkApproveResultMP.aspx", new string[] { "ReworkCode" }, new string[] { GetText(row.Items.FindItemByKey("ReworkCode").Text) })); } else if (commandName == "ReworkRangeMNID") { if (_facade == null) { _facade = new ReworkFacadeFactory(base.DataProvider).Create(); } object reworksheet = _facade.GetReworkSheet(GetText(row.Items.FindItemByKey("ReworkCode").Text)); if (reworksheet != null) { if (((ReworkSheet)reworksheet).ReworkType == BenQGuru.eMES.Web.Helper.ReworkType.REWORKTYPE_REMO) { ExceptionManager.Raise(this.GetType(), "$Error_Rework_NORange_For_REMO_TYPE"); } Response.Redirect(this.MakeRedirectUrl("FReworkRangeSP_New.aspx", new string[] { "ReworkSheetCode" }, new string[] { GetText(row.Items.FindItemByKey("ReworkCode").Text) })); } } else if (commandName == "Edit") { this.SetEditObject(obj); this.buttonHelper.PageActionStatusHandle(PageActionType.Update); } } }
protected void Page_Load(object sender, System.EventArgs e) { if (_facade == null) { _facade = new ReworkFacadeFactory(base.DataProvider).Create(); } ReworkSheet rs = (ReworkSheet)this._facade.GetReworkSheet(this.GetRequestParam("ReworkSheetCode")); if (rs == null) { ExceptionManager.Raise(this.GetType(), "$Error_ReworkCode_Invalid"); } if (rs.Status != ReworkStatus.REWORKSTATUS_RELEASE) { cmdSave.Visible = false; cmdCancel.Visible = false; } else { cmdSave.Visible = true; cmdCancel.Visible = true; } if (!this.IsPostBack) { // 初始化页面语言 this.InitPageLanguage(this.languageComponent1, false); this.txtReworkCode.Text = this.GetRequestParam("ReworkSheetCode"); ReworkSheet obj = (ReworkSheet)this._facade.GetReworkSheet(this.txtReworkCode.Text); this.txtItemCode.Text = obj.ItemCode; this.txtReworkStatus.Text = this.languageComponent1.GetString(obj.Status); this.txtReworkType.Text = this.languageComponent1.GetString(obj.ReworkType); } }
//取消判退 protected void cmdCancelReject_ServerClick(object sender, System.EventArgs e) { /*发件人: Joanne Zhao * 发送时间: 2005年9月21日 12:03 * 收件人: Simone Xu; David Liu; Eric Zhao * 抄送: Helen Wang * 主题: 答复: 判退采集 * * Dear All, * * 判退采集目前夏新不会用到,可以将其隐掉。 * 判退只是针对批进行处理,相对会简单很多。 * * 业务描述: * * 批判退与批允收:以批为单位进行 * * 取消判退:以“批”为单位进行取消判退,判退后的批里边的序列号可以进行继续抽检 * * * * 系统实现: * * 批判退与批允收:FQC采集目前是以批为单位进行批确认 * * 取消判退:以个体带群体,选择要“取消判退”的序列号,系统提示将对序列号所属的“批”里的所有样本进行“取消判退”作业。 * * * * 目前批的状态包含:初始、未检、在检、通过、判退5种状态 * * 取消判退后的产品状态希望回退到“在检状态”,然后继承之前“判退”采集前的纪录继续做采集。 * * * * 现在程序上是否可以实现该功能,尚需Simone进行确认。 * * 有问题可随时MSN联系:[email protected] * * 最近很少看邮件 :-) * * Joanne * */ // modified by jessie lee,2005/9/28,实现取消批判退的功能 ArrayList arrayList = this.gridHelper.GetCheckedRows(); if (arrayList.Count > 0) { if (_facade == null) { _facade = new ReworkFacadeFactory(base.DataProvider).Create(); } //检查这些批号是否可以取消判退 ArrayList nolotReject = new ArrayList(); //没有批的判退信息集合 ArrayList lotNOs = new ArrayList(); for (int i = 0; i < arrayList.Count; i++) { UltraGridRow row = (UltraGridRow)arrayList[i]; Reject reject = (Reject)this.GetEditObject(row); if (reject.LOTNO.Trim() != null && reject.LOTNO.Trim() != string.Empty) { lotNOs.Add(reject.LOTNO); } else { //如果没有批号,对个体进行操作。 nolotReject.Add(reject); } } //对没有批的判退信息集合的取消判退操作 if (nolotReject.Count > 0) { _facade.CancelReject(nolotReject); } ArrayList lotsList = new ArrayList(); for (int i = 0; i < lotNOs.Count; i++) { bool isRepeat = false; for (int j = 0; j < lotsList.Count; j++) { if (string.Compare((string)lotNOs[i], lotsList[j].ToString(), true) == 0) { isRepeat = true; break; } } if (!isRepeat && (string)lotNOs[i] != string.Empty) { lotsList.Add(lotNOs[i]); } } if (!_facade.CheckLotToCancelReject(lotsList)) { ExceptionManager.Raise(this.GetType(), "$Error_LOTs_Cannot_CancelReject"); return; } /*added by jessie lee, 2005/11/30, * 操作时间过长时添加进度条*/ this.Page.Response.Write("<div id='mydiv' >"); this.Page.Response.Write("_"); this.Page.Response.Write("</div>"); this.Page.Response.Write("<script>mydiv.innerText = '';</script>"); this.Page.Response.Write("<script language=javascript>;"); this.Page.Response.Write("var dots = 0;var dotmax = 10;function ShowWait()"); this.Page.Response.Write("{var output; output = '正在处理,请稍后';dots++;if(dots>=dotmax)dots=1;"); this.Page.Response.Write("for(var x = 0;x < dots;x++){output += '·';}mydiv.innerText = output;}"); this.Page.Response.Write("function StartShowWait(){mydiv.style.visibility = 'visible'; "); this.Page.Response.Write("window.setInterval('ShowWait()',1000);}"); this.Page.Response.Write("function HideWait(){mydiv.style.display = 'none';"); this.Page.Response.Write("window.clearInterval();}"); this.Page.Response.Write("StartShowWait();</script>"); this.Page.Response.Flush(); if (lotsList != null && lotsList.Count > 0) { _facade.MakeLotsCancelReject(lotsList); } this.Page.Response.Write("<script language=javascript>HideWait();</script>"); /* added by jessie lee, 2005/11/30, * 取消判退完成以后,把结束时间改为当前 */ this.dateTo.Text = FormatHelper.ToDateString(FormatHelper.TODateInt(DateTime.Now)); this.timeTo.Text = FormatHelper.ToTimeString(FormatHelper.TOTimeInt(DateTime.Now)); this.gridHelper.RequestData(); this.buttonHelper.PageActionStatusHandle(PageActionType.Delete); } }
private void initUI() { if (_facade == null) { _facade = new ReworkFacadeFactory(base.DataProvider).Create(); } //根据返工类型,处理界面,不需要清空数据 DoReworkTypeChange(false); //根据工单,处理界面,不需要清空数据 DoMOCodeChange(false); string code = this.GetRequestParam("ReworkSheetCode"); if (code != string.Empty) //传参,即为编辑 { Session["ReworkSheetCode"] = code; //供弹出页面使用 //取得sheet的基本信息 ReworkSheet rs = (ReworkSheet)(this._facade.GetReworkSheet(code)); //状态为“新”,除了代码为都可以编辑 if (rs.Status == BenQGuru.eMES.Web.Helper.ReworkStatus.REWORKSTATUS_NEW) { this.txtReworkSheetCode.ReadOnly = true; } else { this.txtDate.Enabled = false; this.txtUser.Enabled = false; this.txtDepartment.Enabled = false; this.txtItemQuery.Readonly = true; this.txtMOQuery.Readonly = true; this.txtReworkHC.Enabled = false; this.txtReworkQty.Enabled = false; this.txtReworkSheetCode.Enabled = false; //this.drpMOCode.Enabled = false ; this.drpReworkSource.Enabled = false; this.drpReworkType.Enabled = false; //this.txtOQCLotQuery.Readonly = true; this.chkNeedConfirmFlow.Enabled = false; this.cmdSave.Disabled = true; this.txtDutyCodeQuery.Readonly = true; // Added by Icyer 2006/07/12 this.txtReworkReason.Enabled = false; this.txtReasonAnalyse.Enabled = false; this.txtSolution.Enabled = false; if (rs.Status == BenQGuru.eMES.Web.Helper.ReworkStatus.REWORKSTATUS_NEW || rs.Status == BenQGuru.eMES.Web.Helper.ReworkStatus.REWORKSTATUS_WAITING || rs.Status == BenQGuru.eMES.Web.Helper.ReworkStatus.REWORKSTATUS_RELEASE || rs.Status == BenQGuru.eMES.Web.Helper.ReworkStatus.REWORKSTATUS_OPEN) { this.txtReworkReason.Enabled = true; this.txtReasonAnalyse.Enabled = true; this.txtSolution.Enabled = true; this.cmdSave.Disabled = false; this.txtDutyCodeQuery.Readonly = false; } // Added end } } else { Session["ReworkSheetCode"] = ""; } }
protected void cmdSave_ServerClick(object sender, System.EventArgs e) { if (!this.ValidateInput()) { return; } if (_facade == null) { _facade = new ReworkFacadeFactory(base.DataProvider).Create(); } string code = this.GetRequestParam("ReworkSheetCode"); ReworkSheet rs; if (code == string.Empty) { // 新增操作 rs = (ReworkSheet)(this._facade.CreateNewReworkSheet()); } else { rs = (ReworkSheet)(this._facade.GetReworkSheet(code)); } rs.ReworkCode = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtReworkSheetCode.Text)); rs.Department = FormatHelper.CleanString(this.txtDepartment.Text); rs.MOCode = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtMOQuery.Text)); //rs.MOCode = FormatHelper.PKCapitalFormat( FormatHelper.CleanString( this.drpMOCode.SelectedValue )); rs.ItemCode = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtItemQuery.Text)); rs.ReworkHC = System.Decimal.Parse(FormatHelper.CleanString(this.txtReworkHC.Text)); rs.ReworkSourceCode = FormatHelper.CleanString(this.drpReworkSource.SelectedValue); rs.ReworkType = FormatHelper.CleanString(this.drpReworkType.SelectedValue); rs.ReworkQty = System.Decimal.Parse(FormatHelper.CleanString(this.txtReworkQty.Text)); // Added by Icyer 2006/07/12 rs.ReworkReason = this.txtReworkReason.Text; rs.ReasonAnalyse = this.txtReasonAnalyse.Text; rs.Soluation = this.txtSolution.Text; // Added end rs.DutyCode = this.txtDutyCodeQuery.Text.Trim().ToUpper(); rs.MaintainUser = this.GetUserCode(); rs.LotList = this.txtOQCLotQuery.Text.Trim(); rs.NeedCheck = this.chkNeedConfirmFlow.Checked ? "Y" : "N"; if (code == string.Empty) { // 新增操作 if (rs.NeedCheck == "Y") { rs.Status = BenQGuru.eMES.Web.Helper.ReworkStatus.REWORKSTATUS_NEW; } else { rs.Status = BenQGuru.eMES.Web.Helper.ReworkStatus.REWORKSTATUS_RELEASE; } rs.CreateDate = FormatHelper.TODateInt(DateTime.Now); rs.CreateTime = FormatHelper.TOTimeInt(DateTime.Now); rs.CreateUser = this.GetUserCode(); this._facade.AddReworkSheet(rs); } else { this._facade.UpdateReworkSheet(rs); } this.Response.Redirect(this.MakeRedirectUrl("./FReworkSheetMP.aspx")); }