/*Funcion: obtiene los grupos de usuario Param: Return: Lista User Group */ public List<UserGroupView> getUserGroup() { AccountDao Dao = new AccountDao(); DataTable DaoResult = Dao.getUserGroup(); List<UserGroupView> ViewList = new List<UserGroupView>(); foreach (DataRow row in DaoResult.Rows) { UserGroupView x = new UserGroupView(); if (DaoResult.Columns.Contains("UserGroupId") && row["UserGroupId"] != DBNull.Value) { x.UserGroupId = Convert.ToInt32(row["UserGroupId"]); } if (DaoResult.Columns.Contains("UserGroupName") && row["UserGroupName"] != DBNull.Value) { x.UserGroupName = row["UserGroupName"].ToString(); } ViewList.Add(x); } return ViewList; }
/*Funcion: buscar cuentas por los datos seleccionados Param: dato a buscar Return: Lista cuentas */ public List<AccountView> searchAccount(String partial) { AccountDao Dao = new AccountDao(); DataTable DaoResult = Dao.searchAccount(partial); return buildAccount(DaoResult); }
/*Funcion: inserta una nueva cuenta Param: accountInsertView Return: status */ public CUDView insertAccount(AccountInsertView account) { AccountDao Dao = new AccountDao(); String state = Dao.insertAccount(account); return CUDVerifyLogic.verifierInsertDeleteUpdate("insert", state); }
public List<AccountView> getAccounts() { AccountDao Dao = new AccountDao(); DataTable DaoResult = Dao.getAccount(); return buildAccount(DaoResult); }
/*Funcion: actualiza una cuenta Param: accountUpdateView Return: status */ public CUDView updateAccount(AccoutUpdateView account) { AccountDao Dao = new AccountDao(); String state = Dao.updateAccount(account); return CUDVerifyLogic.verifierInsertDeleteUpdate("update", state); }