protected override object GetEditObject(GridRecord row) { if (_facade == null) { _facade = new ReworkFacadeFactory(base.DataProvider).Create(); } // TODO: 用主键列的Index的替换keyIndex object obj = _facade.GetReworkSheet(row.Items.FindItemByKey("ReworkSheetCode").Value.ToString()); if (obj != null) { return((ReworkSheet)obj); } return(null); }
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); } } }