public virtual List <Account> ViewAccounts() { string cliente = HttpContext.Current.User.Identity.Name;; var da = new SqlDataAccess("UseConfig"); da.SetProc("searchAccounts"); da.AddParameter("@UserName", cliente); _reportTable = da.ExecuteDataSet().Tables[0]; int row = _reportTable.Rows.Count; for (int x = 0; x < _reportTable.Rows.Count; x++) { Account accountList = new Account(); accountList._Id = int.Parse(_reportTable.Rows[x]["id"].ToString()); accountList._Alias = _reportTable.Rows[x]["type"].ToString(); accountList._AccountNumber = _reportTable.Rows[x]["account_number"].ToString(); accountList._Type = _reportTable.Rows[x]["type"].ToString(); accountList._Balance = _reportTable.Rows[x]["balance"].ToString(); accountList._BalanceAvailable = _reportTable.Rows[x]["balance_available"].ToString(); accounts.Add(accountList); } return(accounts); }
public virtual bool Autenticar(string usuario, string contraseña) { var da = new SqlDataAccess("UseConfig"); da.SetProc("LoginValidation"); da.AddParameter("@User", usuario); da.AddParameter("@password", contraseña); _reportTable = da.ExecuteDataSet().Tables[0]; Boolean valor = bool.Parse(_reportTable.Rows[0]["validar"].ToString()); id = int.Parse(_reportTable.Rows[0]["ClientID"].ToString()); return(valor); }
public void AddClient(Cliente cliente) { var db = new SqlDataAccess("UseConfig"); db.SetProc("sp_add_client"); db.AddParameter("@fname", cliente.fname); db.AddParameter("@lname", cliente.lname); db.AddParameter("@cedula", cliente.cedula); db.AddParameter("@email", cliente.email); db.AddParameter("@phone", cliente.phone); db.AddParameter("@birth_date", cliente.birthdate); db.AddParameter("@role", cliente.role); db.ExecuteDataSet(); }