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