Пример #1
0
        public DataTable PhongKhamSelectAll()
        {
            SqlConnection conn = ConnectionDB.GetConnect();

            try
            {
                conn.Open();
                SqlCommand cmd = new SqlCommand("PhongKhamSelectAll", conn);
                cmd.CommandType = CommandType.StoredProcedure;
                SqlDataAdapter adap = new SqlDataAdapter(cmd);
                DataTable      dt   = new DataTable();
                adap.Fill(dt);
                return(dt);
            }
            catch
            {
                return(null);

                throw;
            }
            finally
            {
                conn.Close();
            }
        }
        public bool ChiTietDonThuocInsert(ChiTietDonThuocEntites obj)
        {
            try
            {
                SqlConnection conn = ConnectionDB.GetConnect();
                conn.Open();
                SqlCommand cmd = new SqlCommand("ChiTietDonThuocInsert", conn);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add(new SqlParameter("@MaDonThuoc", obj.MaDonThuoc));
                cmd.Parameters.Add(new SqlParameter("@MaThuoc", obj.MaThuoc));
                cmd.Parameters.Add(new SqlParameter("@LieuDung", obj.LieuDung));
                cmd.Parameters.Add(new SqlParameter("@SoLuongThuoc", obj.SoLuongThuoc));

                cmd.ExecuteNonQuery();
                conn.Close();
            }
            catch { return(false); }
            return(true);
        }
Пример #3
0
        public DataTable ThuocSelectTop5(string temp)
        {
            SqlConnection conn = ConnectionDB.GetConnect();

            try
            {
                conn.Open();
                SqlCommand cmd = new SqlCommand("ThuocSelectTop5", conn);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add(new SqlParameter("@TenThuoc", temp));
                SqlDataAdapter adap = new SqlDataAdapter(cmd);
                DataTable      dt   = new DataTable();
                adap.Fill(dt);
                return(dt);
            }
            catch
            {
                return(null);

                throw;
            }
            finally
            {
                conn.Close();
            }
        }
Пример #4
0
 public bool DonThuocInsert(DonThuocEntites obj)
 {
     try
     {
         SqlConnection conn = ConnectionDB.GetConnect();
         conn.Open();
         SqlCommand cmd = new SqlCommand("DonThuocInsert", conn);
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.Parameters.Add(new SqlParameter("@MaDonThuoc", obj.MaDonThuoc));
         cmd.Parameters.Add(new SqlParameter("@TenBacSiKeDon", obj.TenBacSiKeDon));
         cmd.Parameters.Add(new SqlParameter("@MaBenhNhan", obj.MaBenhNhan));
         cmd.Parameters.Add(new SqlParameter("@NgayLapDonThuoc", obj.NgayLapDonThuoc));
         cmd.Parameters.Add(new SqlParameter("@NoiDungDonThuoc", obj.NoiDungDonThuoc));
         cmd.Parameters.Add(new SqlParameter("@GhiChu", obj.GhiChu));
         cmd.ExecuteNonQuery();
         conn.Close();
     }
     catch { return false; }
     return true;
 }
        public bool ChiDinhCLSInsert(ChiTietCanLamSangEntites obj)
        {
            try
            {
                SqlConnection conn = ConnectionDB.GetConnect();
                conn.Open();
                SqlCommand cmd = new SqlCommand("ChiDinhCLSInsert", 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);
        }