Esempio n. 1
0
 public bool duan_xoa(DOT_duan da)
 {
     using (SqlConnection conn = getConnect())
     {
         SqlCommand cmd = new SqlCommand("sp_delete_duan", conn);
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.Parameters.Add(new SqlParameter("@mada", da.mada));
         cmd.ExecuteNonQuery();
     }
     return(true);
 }
Esempio n. 2
0
 public int duan_them(DOT_duan da)
 {
     using (SqlConnection conn = getConnect())
     {
         SqlCommand cmd = new SqlCommand("sp_insert_duan", conn);
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.Parameters.Add(new SqlParameter("@tenda", da.tenda));
         cmd.Parameters.Add(new SqlParameter("@ngaybd", da.ngaybd));
         cmd.Parameters.Add(new SqlParameter("@noidung", da.noidung));
         cmd.Parameters.Add(new SqlParameter("@thoihan", da.thoihan));
         cmd.Parameters.Add(new SqlParameter("@hoanthanh", da.hoanthanh));
         return(Convert.ToInt32(cmd.ExecuteScalar()));
     }
 }
Esempio n. 3
0
 public DataTable duan_tim(DOT_duan dan)
 {
     using (SqlConnection conn = getConnect())
     {
         SqlCommand cmd = new SqlCommand("duan_tim", conn);
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.Parameters.Add(new SqlParameter("@tenda", dan.tenda));
         cmd.Parameters.Add(new SqlParameter("@noidung", dan.noidung));
         cmd.ExecuteNonQuery();
         SqlDataAdapter da = new SqlDataAdapter(cmd);
         DataTable      dt = new DataTable();
         da.Fill(dt);
         return(dt);
     }
 }
Esempio n. 4
0
 public bool duan_sua(DOT_duan da)
 {
     using (SqlConnection conn = getConnect())
     {
         SqlCommand cmd = new SqlCommand("sp_update_duan", conn);
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.Parameters.Add(new SqlParameter("@mada", da.mada));
         cmd.Parameters.Add(new SqlParameter("@tenda", da.tenda));
         cmd.Parameters.Add(new SqlParameter("@ngaybd", da.ngaybd));
         cmd.Parameters.Add(new SqlParameter("@noidung", da.noidung));
         cmd.Parameters.Add(new SqlParameter("@thoihan", da.thoihan));
         cmd.Parameters.Add(new SqlParameter("@hoanthanh", da.hoanthanh));
         cmd.ExecuteNonQuery();
     }
     return(true);
 }