public IList <ACMDBankAccountTypeEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression) { IList <ACMDBankAccountTypeEntity> aCMDBankAccountTypeEntityList = new List <ACMDBankAccountTypeEntity>(); try { if (pageSize == -1) { pageSize = 1000000000; } if (String.IsNullOrEmpty(sortExpression)) { sortExpression = ACMDBankAccountTypeEntity.FLD_NAME_BankAccountTypeID + " " + SQLConstants.SORT_ORDER_DESCENDING; } startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1; aCMDBankAccountTypeEntityList = FCCACMDBankAccountType.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression); if (aCMDBankAccountTypeEntityList != null && aCMDBankAccountTypeEntityList.Count > 0) { totalRowCount = aCMDBankAccountTypeEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(aCMDBankAccountTypeEntityList ?? new List <ACMDBankAccountTypeEntity>()); }
private void SaveACMDBankAccountTypeEntity() { if (IsValid) { try { ACMDBankAccountTypeEntity aCMDBankAccountTypeEntity = BuildACMDBankAccountTypeEntity(); Int64 result = -1; if (aCMDBankAccountTypeEntity.IsNew) { result = FCCACMDBankAccountType.GetFacadeCreate().Add(aCMDBankAccountTypeEntity, DatabaseOperationType.Add, TransactionRequired.No); } else { String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(ACMDBankAccountTypeEntity.FLD_NAME_BankAccountTypeID, aCMDBankAccountTypeEntity.BankAccountTypeID.ToString(), SQLMatchType.Equal); result = FCCACMDBankAccountType.GetFacadeCreate().Update(aCMDBankAccountTypeEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No); } if (result > 0) { _BankAccountTypeID = 0; _ACMDBankAccountTypeEntity = new ACMDBankAccountTypeEntity(); PrepareInitialView(); BindACMDBankAccountTypeList(); if (aCMDBankAccountTypeEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "A CBank Account Type Information has been added successfully.", false); } else { MiscUtil.ShowMessage(lblMessage, "A CBank Account Type Information has been updated successfully.", false); } } else { if (aCMDBankAccountTypeEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Failed to add A CBank Account Type Information.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to update A CBank Account Type Information.", false); } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } }
protected void lvACMDBankAccountType_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 BankAccountTypeID; Int64.TryParse(e.CommandArgument.ToString(), out BankAccountTypeID); if (BankAccountTypeID > 0) { if (string.Equals(e.CommandName, "EditItem")) { _BankAccountTypeID = BankAccountTypeID; PrepareEditView(); cpeEditor.Collapsed = false; cpeEditor.ClientState = "false"; } else if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(ACMDBankAccountTypeEntity.FLD_NAME_BankAccountTypeID, BankAccountTypeID.ToString(), SQLMatchType.Equal); ACMDBankAccountTypeEntity aCMDBankAccountTypeEntity = new ACMDBankAccountTypeEntity(); result = FCCACMDBankAccountType.GetFacadeCreate().Delete(aCMDBankAccountTypeEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _BankAccountTypeID = 0; _ACMDBankAccountTypeEntity = new ACMDBankAccountTypeEntity(); PrepareInitialView(); BindACMDBankAccountTypeList(); MiscUtil.ShowMessage(lblMessage, "A CBank Account Type has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete A CBank Account Type.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
public IList <ACMDBankAccountTypeEntity> GetData() { IList <ACMDBankAccountTypeEntity> aCMDBankAccountTypeEntityList = new List <ACMDBankAccountTypeEntity>(); try { aCMDBankAccountTypeEntityList = FCCACMDBankAccountType.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load); if (aCMDBankAccountTypeEntityList != null && aCMDBankAccountTypeEntityList.Count > 0) { totalRowCount = aCMDBankAccountTypeEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(aCMDBankAccountTypeEntityList ?? new List <ACMDBankAccountTypeEntity>()); }