public IList <MDEmployeeSalaryPaymentStatusEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression) { IList <MDEmployeeSalaryPaymentStatusEntity> mDEmployeeSalaryPaymentStatusEntityList = new List <MDEmployeeSalaryPaymentStatusEntity>(); try { if (pageSize == -1) { pageSize = 1000000000; } if (String.IsNullOrEmpty(sortExpression)) { sortExpression = MDEmployeeSalaryPaymentStatusEntity.FLD_NAME_EmployeeSalaryPaymentStatusID + " " + SQLConstants.SORT_ORDER_DESCENDING; } startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1; mDEmployeeSalaryPaymentStatusEntityList = FCCMDEmployeeSalaryPaymentStatus.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression); if (mDEmployeeSalaryPaymentStatusEntityList != null && mDEmployeeSalaryPaymentStatusEntityList.Count > 0) { totalRowCount = mDEmployeeSalaryPaymentStatusEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(mDEmployeeSalaryPaymentStatusEntityList ?? new List <MDEmployeeSalaryPaymentStatusEntity>()); }
private void SaveMDEmployeeSalaryPaymentStatusEntity() { if (IsValid) { try { MDEmployeeSalaryPaymentStatusEntity mDEmployeeSalaryPaymentStatusEntity = BuildMDEmployeeSalaryPaymentStatusEntity(); Int64 result = -1; if (mDEmployeeSalaryPaymentStatusEntity.IsNew) { result = FCCMDEmployeeSalaryPaymentStatus.GetFacadeCreate().Add(mDEmployeeSalaryPaymentStatusEntity, DatabaseOperationType.Add, TransactionRequired.No); } else { String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDEmployeeSalaryPaymentStatusEntity.FLD_NAME_EmployeeSalaryPaymentStatusID, mDEmployeeSalaryPaymentStatusEntity.EmployeeSalaryPaymentStatusID.ToString(), SQLMatchType.Equal); result = FCCMDEmployeeSalaryPaymentStatus.GetFacadeCreate().Update(mDEmployeeSalaryPaymentStatusEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No); } if (result > 0) { _EmployeeSalaryPaymentStatusID = 0; _MDEmployeeSalaryPaymentStatusEntity = new MDEmployeeSalaryPaymentStatusEntity(); PrepareInitialView(); BindMDEmployeeSalaryPaymentStatusList(); if (mDEmployeeSalaryPaymentStatusEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Employee Salary Payment Status Information has been added successfully.", false); } else { MiscUtil.ShowMessage(lblMessage, "Employee Salary Payment Status Information has been updated successfully.", false); } } else { if (mDEmployeeSalaryPaymentStatusEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Failed to add Employee Salary Payment Status Information.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to update Employee Salary Payment Status Information.", false); } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } }
protected void lvMDEmployeeSalaryPaymentStatus_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 EmployeeSalaryPaymentStatusID; Int64.TryParse(e.CommandArgument.ToString(), out EmployeeSalaryPaymentStatusID); if (EmployeeSalaryPaymentStatusID > 0) { if (string.Equals(e.CommandName, "EditItem")) { _EmployeeSalaryPaymentStatusID = EmployeeSalaryPaymentStatusID; PrepareEditView(); cpeEditor.Collapsed = false; cpeEditor.ClientState = "false"; } else if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(MDEmployeeSalaryPaymentStatusEntity.FLD_NAME_EmployeeSalaryPaymentStatusID, EmployeeSalaryPaymentStatusID.ToString(), SQLMatchType.Equal); MDEmployeeSalaryPaymentStatusEntity mDEmployeeSalaryPaymentStatusEntity = new MDEmployeeSalaryPaymentStatusEntity(); result = FCCMDEmployeeSalaryPaymentStatus.GetFacadeCreate().Delete(mDEmployeeSalaryPaymentStatusEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _EmployeeSalaryPaymentStatusID = 0; _MDEmployeeSalaryPaymentStatusEntity = new MDEmployeeSalaryPaymentStatusEntity(); PrepareInitialView(); BindMDEmployeeSalaryPaymentStatusList(); MiscUtil.ShowMessage(lblMessage, "Employee Salary Payment Status has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete Employee Salary Payment Status.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
public IList <MDEmployeeSalaryPaymentStatusEntity> GetData() { IList <MDEmployeeSalaryPaymentStatusEntity> mDEmployeeSalaryPaymentStatusEntityList = new List <MDEmployeeSalaryPaymentStatusEntity>(); try { mDEmployeeSalaryPaymentStatusEntityList = FCCMDEmployeeSalaryPaymentStatus.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load); if (mDEmployeeSalaryPaymentStatusEntityList != null && mDEmployeeSalaryPaymentStatusEntityList.Count > 0) { totalRowCount = mDEmployeeSalaryPaymentStatusEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(mDEmployeeSalaryPaymentStatusEntityList ?? new List <MDEmployeeSalaryPaymentStatusEntity>()); }