public IList <MDAllowanceCategoryEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression) { IList <MDAllowanceCategoryEntity> mDAllowanceCategoryEntityList = new List <MDAllowanceCategoryEntity>(); try { if (pageSize == -1) { pageSize = 1000000000; } if (String.IsNullOrEmpty(sortExpression)) { sortExpression = MDAllowanceCategoryEntity.FLD_NAME_AllowanceCategoryID + " " + SQLConstants.SORT_ORDER_DESCENDING; } startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1; mDAllowanceCategoryEntityList = FCCMDAllowanceCategory.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression); if (mDAllowanceCategoryEntityList != null && mDAllowanceCategoryEntityList.Count > 0) { totalRowCount = mDAllowanceCategoryEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(mDAllowanceCategoryEntityList ?? new List <MDAllowanceCategoryEntity>()); }
private void SaveMDAllowanceCategoryEntity() { if (IsValid) { try { MDAllowanceCategoryEntity mDAllowanceCategoryEntity = BuildMDAllowanceCategoryEntity(); Int64 result = -1; if (mDAllowanceCategoryEntity.IsNew) { result = FCCMDAllowanceCategory.GetFacadeCreate().Add(mDAllowanceCategoryEntity, DatabaseOperationType.Add, TransactionRequired.No); } else { String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDAllowanceCategoryEntity.FLD_NAME_AllowanceCategoryID, mDAllowanceCategoryEntity.AllowanceCategoryID.ToString(), SQLMatchType.Equal); result = FCCMDAllowanceCategory.GetFacadeCreate().Update(mDAllowanceCategoryEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No); } if (result > 0) { _AllowanceCategoryID = 0; _MDAllowanceCategoryEntity = new MDAllowanceCategoryEntity(); PrepareInitialView(); BindMDAllowanceCategoryList(); if (mDAllowanceCategoryEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Allowance Category Information has been added successfully.", false); } else { MiscUtil.ShowMessage(lblMessage, "Allowance Category Information has been updated successfully.", false); } } else { if (mDAllowanceCategoryEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Failed to add Allowance Category Information.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to update Allowance Category Information.", false); } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } }
protected void lvMDAllowanceCategory_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 AllowanceCategoryID; Int64.TryParse(e.CommandArgument.ToString(), out AllowanceCategoryID); if (AllowanceCategoryID > 0) { if (string.Equals(e.CommandName, "EditItem")) { _AllowanceCategoryID = AllowanceCategoryID; PrepareEditView(); cpeEditor.Collapsed = false; cpeEditor.ClientState = "false"; } else if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(MDAllowanceCategoryEntity.FLD_NAME_AllowanceCategoryID, AllowanceCategoryID.ToString(), SQLMatchType.Equal); MDAllowanceCategoryEntity mDAllowanceCategoryEntity = new MDAllowanceCategoryEntity(); result = FCCMDAllowanceCategory.GetFacadeCreate().Delete(mDAllowanceCategoryEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _AllowanceCategoryID = 0; _MDAllowanceCategoryEntity = new MDAllowanceCategoryEntity(); PrepareInitialView(); BindMDAllowanceCategoryList(); MiscUtil.ShowMessage(lblMessage, "Allowance Category has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete Allowance Category.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
public IList <MDAllowanceCategoryEntity> GetData() { IList <MDAllowanceCategoryEntity> mDAllowanceCategoryEntityList = new List <MDAllowanceCategoryEntity>(); try { mDAllowanceCategoryEntityList = FCCMDAllowanceCategory.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load); if (mDAllowanceCategoryEntityList != null && mDAllowanceCategoryEntityList.Count > 0) { totalRowCount = mDAllowanceCategoryEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(mDAllowanceCategoryEntityList ?? new List <MDAllowanceCategoryEntity>()); }