public bool ChiTietCanLamSangUpDate(ChiTietCanLamSangEntites obj)
 {
     var dal = new ChiTietCanLamSangDAL();
     if (dal.ChiTietCanLamSangUpDate(obj))
         return true;
     return false;
 }
 public bool ChiDinhCLSInsert(ChiTietCanLamSangEntites obj)
 {
     var dal = new ChiTietCanLamSangDAL();
     if (dal.ChiDinhCLSInsert(obj))
         return true;
     return false;
 }
 ChiTietCanLamSangEntites NewCLS()
 {
     ChiTietCanLamSangEntites obj = new ChiTietCanLamSangEntites();
     obj.MaChiTietCanLamSang = lblMaCLS.Text;
     obj.BacSiThucHien = txtBacSiThucHien.Text;
     obj.NhanVienNhapLieu = txtNguoiNhap.Text;
     obj.ThoiGianLayMau = dtNgayLayMau.Value;
     obj.ThoiGianTraKQ = dtNgayKQ.Value;
     obj.KetQuaCLS = txtKetQua.Text;
     return obj;
 }
 ChiTietCanLamSangEntites NewChiDinh()
 {
     ChiTietCanLamSangEntites obj = new ChiTietCanLamSangEntites();
     obj.MaBenhNhan = lblMaBN.Text;
     obj.MaChiTietCanLamSang = txtMaCLS.Text;
     obj.MaPhongKham = ((PhongKhamEntity)cbbPhongKham.SelectedItem).MaPhongKham;
     obj.ThoiGianThucHien = dtNgay.Value;
     obj.TenXetNghiem = txtTenXN.Text;
     obj.BacSiChiDinh = txtBacSi.Text;
     return obj;
 }
        //
        public bool ChiTietCanLamSangUpDate(ChiTietCanLamSangEntites obj)
        {
            try
            {
                SqlConnection conn = ConnectionDB.GetConnect();
                conn.Open();
                SqlCommand cmd = new SqlCommand("ChiTietCanLamSangUpDate", conn);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add(new SqlParameter("@MaChiTietCanLamSang", obj.MaChiTietCanLamSang));
                cmd.Parameters.Add(new SqlParameter("@ThoiGianLayMau", obj.ThoiGianLayMau));
                cmd.Parameters.Add(new SqlParameter("@ThoiGianTraKQ", obj.ThoiGianTraKQ));
                cmd.Parameters.Add(new SqlParameter("@BacSiThucHien", obj.BacSiThucHien));
                cmd.Parameters.Add(new SqlParameter("@KetQuaCLS", obj.KetQuaCLS));
                cmd.Parameters.Add(new SqlParameter("@NhanVienNhapLieu", obj.NhanVienNhapLieu));

                cmd.ExecuteNonQuery();
                conn.Close();
            }
            catch { return false; }
            return true;
        }
        public bool ChiDinhCLSUpDate(ChiTietCanLamSangEntites obj)
        {
            try
            {
                SqlConnection conn = ConnectionDB.GetConnect();
                conn.Open();
                SqlCommand cmd = new SqlCommand("ChiDinhCLSUpDate", conn);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add(new SqlParameter("@MaChiTietCanLamSang", obj.MaChiTietCanLamSang));
                cmd.Parameters.Add(new SqlParameter("@MaBenhNhan", obj.MaBenhNhan));
                cmd.Parameters.Add(new SqlParameter("@MaPhongKham", obj.MaPhongKham));
                cmd.Parameters.Add(new SqlParameter("@TenXetNghiem", obj.TenXetNghiem));
                cmd.Parameters.Add(new SqlParameter("@ThoiGianThucHien", obj.ThoiGianThucHien));
                cmd.Parameters.Add(new SqlParameter("@BacSiChiDinh", obj.BacSiChiDinh));

                cmd.ExecuteNonQuery();
                conn.Close();
            }
            catch { return false; }
            return true;
        }