public static void LoadUserInformation(string userName)
{
SqlConnection con = new SqlConnection(GetConnectionString());
SqlCommand cmd = new SqlCommand("sp", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@UserName", userName);
con.Open();
SqlDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
if (dr.Read())
{
UserID = Convert.ToInt32(dr["UserID"].ToString());
FacilityID = Convert.ToInt32(dr["FacilityID"].ToString());
Admin = Convert.ToBoolean(dr["Admin"].ToString());
Email = dr["Email"].ToString();
}
dr.Close();
con.Close();
}
|