public int DeleteUser(string id) { userparameters u = new userparameters(); cmd.CommandText = "user_delete"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue(u.id, id); if (con.State != ConnectionState.Open) { con.Open(); } int r = cmd.ExecuteNonQuery(); con.Close(); return(r); }
public int PutUser(user_manager _u, string _id) { userparameters u = new userparameters(); cmd.CommandText = "user_update"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue(u.id, _id); cmd.Parameters.AddWithValue(u.email, _u.email); cmd.Parameters.AddWithValue(u.f_name, _u.f_name); cmd.Parameters.AddWithValue(u.l_address, _u.l_address); cmd.Parameters.AddWithValue(u.l_name, _u.l_name); cmd.Parameters.AddWithValue(u.m_name, _u.m_name); cmd.Parameters.AddWithValue(u.p_address, _u.p_address); cmd.Parameters.AddWithValue(u.phone, _u.phone); if (con.State != ConnectionState.Open) { con.Open(); } int r = cmd.ExecuteNonQuery(); con.Close(); return(r); }