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 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(); }
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 DataSet List(String Scenario, String FromReqdate, String ResponseDate, String ChbFailed) { DataSet _retVal = null; SqlDataAccess oDataWrapper = null; string strInterface = System.Configuration.ConfigurationManager.AppSettings["InterDB"].ToString(); try { oDataWrapper = new SqlDataAccess(); SqlParameter[] oParameter = new SqlParameter[4]; oParameter[0] = new SqlParameter("@Scenario", SqlDbType.VarChar); oParameter[0].Value = Scenario; oParameter[1] = new SqlParameter("@ReqDateF", SqlDbType.Date); oParameter[1].Value = Convert.ToDateTime(FromReqdate.ToString()); oParameter[2] = new SqlParameter("@ReqDateT", SqlDbType.Date); oParameter[2].Value = Convert.ToDateTime(ResponseDate.ToString()); oParameter[3] = new SqlParameter("@Failed", SqlDbType.Int); if (ChbFailed.ToString() != "False") { oParameter[3].Value = "0"; } else { oParameter[3].Value = "1"; } _retVal = oDataWrapper.ExecuteDataSet(SELECT, oParameter, strInterface); } catch (Exception) { throw; } finally { oDataWrapper = null; } return(_retVal); }
public DataSet ExecuteDataSet(string storedProcedure, params SqlParameter[] parameters) { return(_sqlDataAccess.ExecuteDataSet(storedProcedure, parameters)); }