<lpsfsu:CommandBar ID="fsucCommandBarItemCostAdjustment" runat="server" DefaultPanel="pnlZoneMaintenanceItemCostAdjustmentControls" DisplayButtons="Save,Submit,Cancel" AutoPostbackButtons="Save,Submit,Cancel" ValidationGroup="grpVldZoneMaintenance" CauseValidationOnCancel="false" ButtonPosition="Right" DefaultPanelButton="Save" OnSaveClick="btnSave_Click" OnCancelClick="btnCancel_Click" önSubmitClick="btnSubmit_Click" />
protected void btnSave_Click(object sender, EventArgs e) { // This is save in Draft mode. try { if (_currentTabMode.Equals(ZoneMaintenanceFormMode.Approval)) { if (ValidateComments()) { // Record to be Approved CurrentViewContext.ViewContract.ZoneStatus = ZoneMaintenanceStatus.Approved; // Set Approved in Queue String errorCode = Presenter.SaveZoneToQueue(); // Set Approved in DB Only in case of define zone. Presenter.SaveItemZoneCosts(); grdItemCostAdjustment.Rebind(); ProcessErrorCode(errorCode); _currentTabMode = ZoneMaintenanceFormMode.ReadOnly; ShowCommentHistory(CurrentViewContext.ViewContract.TransactionId); //After Approve move to the parent page RedirectToOriginatedPage(); } } else { Int32 zoneId = _viewContract.IsNull() ? SysXConsts.MINUS_ONE : _viewContract.ZoneId; // Validate controls if (ValidateControls()) { // Create/Update Define Zone Context in Queue CurrentViewContext.ViewContract.ZoneStatus = ZoneMaintenanceStatus.Draft; // Display appropriate message based on error code ProcessErrorCode(Presenter.SaveZoneToQueue()); //Save value in DB in with IsApproved = 0 Presenter.SaveItemCosts(); ShowCommentHistory(CurrentViewContext.ViewContract.TransactionId); //set ids in viewstate ViewState[SysXZoneMaintenanceConst.ZONEMAINTENANCE_ITEM_COST_TRANSACTIONID] = CurrentViewContext.ViewContract.TransactionId; } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)