public static List <Class.TypUser> GetTypeUserForTestCase(long idTestCase) { List <Class.TypUser> listtypeUser = new List <Class.TypUser>(); try { using (MySqlConnection conn = DataAccessBase.GetConnection()) { conn.Open(); MySqlCommand command = new MySqlCommand("GetTypeUserForTestCase", conn); command.CommandType = System.Data.CommandType.StoredProcedure; command.Parameters.AddWithValue("@Idtestcase", idTestCase); using (MySqlDataReader reader = command.ExecuteReader()) { while (reader.Read()) { Class.TypUser typeUser = new Class.TypUser(); typeUser.ID_Typ = reader.GetInt32(1); listtypeUser.Add(typeUser); } } } } catch (Exception) { } return(listtypeUser); }
public static List <TypUser> getTypeUser() { List <TypUser> tu = new List <TypUser>(); //try //{ using (MySqlConnection conn = DataAccessBase.GetConnection()) { conn.Open(); MySqlCommand command = new MySqlCommand("GetTypeUsers", conn); command.CommandType = System.Data.CommandType.StoredProcedure; using (MySqlDataReader reader = command.ExecuteReader()) { while (reader.Read()) { Class.TypUser typeuser = new Class.TypUser(); typeuser.ID_Typ = reader.GetInt16(0); typeuser.DescriptionTypUser = reader.GetString(1); tu.Add(typeuser); } } } //} //catch (Exception ex) //{ // esito.esito = false; // esito.Message= ex.Message; //} return(tu); }
protected void gvTypeUser_SelectedIndexChanging(object sender, GridViewSelectEventArgs e) { // get id user my datakey selected in the gridview int id_usertype = Convert.ToInt32(gvTypeUser.DataKeys[e.NewSelectedIndex].Value); hddIdTypeUser.Value = id_usertype.ToString(); Class.TypUser typuser = DataAccess.DataAccessUser.getTypeUser(id_usertype); UpdateTypeUserText.Text = typuser.DescriptionTypUser; fUpdateTypeUser.Visible = true; fConfigFooter.Visible = true; DivSuccessConfig.Visible = false; DivErrorConfig.Visible = false; fAddUserType.Visible = false; }
public static TypUser getTypeUser(int TypeUser) { Class.TypUser typeuser = new Class.TypUser(); using (MySqlConnection conn = DataAccessBase.GetConnection()) { conn.Open(); MySqlCommand command = new MySqlCommand("GetTypeUser", conn); command.CommandType = System.Data.CommandType.StoredProcedure; command.Parameters.AddWithValue("idtypeuser", TypeUser); using (MySqlDataReader reader = command.ExecuteReader()) { while (reader.Read()) { typeuser.ID_Typ = reader.GetInt16(0); typeuser.DescriptionTypUser = reader.GetString(1); } } } return(typeuser); }