Exemple #1
0
 //cap nhat loai sách
 public bool capNhapLoaiSach(ET_LoaiSach ls)
 {
     try
     {
         _cn.Open();
         SqlCommand cmd = new SqlCommand("sp_capnhapLS", _cn);
         cmd.CommandText = "sp_capnhapLS";
         cmd.CommandType = CommandType.StoredProcedure;
         SqlParameter p_ma = new SqlParameter("@MaLoaiSach", ls.MaLoaiSach);
         cmd.Parameters.Add(p_ma);
         SqlParameter p_ten = new SqlParameter("@TenLoaiSach", ls.TenLoaiSach);
         cmd.Parameters.Add(p_ten);
         if (cmd.ExecuteNonQuery() > 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception ex)
     {
         return(false);
     }
     finally
     {
         _cn.Close();
     }
 }
Exemple #2
0
 public bool SuaLoaiSach(ET_LoaiSach s)
 {
     return(ls.capNhapLoaiSach(s));
 }
Exemple #3
0
 public bool ThemLoaiSach(ET_LoaiSach s)
 {
     return(ls.themLoaiSach(s));
 }