Ejemplo n.º 1
0
        public static bool deleteBaoHanh(EC_BaoHanh bh)
        {
            conn = GetData.KetNoi();
            string sTruyVan = "BaoHanh_Delete";

            cmd             = new SqlCommand(sTruyVan, conn);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@MABH", SqlDbType.NVarChar).Value = bh.MaBH;
            cmd.ExecuteNonQuery();
            cmd.Dispose();
            conn.Close();
            try
            {
                GetData.ThucThiTruyVanNonQuery(sTruyVan, conn);
                //Đóng kết nối
                GetData.DongKetNoi(conn);
                return(true);
            }
            catch (Exception ex)
            {
                //Đóng kết nối
                GetData.DongKetNoi(conn);
                return(false);
            }
        }
Ejemplo n.º 2
0
        public static bool updateBaoHanh(EC_BaoHanh bh)
        {
            conn = GetData.KetNoi();
            string truyvan = "BaoHanh_Update";

            cmd             = new SqlCommand(truyvan, conn);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@MABH", SqlDbType.NVarChar).Value   = bh.MaBH;
            cmd.Parameters.Add("@MAKH", SqlDbType.NVarChar).Value   = bh.MaKH;
            cmd.Parameters.Add("@MASP", SqlDbType.NVarChar).Value   = bh.MaSP;
            cmd.Parameters.Add("@IMEI", SqlDbType.NVarChar).Value   = bh.IMEI;
            cmd.Parameters.Add("@NGAYBD", SqlDbType.NVarChar).Value = bh.NgayBD;
            cmd.Parameters.Add("@NGAYKT", SqlDbType.NVarChar).Value = bh.NgayKT;
            cmd.Parameters.Add("@LOI", SqlDbType.NVarChar).Value    = bh.Loi;
            cmd.Parameters.Add("@GHICHU", SqlDbType.NVarChar).Value = bh.GhiChu;

            cmd.ExecuteNonQuery();
            cmd.Dispose();

            try
            {
                GetData.ThucThiTruyVanNonQuery(truyvan, conn);
                GetData.DongKetNoi(conn);
                return(true);
            }
            catch (Exception ex)
            {
                GetData.DongKetNoi(conn);
                return(false);
            }
        }
 public bool deleteBaoHanh(EC_BaoHanh bh)
 {
     return(DA_BaoHanh.deleteBaoHanh(bh));
 }
 public bool updateBaoHanh(EC_BaoHanh bh)
 {
     return(DA_BaoHanh.updateBaoHanh(bh));
 }
 public bool insertBaoHanh(EC_BaoHanh bh)
 {
     return(DA_BaoHanh.insertBaoHanh(bh));
 }