public IList <MDApprovalProcessTypeEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression) { IList <MDApprovalProcessTypeEntity> mDApprovalProcessTypeEntityList = new List <MDApprovalProcessTypeEntity>(); try { if (pageSize == -1) { pageSize = 1000000000; } if (String.IsNullOrEmpty(sortExpression)) { sortExpression = MDApprovalProcessTypeEntity.FLD_NAME_ApprovalProcessTypeID + " " + SQLConstants.SORT_ORDER_DESCENDING; } startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1; mDApprovalProcessTypeEntityList = FCCMDApprovalProcessType.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression); if (mDApprovalProcessTypeEntityList != null && mDApprovalProcessTypeEntityList.Count > 0) { totalRowCount = mDApprovalProcessTypeEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(mDApprovalProcessTypeEntityList ?? new List <MDApprovalProcessTypeEntity>()); }
private void SaveMDApprovalProcessTypeEntity() { if (IsValid) { try { MDApprovalProcessTypeEntity mDApprovalProcessTypeEntity = BuildMDApprovalProcessTypeEntity(); Int64 result = -1; if (mDApprovalProcessTypeEntity.IsNew) { result = FCCMDApprovalProcessType.GetFacadeCreate().Add(mDApprovalProcessTypeEntity, DatabaseOperationType.Add, TransactionRequired.No); } else { String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDApprovalProcessTypeEntity.FLD_NAME_ApprovalProcessTypeID, mDApprovalProcessTypeEntity.ApprovalProcessTypeID.ToString(), SQLMatchType.Equal); result = FCCMDApprovalProcessType.GetFacadeCreate().Update(mDApprovalProcessTypeEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No); } if (result > 0) { _ApprovalProcessTypeID = 0; _MDApprovalProcessTypeEntity = new MDApprovalProcessTypeEntity(); PrepareInitialView(); BindMDApprovalProcessTypeList(); if (mDApprovalProcessTypeEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Approval Process Type Information has been added successfully.", false); } else { MiscUtil.ShowMessage(lblMessage, "Approval Process Type Information has been updated successfully.", false); } } else { if (mDApprovalProcessTypeEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Failed to add Approval Process Type Information.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to update Approval Process Type Information.", false); } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } }
protected void lvMDApprovalProcessType_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 ApprovalProcessTypeID; Int64.TryParse(e.CommandArgument.ToString(), out ApprovalProcessTypeID); if (ApprovalProcessTypeID > 0) { if (string.Equals(e.CommandName, "EditItem")) { _ApprovalProcessTypeID = ApprovalProcessTypeID; PrepareEditView(); cpeEditor.Collapsed = false; cpeEditor.ClientState = "false"; } else if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(MDApprovalProcessTypeEntity.FLD_NAME_ApprovalProcessTypeID, ApprovalProcessTypeID.ToString(), SQLMatchType.Equal); MDApprovalProcessTypeEntity mDApprovalProcessTypeEntity = new MDApprovalProcessTypeEntity(); result = FCCMDApprovalProcessType.GetFacadeCreate().Delete(mDApprovalProcessTypeEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _ApprovalProcessTypeID = 0; _MDApprovalProcessTypeEntity = new MDApprovalProcessTypeEntity(); PrepareInitialView(); BindMDApprovalProcessTypeList(); MiscUtil.ShowMessage(lblMessage, "Approval Process Type has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete Approval Process Type.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
public IList <MDApprovalProcessTypeEntity> GetData() { IList <MDApprovalProcessTypeEntity> mDApprovalProcessTypeEntityList = new List <MDApprovalProcessTypeEntity>(); try { mDApprovalProcessTypeEntityList = FCCMDApprovalProcessType.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load); if (mDApprovalProcessTypeEntityList != null && mDApprovalProcessTypeEntityList.Count > 0) { totalRowCount = mDApprovalProcessTypeEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(mDApprovalProcessTypeEntityList ?? new List <MDApprovalProcessTypeEntity>()); }