public IList <ACAccountGroupEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression) { IList <ACAccountGroupEntity> aCAccountGroupEntityList = new List <ACAccountGroupEntity>(); try { if (pageSize == -1) { pageSize = 1000000000; } if (String.IsNullOrEmpty(sortExpression)) { sortExpression = ACAccountGroupEntity.FLD_NAME_AccountGroupID + " " + SQLConstants.SORT_ORDER_DESCENDING; } startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1; aCAccountGroupEntityList = FCCACAccountGroup.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression); if (aCAccountGroupEntityList != null && aCAccountGroupEntityList.Count > 0) { totalRowCount = aCAccountGroupEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(aCAccountGroupEntityList ?? new List <ACAccountGroupEntity>()); }
private void SaveACAccountGroupEntity() { if (IsValid) { try { ACAccountGroupEntity aCAccountGroupEntity = BuildACAccountGroupEntity(); Int64 result = -1; if (aCAccountGroupEntity.IsNew) { result = FCCACAccountGroup.GetFacadeCreate().Add(aCAccountGroupEntity, DatabaseOperationType.Add, TransactionRequired.No); } else { String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(ACAccountGroupEntity.FLD_NAME_AccountGroupID, aCAccountGroupEntity.AccountGroupID.ToString(), SQLMatchType.Equal); result = FCCACAccountGroup.GetFacadeCreate().Update(aCAccountGroupEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No); } if (result > 0) { _AccountGroupID = 0; _ACAccountGroupEntity = new ACAccountGroupEntity(); PrepareInitialView(); BindACAccountGroupList(); if (aCAccountGroupEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "A CAccount Group Information has been added successfully.", false); } else { MiscUtil.ShowMessage(lblMessage, "A CAccount Group Information has been updated successfully.", false); } } else { if (aCAccountGroupEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Failed to add A CAccount Group Information.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to update A CAccount Group Information.", false); } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } }
protected void lvACAccountGroup_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 AccountGroupID; Int64.TryParse(e.CommandArgument.ToString(), out AccountGroupID); if (AccountGroupID > 0) { if (string.Equals(e.CommandName, "EditItem")) { _AccountGroupID = AccountGroupID; PrepareEditView(); cpeEditor.Collapsed = false; cpeEditor.ClientState = "false"; } else if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(ACAccountGroupEntity.FLD_NAME_AccountGroupID, AccountGroupID.ToString(), SQLMatchType.Equal); ACAccountGroupEntity aCAccountGroupEntity = new ACAccountGroupEntity(); result = FCCACAccountGroup.GetFacadeCreate().Delete(aCAccountGroupEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _AccountGroupID = 0; _ACAccountGroupEntity = new ACAccountGroupEntity(); PrepareInitialView(); BindACAccountGroupList(); MiscUtil.ShowMessage(lblMessage, "A CAccount Group has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete A CAccount Group.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
private void BuildTree() { this.Nodes.Clear(); nodeList = FCCACAccountGroup.GetFacadeCreate().GetIL(null, null, String.Empty, String.Empty, DatabaseOperationType.Load); accountList = FCCACAccount.GetFacadeCreate().GetIL(null, null, String.Empty, String.Empty, DatabaseOperationType.Load); TreeNode rootNode = new TreeNode(); rootNode.Text = "Accounts Tree"; rootNode.Value = "0"; rootNode.SelectAction = TreeNodeSelectAction.SelectExpand; rootNode.Expanded = true; LoadCategories(rootNode, null); this.Nodes.Add(rootNode); }
public IList <ACAccountGroupEntity> GetData() { IList <ACAccountGroupEntity> aCAccountGroupEntityList = new List <ACAccountGroupEntity>(); try { aCAccountGroupEntityList = FCCACAccountGroup.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load); if (aCAccountGroupEntityList != null && aCAccountGroupEntityList.Count > 0) { totalRowCount = aCAccountGroupEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(aCAccountGroupEntityList ?? new List <ACAccountGroupEntity>()); }