protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.RegisterPostBackButton(this.btnSave); if (!IsPostBack) { PopUpPage masterPage = this.Master as PopUpPage; masterPage.SetTitleText(Resources.LabelResource.TITLE_034); //this.Title = Resources.LabelResource.TITLE_034; if (this.ActionMode.Equals(PMSWebConstant.ACTION_MODE_EDIT)) { this.SkLineRespGridItemObject.ClearAll(); this.SkLineRespGridItemObject.Pager.PageSize = Int32.MaxValue; this.SkLineRespGridItemObject.Pager.CurrentPage = 1; this.SkLineRespGridItemObject.Pager.SetSortExpression(this.ExGridSkLineResp.DefaultSortField); } PMSGridViewAdapter.Create(this.ExGridSkLineResp).InitialBindGrid(this.SkLineRespGridItemObject.ItemSkLineResp); // gridFooter.setFooter(SkLineRespGridItemObject.Pager, true); this.DataBinder.IsDirty = false; } SetDeleteState(); } }
protected override void OnSave() { this.lblBusinessErrorSummary.Text = null; if (Page.IsValid) { try { this.SkLineObject = this.DataBinder.BusinessObject as SkLineObject; this.SkLineObject.LastUpdBy = this.LoginUserObject.UserId; ArrayList skLineRespList = null; try { skLineRespList = PMSGridViewAdapter.Create(this.ExGridSkLineResp).GetBusinessObjects(LoginUserObject) as ArrayList; } catch (Exception) { skLineRespList = null; } if (this.ActionMode.Equals(PMSWebConstant.ACTION_MODE_ADD)) { this.SkLineObject.CreatedBy = this.LoginUserObject.UserId; this.SkLineObject.LastUpdBy = this.LoginUserObject.UserId; this.SkLineObject.Status = PMSConstant.GridObjectStatusInsert; SkLineService.Create().CreateSkLine(this.SkLineObject, skLineRespList); } else if (this.ActionMode.Equals(PMSWebConstant.ACTION_MODE_EDIT)) { this.SkLineObject.Status = PMSConstant.GridObjectStatusUpdate; this.SkLineObject.LastUpdBy = this.LoginUserObject.UserId; SkLineService.Create().UpdateSkLine(this.SkLineObject, skLineRespList); } this.DisablePageLock(); this.IsUpdated = true; this.DataBinder.IsDirty = false; this.ScriptHelper.RegisterAlertPopupWithClose(Resources.MessageResource.MSG002); } catch (PMSException PMSex) { ErrorMessage.ShowErrMessage(this.lblBusinessErrorSummary, PMSex); } catch (System.Exception ex) { logger.Error("", ex); ErrorMessage.ShowErrMessage(this.lblBusinessErrorSummary, ex.Message); } } base.OnSave(); }
protected override void OnRefresh() { this.SkLineRespGridItemObject = SkLineRespService.Create().RetrieveSkLineRespGridList(this.SkLineRespGridItemObject); PMSGridViewAdapter.Create(this.ExGridSkLineResp).InitialBindGrid(this.SkLineRespGridItemObject.ItemSkLineResp); if (this.ActionMode.Equals(PMSWebConstant.ACTION_MODE_ADD)) { this.SkLineObject = new SkLineObject(); this.SkLineObject.LastUpdBy = this.LoginUserObject.UserId; this.SkLineObject.CreatedBy = this.LoginUserObject.UserId; this.DataBinder.BinderMode = ExBinderMode.Add; } else if (this.ActionMode.Equals(PMSWebConstant.ACTION_MODE_EDIT)) { this.SkLineObject.LastUpdBy = this.LoginUserObject.UserId; this.DataBinder.BinderMode = ExBinderMode.Edit; } this.DataBinder.InitialDataSource(this.SkLineObject); this.DataBinder.Populate(); base.OnRefresh(); }
protected override void OnAdd() { PMSGridViewAdapter.Create(this.ExGridSkLineResp).AddNewRow(new SkLineRespObject(this.LoginUserObject.UserId) { NatureCode = this.NatureCode }); base.OnAdd(); }