/// <summary> /// Gets information about the user, if his inergy login exists in the database /// </summary> /// <param name="InergyLogin">the inergy login of the user</param> /// <returns>a DataTable containing one row with information about the user, or an empty datatable if the user /// does not have a valid inergy login</returns> public DataTable GetUserDetails(string inergyLogin, int idCountry) { SqlCommand command = new SqlCommand(); command.CommandType = CommandType.StoredProcedure; command.CommandText = "authVerifyLogin"; SqlParameter inergyLoginParameter = new SqlParameter("@InergyLogin", inergyLogin); inergyLoginParameter.DbType = DbType.String; inergyLoginParameter.Direction = ParameterDirection.Input; SqlParameter idCountryParameter; if (idCountry == ApplicationConstants.INT_NULL_VALUE) { idCountryParameter = new SqlParameter("@IdCountry", DBNull.Value); } else { idCountryParameter = new SqlParameter("@IdCountry", idCountry); } idCountryParameter.DbType = DbType.Int32; idCountryParameter.Direction = ParameterDirection.Input; command.Parameters.Add(inergyLoginParameter); command.Parameters.Add(idCountryParameter); return(CurrentConnectionManager.GetDataTable(command)); }
/// <summary> /// /// </summary> /// <param name="ent"></param> public DataTable GetAsscoiateRoles() { SqlCommand command = new SqlCommand(); command.CommandType = CommandType.StoredProcedure; command.CommandText = "authSelectProfile"; return(CurrentConnectionManager.GetDataTable(command)); }
/// <summary> /// Gets information about the projects that this user is part of /// </summary> /// <param name="idCurrentUser">the id of the current user</param> /// <returns>A DataTable containing information about the projects that this user is part of</returns> public DataTable GetUserProjects(int idCurrentUser) { SqlCommand command = new SqlCommand(); command.CommandType = CommandType.StoredProcedure; command.CommandText = "authSelectUserProjects"; SqlParameter idCurrentUserParameter = new SqlParameter("@IdUser", idCurrentUser); idCurrentUserParameter.DbType = DbType.Int32; idCurrentUserParameter.Direction = ParameterDirection.Input; command.Parameters.Add(idCurrentUserParameter); return(CurrentConnectionManager.GetDataTable(command)); }
public DataTable GetAssociateRole(int idAssociate) { SqlCommand command = new SqlCommand(); command.CommandType = CommandType.StoredProcedure; command.CommandText = "authSelectRoles"; SqlParameter idAssociateParameter = new SqlParameter("@IdAssociate", idAssociate); idAssociateParameter.DbType = DbType.Int32; idAssociateParameter.Direction = ParameterDirection.Input; command.Parameters.Add(idAssociateParameter); return(CurrentConnectionManager.GetDataTable(command)); }
public DataTable GetUserCountries(string inergyLogin) { SqlCommand command = new SqlCommand(); command.CommandType = CommandType.StoredProcedure; command.CommandText = "authSelectUserCountries"; SqlParameter inergyLoginParameter = new SqlParameter("@InergyLogin", inergyLogin); inergyLoginParameter.DbType = DbType.String; inergyLoginParameter.Direction = ParameterDirection.Input; command.Parameters.Add(inergyLoginParameter); return(CurrentConnectionManager.GetDataTable(command)); }
/// <summary> /// method used to retrieve user settings from database /// </summary> /// <param name="associateId"></param> public DataTable usrSelectUserSettings(int associateId) { DataTable dt = new DataTable(); try { SqlCommand cmd = new SqlCommand("usrSelectUserSettings"); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@AssociateId", SqlDbType.Int).Value = associateId; dt = CurrentConnectionManager.GetDataTable(cmd); } catch (SqlException ex) { throw new IndException(ex); } return(dt); }