Example #1
0
 public bool thanhvien_xoa(DOT_thanhvien tv)
 {
     using (SqlConnection conn = getConnect())
     {
         SqlCommand cmd = new SqlCommand("sp_delete_thanhvien", conn);
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.Parameters.Add(new SqlParameter("@matv", tv.matv));
         cmd.ExecuteNonQuery();
     }
     return(true);
 }
Example #2
0
 public int thanhvien_them(DOT_thanhvien tv)
 {
     using (SqlConnection conn = getConnect())
     {
         SqlCommand cmd = new SqlCommand("sp_insert_thanhvien", conn);
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.Parameters.Add(new SqlParameter("@manv", tv.manv));
         cmd.Parameters.Add(new SqlParameter("@mada", tv.mada));
         cmd.Parameters.Add(new SqlParameter("@chucvu", tv.chucvu));
         cmd.Parameters.Add(new SqlParameter("@congviec", tv.congviec));
         return(Convert.ToInt32(cmd.ExecuteScalar()));
     }
 }
Example #3
0
 public DataTable thanhvien_tim(DOT_thanhvien nv)
 {
     using (SqlConnection conn = getConnect())
     {
         SqlCommand cmd = new SqlCommand("thanhvien_tim", conn);
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.Parameters.Add(new SqlParameter("@congviec", nv.congviec));
         cmd.Parameters.Add(new SqlParameter("@chucvu", nv.chucvu));
         cmd.ExecuteNonQuery();
         SqlDataAdapter da = new SqlDataAdapter(cmd);
         DataTable      dt = new DataTable();
         da.Fill(dt);
         return(dt);
     }
 }
Example #4
0
 public bool thanhvien_sua(DOT_thanhvien tv)
 {
     using (SqlConnection conn = getConnect())
     {
         SqlCommand cmd = new SqlCommand("sp_update_thanhvien", conn);
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.Parameters.Add(new SqlParameter("@matv", tv.matv));
         cmd.Parameters.Add(new SqlParameter("@manv", tv.manv));
         cmd.Parameters.Add(new SqlParameter("@mada", tv.mada));
         cmd.Parameters.Add(new SqlParameter("@chucvu", tv.chucvu));
         cmd.Parameters.Add(new SqlParameter("@congviec", tv.congviec));
         cmd.ExecuteNonQuery();
     }
     return(true);
 }