Exemple #1
0
 public Cls_ThietBi_DTA(Cls_ThietBi_DTA TB_Data)
 {
     MaTB      = TB_Data.MaTB;
     TenTB     = TB_Data.TenTB;
     DonGia    = TB_Data.DonGia;
     SoLuong   = TB_Data.SoLuong;
     TrangThai = TB_Data.TrangThai;
     MaLoaiTB  = TB_Data.MaLoaiTB;
 }
Exemple #2
0
 public Cls_ThietBi_DTA(Cls_ThietBi_DTA TB_Data)
 {
     MaTB = TB_Data.MaTB;
     TenTB = TB_Data.TenTB;
     DonGia = TB_Data.DonGia;
     SoLuong = TB_Data.SoLuong;
     TrangThai = TB_Data.TrangThai;
     MaLoaiTB = TB_Data.MaLoaiTB;
 }
Exemple #3
0
         public void Insert_Update_Delete(Cls_ThietBi_DTA TB_Data, string sThucThi)
         {
             sConn.Open();
             try
             {
                 SqlCommand cmd = new SqlCommand();
                 cmd.CommandText = "SP_ThietBi";
                 cmd.Connection = this.sConn;
                 cmd.CommandType = CommandType.StoredProcedure;

                 cmd.Parameters.Add("@MaTB", SqlDbType.Char);
                 cmd.Parameters["@MaTB"].Value = TB_Data.MaTB;

                 cmd.Parameters.Add("@TenTB", SqlDbType.NVarChar);
                 cmd.Parameters["@TenTB"].Value = TB_Data.TenTB;

                 cmd.Parameters.Add("@DonGia", SqlDbType.Float);
                 cmd.Parameters["@DonGia"].Value = TB_Data.DonGia;

                 cmd.Parameters.Add("@SoLuong", SqlDbType.Int);
                 cmd.Parameters["@SoLuong"].Value = TB_Data.SoLuong;

                 cmd.Parameters.Add("@TrangThai", SqlDbType.Bit);
                 cmd.Parameters["@TrangThai"].Value = TB_Data.TrangThai;

                 cmd.Parameters.Add("@MaLoaiTB", SqlDbType.Char);
                 cmd.Parameters["@MaLoaiTB"].Value = TB_Data.MaLoaiTB;

                 cmd.Parameters.Add("@sqlTemp", SqlDbType.NVarChar);
                 if (sThucThi == "Insert" || sThucThi == "Delete" || sThucThi == "Update")
                     cmd.Parameters["@sqlTemp"].Value = sThucThi;
                 cmd.ExecuteNonQuery();

             }
             catch (Exception)
             {

                 throw;
             }
             sConn.Close();
         }
Exemple #4
0
 public void Insert_Update_Delete(Cls_ThietBi_DTA TB_Data,string sThucThi)
 {
     TB_Bus.Insert_Update_Delete(TB_Data, sThucThi);
 }