public IList <APApprovalProcessEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression) { IList <APApprovalProcessEntity> aPApprovalProcessEntityList = new List <APApprovalProcessEntity>(); try { if (pageSize == -1) { pageSize = 1000000000; } if (String.IsNullOrEmpty(sortExpression)) { sortExpression = APApprovalProcessEntity.FLD_NAME_APApprovalProcessID + " " + SQLConstants.SORT_ORDER_DESCENDING; } startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1; aPApprovalProcessEntityList = FCCAPApprovalProcess.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression); if (aPApprovalProcessEntityList != null && aPApprovalProcessEntityList.Count > 0) { totalRowCount = aPApprovalProcessEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(aPApprovalProcessEntityList ?? new List <APApprovalProcessEntity>()); }
private void SaveAPApprovalProcessEntity() { if (IsValid) { try { APApprovalProcessEntity aPApprovalProcessEntity = BuildAPApprovalProcessEntity(); Int64 result = -1; if (aPApprovalProcessEntity.IsNew) { result = FCCAPApprovalProcess.GetFacadeCreate().Add(aPApprovalProcessEntity, DatabaseOperationType.Add, TransactionRequired.No); } else { String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(APApprovalProcessEntity.FLD_NAME_APApprovalProcessID, aPApprovalProcessEntity.APApprovalProcessID.ToString(), SQLMatchType.Equal); result = FCCAPApprovalProcess.GetFacadeCreate().Update(aPApprovalProcessEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No); } if (result > 0) { _APApprovalProcessID = 0; _APApprovalProcessEntity = new APApprovalProcessEntity(); PrepareInitialView(); BindAPApprovalProcessList(); if (aPApprovalProcessEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "A PApproval Process Information has been added successfully.", false); } else { MiscUtil.ShowMessage(lblMessage, "A PApproval Process Information has been updated successfully.", false); } } else { if (aPApprovalProcessEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Failed to add A PApproval Process Information.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to update A PApproval Process Information.", false); } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } }
protected void lvAPApprovalProcess_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 APApprovalProcessID; Int64.TryParse(e.CommandArgument.ToString(), out APApprovalProcessID); if (APApprovalProcessID > 0) { if (string.Equals(e.CommandName, "EditItem")) { _APApprovalProcessID = APApprovalProcessID; PrepareEditView(); cpeEditor.Collapsed = false; cpeEditor.ClientState = "false"; } else if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(APApprovalProcessEntity.FLD_NAME_APApprovalProcessID, APApprovalProcessID.ToString(), SQLMatchType.Equal); APApprovalProcessEntity aPApprovalProcessEntity = new APApprovalProcessEntity(); result = FCCAPApprovalProcess.GetFacadeCreate().Delete(aPApprovalProcessEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _APApprovalProcessID = 0; _APApprovalProcessEntity = new APApprovalProcessEntity(); PrepareInitialView(); BindAPApprovalProcessList(); MiscUtil.ShowMessage(lblMessage, "A PApproval Process has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete A PApproval Process.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
protected void btnPnlCancelWO_Click(object sender, EventArgs e) { PRMWorkOrderEntity pRMWorkOrderEntity = FCCPRMWorkOrder.GetFacadeCreate().GetByID(PRMWorkOrderID); pRMWorkOrderEntity.WorkOrderStatusID = MasterDataConstants.WorkOrderStatus.CANCELED; pRMWorkOrderEntity.Remarks = txtWOCancelRemarks.Text.Trim().ToString(); Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(PRMWorkOrderEntity.FLD_NAME_WorkOrderID, PRMWorkOrderID.ToString(), SQLMatchType.Equal); result = FCCPRMWorkOrder.GetFacadeCreate().Update(pRMWorkOrderEntity, fe, DatabaseOperationType.Update, TransactionRequired.No); if (result > 0) { #region AP Update APApprovalProcessEntity aPApprovalProcessEntity = FCCAPApprovalProcess.GetFacadeCreate().GetByID(APApprovalProcessID); if (aPApprovalProcessEntity != null && aPApprovalProcessEntity.APApprovalProcessID > 0) { aPApprovalProcessEntity.APStatusID = MasterDataConstants.APStatus.CANCELED; Int64 resultOne = -1; String fe_one = SqlExpressionBuilder.PrepareFilterExpression(APApprovalProcessEntity.FLD_NAME_APApprovalProcessID, APApprovalProcessID.ToString(), SQLMatchType.Equal); resultOne = FCCAPApprovalProcess.GetFacadeCreate().Update(aPApprovalProcessEntity, fe_one, DatabaseOperationType.Update, TransactionRequired.No); if (resultOne > 0) { APMemberFeedbackEntity aPMemberFeedbackEntity = FCCAPMemberFeedback.GetFacadeCreate().GetByID(APMemberFeedbackID); if (aPMemberFeedbackEntity != null && aPMemberFeedbackEntity.APMemberFeedbackID > 0) { aPMemberFeedbackEntity.APFeedbackID = MasterDataConstants.APFeedback.CANCELED; Int64 resultC = -1; String fe_memberfeedback = SqlExpressionBuilder.PrepareFilterExpression(APMemberFeedbackEntity.FLD_NAME_APMemberFeedbackID, APMemberFeedbackID.ToString(), SQLMatchType.Equal); resultC = FCCAPMemberFeedback.GetFacadeCreate().Update(aPMemberFeedbackEntity, fe_memberfeedback, DatabaseOperationType.Update, TransactionRequired.No); RedirectPageToPendingList(); } } } #endregion } }
public IList <APApprovalProcessEntity> GetData() { IList <APApprovalProcessEntity> aPApprovalProcessEntityList = new List <APApprovalProcessEntity>(); try { aPApprovalProcessEntityList = FCCAPApprovalProcess.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load); if (aPApprovalProcessEntityList != null && aPApprovalProcessEntityList.Count > 0) { totalRowCount = aPApprovalProcessEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(aPApprovalProcessEntityList ?? new List <APApprovalProcessEntity>()); }