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