public IList <MDEmployeeLoanApprovalStatusEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression) { IList <MDEmployeeLoanApprovalStatusEntity> mDEmployeeLoanApprovalStatusEntityList = new List <MDEmployeeLoanApprovalStatusEntity>(); try { if (pageSize == -1) { pageSize = 1000000000; } if (String.IsNullOrEmpty(sortExpression)) { sortExpression = MDEmployeeLoanApprovalStatusEntity.FLD_NAME_EmployeeLoanApprovalStatusID + " " + SQLConstants.SORT_ORDER_DESCENDING; } startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1; mDEmployeeLoanApprovalStatusEntityList = FCCMDEmployeeLoanApprovalStatus.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression); if (mDEmployeeLoanApprovalStatusEntityList != null && mDEmployeeLoanApprovalStatusEntityList.Count > 0) { totalRowCount = mDEmployeeLoanApprovalStatusEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(mDEmployeeLoanApprovalStatusEntityList ?? new List <MDEmployeeLoanApprovalStatusEntity>()); }
private void SaveMDEmployeeLoanApprovalStatusEntity() { if (IsValid) { try { MDEmployeeLoanApprovalStatusEntity mDEmployeeLoanApprovalStatusEntity = BuildMDEmployeeLoanApprovalStatusEntity(); Int64 result = -1; if (mDEmployeeLoanApprovalStatusEntity.IsNew) { result = FCCMDEmployeeLoanApprovalStatus.GetFacadeCreate().Add(mDEmployeeLoanApprovalStatusEntity, DatabaseOperationType.Add, TransactionRequired.No); } else { String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDEmployeeLoanApprovalStatusEntity.FLD_NAME_EmployeeLoanApprovalStatusID, mDEmployeeLoanApprovalStatusEntity.EmployeeLoanApprovalStatusID.ToString(), SQLMatchType.Equal); result = FCCMDEmployeeLoanApprovalStatus.GetFacadeCreate().Update(mDEmployeeLoanApprovalStatusEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No); } if (result > 0) { _EmployeeLoanApprovalStatusID = 0; _MDEmployeeLoanApprovalStatusEntity = new MDEmployeeLoanApprovalStatusEntity(); PrepareInitialView(); BindMDEmployeeLoanApprovalStatusList(); if (mDEmployeeLoanApprovalStatusEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Employee Loan Approval Status Information has been added successfully.", false); } else { MiscUtil.ShowMessage(lblMessage, "Employee Loan Approval Status Information has been updated successfully.", false); } } else { if (mDEmployeeLoanApprovalStatusEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Failed to add Employee Loan Approval Status Information.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to update Employee Loan Approval Status Information.", false); } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } }
protected void lvMDEmployeeLoanApprovalStatus_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 EmployeeLoanApprovalStatusID; Int64.TryParse(e.CommandArgument.ToString(), out EmployeeLoanApprovalStatusID); if (EmployeeLoanApprovalStatusID > 0) { if (string.Equals(e.CommandName, "EditItem")) { _EmployeeLoanApprovalStatusID = EmployeeLoanApprovalStatusID; PrepareEditView(); cpeEditor.Collapsed = false; cpeEditor.ClientState = "false"; } else if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(MDEmployeeLoanApprovalStatusEntity.FLD_NAME_EmployeeLoanApprovalStatusID, EmployeeLoanApprovalStatusID.ToString(), SQLMatchType.Equal); MDEmployeeLoanApprovalStatusEntity mDEmployeeLoanApprovalStatusEntity = new MDEmployeeLoanApprovalStatusEntity(); result = FCCMDEmployeeLoanApprovalStatus.GetFacadeCreate().Delete(mDEmployeeLoanApprovalStatusEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _EmployeeLoanApprovalStatusID = 0; _MDEmployeeLoanApprovalStatusEntity = new MDEmployeeLoanApprovalStatusEntity(); PrepareInitialView(); BindMDEmployeeLoanApprovalStatusList(); MiscUtil.ShowMessage(lblMessage, "Employee Loan Approval Status has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete Employee Loan Approval Status.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
public IList <MDEmployeeLoanApprovalStatusEntity> GetData() { IList <MDEmployeeLoanApprovalStatusEntity> mDEmployeeLoanApprovalStatusEntityList = new List <MDEmployeeLoanApprovalStatusEntity>(); try { mDEmployeeLoanApprovalStatusEntityList = FCCMDEmployeeLoanApprovalStatus.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load); if (mDEmployeeLoanApprovalStatusEntityList != null && mDEmployeeLoanApprovalStatusEntityList.Count > 0) { totalRowCount = mDEmployeeLoanApprovalStatusEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(mDEmployeeLoanApprovalStatusEntityList ?? new List <MDEmployeeLoanApprovalStatusEntity>()); }