Ejemplo n.º 1
0
 public static void UpdatePassword(string Manhanvien, string Password)
 {
     using (DB_HMS_Entities Grp = new DB_HMS_Entities())
     {
         var query = (from u in Grp.tbNHANVIENs
                      where u.MANHANVIEN == Manhanvien
                      select u).First();
         query.MATKHAU = ToMD5(ToMD5(ToMD5(Password)));
         Grp.SaveChanges();
     }
 }
Ejemplo n.º 2
0
 public static void DeleteDonthuocchitiet(string MADONTHUOCMAU, string MABACSI, string MATHUOC)
 {
     using (DB_HMS_Entities dk = new DB_HMS_Entities())
     {
         var query = (from c in dk.tbDONTHUOCMAUCHITIETs
                      where c.MADONTHUOCMAU == MADONTHUOCMAU && c.MABACSI == MABACSI && c.MATHUOC == MATHUOC
                      select c).First();
         dk.DeleteObject(query);
         dk.SaveChanges();
     }
 }
Ejemplo n.º 3
0
 public static void UpdateStaffGroup(string MaNhomNhanVien, string TenNhomNhanVien, string MoTa, bool TrangThai)
 {
     using (DB_HMS_Entities Group = new DB_HMS_Entities())
     {
         var query = (from u in Group.tbNHOMNGUOIDUNGs where u.MANHOMNDN == MaNhomNhanVien select u).First();
         query.TENNHOMND = TenNhomNhanVien;
         query.MOTA      = MoTa;
         query.TRANGTHAI = TrangThai;
         Group.SaveChanges();
     }
 }
 public static void InsertFunctionofGroup(string MaNhomNhanVien, string MaTinhNang)
 {
     using (DB_HMS_Entities Group = new DB_HMS_Entities())
     {
         tbTINHNANGNHOMND lst = new tbTINHNANGNHOMND();
         lst.MATINHNANG = MaTinhNang;
         lst.MANHOMND   = MaNhomNhanVien;
         lst.NGAYTAO    = DateTime.Today;
         Group.AddTotbTINHNANGNHOMNDs(lst);
         Group.SaveChanges();
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Cập nhật bệnh vào database
 /// </summary>
 /// <param name="MABENH"></param>
 /// <param name="MANHOMBENH"></param>
 /// <param name="TENBENHTA"></param>
 /// <param name="TENBENHTV"></param>
 /// <param name="MOTA"></param>
 /// <param name="NGAYTAO"></param>
 /// <param name="TRANGTHAI"></param>
 public static void UpdateTrangthai(string MABENHAN, int TRANGTHAI)
 {
     using (DB_HMS_Entities ds = new DB_HMS_Entities())
     {
         tbHOSOKHAMBENH pk    = new tbHOSOKHAMBENH();
         var            query = (from dss in ds.tbHOSOKHAMBENHs
                                 where dss.MAKHAMBENH == MABENHAN
                                 select dss).First();
         query.TRANGTHAI = TRANGTHAI;
         ds.SaveChanges();
     }
 }
Ejemplo n.º 6
0
 public static void UpdateMaxacnhan(string MABENHAN, int MAXACNHAN)
 {
     using (DB_HMS_Entities ds = new DB_HMS_Entities())
     {
         tbHOSOKHAMBENH pk    = new tbHOSOKHAMBENH();
         var            query = (from dss in ds.tbHOSOKHAMBENHs
                                 where dss.MAKHAMBENH == MABENHAN
                                 select dss).First();
         query.MAXACNHAN = MAXACNHAN;
         ds.SaveChanges();
     }
 }
Ejemplo n.º 7
0
 public static void UpdateBacsivaobenhan(string MABENHAN, string MABACSY)
 {
     using (DB_HMS_Entities ds = new DB_HMS_Entities())
     {
         tbHOSOKHAMBENH pk    = new tbHOSOKHAMBENH();
         var            query = (from dss in ds.tbHOSOKHAMBENHs
                                 where dss.MAKHAMBENH == MABENHAN
                                 select dss).First();
         query.MABACSY = MABACSY;
         ds.SaveChanges();
     }
 }
Ejemplo n.º 8
0
        /// <summary>
        /// Hàm delete 1 quốc gia ở database
        /// </summary>
        /// <param name="maquocgia"></param>
        public static void DeleteBenhtheopk(string MABENH, string MAPHONGKHAM)
        {
            using (DB_HMS_Entities dk = new DB_HMS_Entities())
            {
                var query = (from c in dk.tbBENHPHONGKHAMs
                             where c.MABENH == MABENH && c.MAPHONGKHAM == MAPHONGKHAM
                             select c).First();

                dk.DeleteObject(query);
                dk.SaveChanges();
            }
        }
Ejemplo n.º 9
0
 /// <summary>
 /// Thêm bệnh theo phòng khám vào database
 /// </summary>
 /// <param name="MABENH"></param>
 /// <param name="MANHOMBENH"></param>
 /// <param name="TENBENHTA"></param>
 /// <param name="TENBENHTV"></param>
 /// <param name="MOTA"></param>
 /// <param name="NGAYTAO"></param>
 /// <param name="TRANGTHAI"></param>
 public static void InsertBentheopk(string MABENH, string MAPHONGKHAM, DateTime NGAYTAO)
 {
     using (DB_HMS_Entities ds = new DB_HMS_Entities())
     {
         tbBENHPHONGKHAM pk = new tbBENHPHONGKHAM();
         pk.MABENH      = MABENH;
         pk.MAPHONGKHAM = MAPHONGKHAM;
         pk.NGAYTAO     = NGAYTAO;
         ds.AddTotbBENHPHONGKHAMs(pk);
         ds.SaveChanges();
     }
 }
 public static void DeleteFunctionofGroup(string MaNhomNhanVien)
 {
     using (DB_HMS_Entities lst = new DB_HMS_Entities())
     {
         var query = from u in lst.tbTINHNANGNHOMNDs where u.MANHOMND == MaNhomNhanVien select u;
         foreach (var row in query)
         {
             lst.DeleteObject(row);
         }
         lst.SaveChanges();
     }
 }
Ejemplo n.º 11
0
 public static void InsertToathuoc(string MABENHAN, string MATHUOC, string SOLUONG, string SOLANDUNG, string SOLUONGDUNG, DateTime NGAYTAO)
 {
     using (DB_HMS_Entities dk = new DB_HMS_Entities())
     {
         tbKETOATHUOC sl = new tbKETOATHUOC();
         sl.MABENHAN    = MABENHAN;
         sl.SOLUONG     = Int32.Parse(SOLUONG);
         sl.SOLANDUNG   = Int32.Parse(SOLANDUNG);
         sl.SOLUONGDUNG = Int32.Parse(SOLUONGDUNG);
         sl.NGAYTAO     = NGAYTAO;
         dk.SaveChanges();
     }
 }
Ejemplo n.º 12
0
 public static void InsertDonthuocmau(string MADONTHUOCMAU, string MABACSI, DateTime NGAYTAO, Boolean TRANGTHAI)
 {
     using (DB_HMS_Entities ds = new DB_HMS_Entities())
     {
         tbDONTHUOCMAU pk = new tbDONTHUOCMAU();
         pk.MADONTHUOCMAU = MADONTHUOCMAU;
         pk.MABACSY       = MABACSI;
         pk.NGAYTAO       = NGAYTAO;
         pk.TRANGTHAI     = TRANGTHAI;
         ds.AddTotbDONTHUOCMAUs(pk);
         ds.SaveChanges();
     }
 }
Ejemplo n.º 13
0
 public static void InsertStaffGroup(string MaNhomNhanVien, string TenNhomNhanVien, string MoTa, bool TrangThai)
 {
     using (DB_HMS_Entities Group = new DB_HMS_Entities())
     {
         tbNHOMNGUOIDUNG lst = new tbNHOMNGUOIDUNG();
         lst.MANHOMNDN = MaNhomNhanVien;
         lst.TENNHOMND = TenNhomNhanVien;
         lst.MOTA      = MoTa;
         lst.TRANGTHAI = TrangThai;
         Group.AddTotbNHOMNGUOIDUNGs(lst);
         Group.SaveChanges();
     }
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Them moi phong kham vao entities
 /// </summary>
 /// <param name="MAPHONGKHAM"></param>
 /// <param name="TENPHONG"></param>
 /// <param name="NGAYTAO"></param>
 /// <param name="TRANGTHAI"></param>
 public static void Insertphongkham(string MAPHONGKHAM, string TENPHONG, DateTime NGAYTAO, Boolean TRANGTHAI)
 {
     using (DB_HMS_Entities ds = new DB_HMS_Entities())
     {
         tbPHONGKHAM pk = new tbPHONGKHAM();
         pk.MAPHONGKHAM = MAPHONGKHAM;
         pk.TENPHONG    = TENPHONG;
         pk.NGAYTAO     = NGAYTAO;
         pk.TRANGTHAI   = TRANGTHAI;
         ds.AddTotbPHONGKHAMs(pk);
         ds.SaveChanges();
     }
 }
Ejemplo n.º 15
0
 /// <summary>
 /// cap nhat phong kham vao entities
 /// </summary>
 /// <param name="MAPHONGKHAM"></param>
 /// <param name="TENPHONG"></param>
 /// <param name="NGAYTAO"></param>
 /// <param name="TRANGTHAI"></param>
 public static void Updatephongkham(string MAPHONGKHAM, string TENPHONG, DateTime NGAYTAO, Boolean TRANGTHAI)
 {
     using (DB_HMS_Entities ds = new DB_HMS_Entities())
     {
         tbPHONGKHAM pk    = new tbPHONGKHAM();
         var         query = (from dss in ds.tbPHONGKHAMs
                              where dss.MAPHONGKHAM == MAPHONGKHAM
                              select dss).First();
         query.TENPHONG  = TENPHONG;
         query.NGAYTAO   = NGAYTAO;
         query.TRANGTHAI = TRANGTHAI;
         ds.SaveChanges();
     }
 }
Ejemplo n.º 16
0
 /// <summary>
 /// Thêm nhóm bệnh vào database
 /// </summary>
 /// <param name="MABENH"></param>
 /// <param name="MANHOMBENH"></param>
 /// <param name="TENBENHTA"></param>
 /// <param name="TENBENHTV"></param>
 /// <param name="MOTA"></param>
 /// <param name="NGAYTAO"></param>
 /// <param name="TRANGTHAI"></param>
 public static void InsertNhombenh(string MANHOMBENH, string TENNHOMBENH, string MOTA, DateTime NGAYTAO, Boolean TRANGTHAI)
 {
     using (DB_HMS_Entities ds = new DB_HMS_Entities())
     {
         tbNHOMBENH pk = new tbNHOMBENH();
         pk.MANHOMBENH  = MANHOMBENH;
         pk.TENNHOMBENH = TENNHOMBENH;
         pk.MOTA        = MOTA;
         pk.NGAYTAO     = NGAYTAO;
         pk.TRANGTHAI   = TRANGTHAI;
         ds.AddTotbNHOMBENHs(pk);
         ds.SaveChanges();
     }
 }
Ejemplo n.º 17
0
 /// <summary>
 /// Cập nhật nhóm bệnh xuống database
 /// </summary>
 /// <param name="MANHOMBENH"></param>
 /// <param name="TENNHOMBENH"></param>
 /// <param name="MOTA"></param>
 /// <param name="NGAYTAO"></param>
 /// <param name="TRANGTHAI"></param>
 public static void UpdateNhombenh(string MANHOMBENH, string TENNHOMBENH, string MOTA, DateTime NGAYTAO, Boolean TRANGTHAI)
 {
     using (DB_HMS_Entities ds = new DB_HMS_Entities())
     {
         tbNHOMBENH pk    = new tbNHOMBENH();
         var        query = (from dss in ds.tbNHOMBENHs
                             where dss.MANHOMBENH == MANHOMBENH
                             select dss).First();
         query.TENNHOMBENH = TENNHOMBENH;
         query.MOTA        = MOTA;
         query.NGAYTAO     = NGAYTAO;
         query.TRANGTHAI   = TRANGTHAI;
         ds.SaveChanges();
     }
 }
Ejemplo n.º 18
0
 public static void InsertDonthuocchitiet(string MADONTHUOCMAU, string MABACSI, string MATHUOC, string SOLUONG, string SOLANDUNG, string SOLUONGDUNG, DateTime NGAYTAO)
 {
     using (DB_HMS_Entities ds = new DB_HMS_Entities())
     {
         tbDONTHUOCMAUCHITIET pk = new tbDONTHUOCMAUCHITIET();
         pk.MADONTHUOCMAU = MADONTHUOCMAU;
         pk.MABACSI       = MABACSI;
         pk.MATHUOC       = MATHUOC;
         pk.SOLUONG       = Int32.Parse(SOLUONG);
         pk.SOLANDUNG     = Int32.Parse(SOLANDUNG);
         pk.SOLUONGDUNG   = Int32.Parse(SOLUONGDUNG);
         pk.NGAYTAO       = NGAYTAO;
         ds.AddTotbDONTHUOCMAUCHITIETs(pk);
         ds.SaveChanges();
     }
 }
Ejemplo n.º 19
0
 public static void UpdateDonthuocchitiet(string MADONTHUOCMAU, string MABACSI, string MATHUOC, string SOLUONG, string SOLANDUNG, string SOLUONGDUNG, DateTime NGAYTAO)
 {
     using (DB_HMS_Entities ds = new DB_HMS_Entities())
     {
         tbDONTHUOCMAUCHITIET pk = new tbDONTHUOCMAUCHITIET();
         var query = (from dss in ds.tbDONTHUOCMAUCHITIETs
                      where dss.MADONTHUOCMAU == MADONTHUOCMAU && dss.MABACSI == MABACSI && dss.MATHUOC == MATHUOC
                      select dss).First();
         //query.MABENH = MABENH;
         query.SOLUONG     = Int32.Parse(SOLUONG);
         query.SOLANDUNG   = Int32.Parse(SOLANDUNG);
         query.SOLUONGDUNG = Int32.Parse(SOLUONGDUNG);
         query.NGAYTAO     = NGAYTAO;
         ds.SaveChanges();
     }
 }
Ejemplo n.º 20
0
 public static void UpdateStaffInfor(string Manhanvien, string Maphongkham, string Manhomnhanvien, string Hoten, string Gioitinh, string Chucdanh, bool Tinhtrang)
 {
     using (DB_HMS_Entities Grp = new DB_HMS_Entities())
     {
         var query = (from u in Grp.tbNHANVIENs
                      where u.MANHANVIEN == Manhanvien
                      select u).First();
         query.MAPHONGKHAM = Maphongkham;
         query.MANHOMND    = Manhomnhanvien;
         query.HOTEN       = Hoten;
         query.GIOITINH    = Gioitinh;
         query.CHUCDANH    = Chucdanh;
         query.TRANGTHAI   = Tinhtrang;
         Grp.SaveChanges();
     }
 }
Ejemplo n.º 21
0
 /// <summary>
 /// Thêm bệnh vào database
 /// </summary>
 /// <param name="MABENH"></param>
 /// <param name="MANHOMBENH"></param>
 /// <param name="TENBENHTA"></param>
 /// <param name="TENBENHTV"></param>
 /// <param name="MOTA"></param>
 /// <param name="NGAYTAO"></param>
 /// <param name="TRANGTHAI"></param>
 public static void InsertBenh(string MABENH, string MANHOMBENH1, string TENBENHTA, string TENBENHTV, string MOTA1, DateTime NGAYTAO1, Boolean TRANGTHAI1)
 {
     using (DB_HMS_Entities ds = new DB_HMS_Entities())
     {
         tbBENH pk = new tbBENH();
         pk.MABENH     = MABENH;
         pk.MANHOMBENH = MANHOMBENH1;
         pk.TENBENHTA  = TENBENHTA;
         pk.TENBENHTV  = TENBENHTV;
         pk.MOTA       = MOTA1;
         pk.NGAYTAO    = NGAYTAO1;
         pk.TRANGTHAI  = TRANGTHAI1;
         ds.AddTotbBENHs(pk);
         ds.SaveChanges();
     }
 }
Ejemplo n.º 22
0
        /// <summary>
        /// Thêm thuốc xuống database
        /// </summary>
        /// <param name="MATHUOC"></param>
        /// <param name="TENTHUONGMAI"></param>
        /// <param name="TENBIETDUOC"></param>
        /// <param name="CACHDUNG"></param>
        /// <param name="DONVI"></param>
        /// <param name="DONVIDUNG"></param>
        /// <param name="GHICHU"></param>
        /// <param name="TRANGTHAI"></param>

        public static void InsertMedicine(string MATHUOC, string TENTHUONGMAI, string TENBIETDUOC, string CACHDUNG, string DONVI, string DONVIDUNG, string GHICHU, Boolean TRANGTHAI)
        {
            using (DB_HMS_Entities dk = new DB_HMS_Entities())
            {
                tbTHUOC med = new tbTHUOC();
                med.MATHUOC      = MATHUOC;
                med.TENTHUONGMAI = TENTHUONGMAI;
                med.TENBIETDUOC  = TENBIETDUOC;
                med.CACHDUNG     = CACHDUNG;
                med.DONVI        = DONVI;
                med.DONVIDUNG    = DONVIDUNG;
                med.GHICHU       = GHICHU;
                med.TRANGTHAI    = TRANGTHAI;
                dk.AddTotbTHUOCs(med);
                dk.SaveChanges();
            }
        }
Ejemplo n.º 23
0
 public static void UpdateToathuoc(string MABENHAN, string MATHUOC, string SOLUONG, string SOLANDUNG, string SOLUONGDUNG, DateTime NGAYTAO)
 {
     using (DB_HMS_Entities ds = new DB_HMS_Entities())
     {
         tbKETOATHUOC pk    = new tbKETOATHUOC();
         var          query = (from dss in ds.tbKETOATHUOCs
                               where dss.MABENHAN == MABENHAN
                               select dss).First();
         //query.MABENH = MABENH;
         query.MATHUOC     = MATHUOC;
         query.SOLUONG     = int.Parse(SOLUONG);
         query.SOLANDUNG   = int.Parse(SOLANDUNG);
         query.SOLUONGDUNG = int.Parse(SOLUONGDUNG);
         query.NGAYTAO     = NGAYTAO;
         ds.SaveChanges();
     }
 }
Ejemplo n.º 24
0
 /// <summary>
 /// Cập nhật thông tin thuốc
 /// </summary>
 /// <param name="MATHUOC"></param>
 /// <param name="TENTHUONGMAI"></param>
 /// <param name="TENBIETDUOC"></param>
 /// <param name="CACHDUNG"></param>
 /// <param name="DONVI"></param>
 /// <param name="DONVIDUNG"></param>
 /// <param name="GHICHU"></param>
 /// <param name="TRANGTHAI"></param>
 public static void UpdateMedicine(string MATHUOC, string TENTHUONGMAI, string TENBIETDUOC, string CACHDUNG, string DONVI, string DONVIDUNG, string GHICHU, Boolean TRANGTHAI)
 {
     using (DB_HMS_Entities dk = new DB_HMS_Entities())
     {
         var query = (from up in dk.tbTHUOCs
                      where up.MATHUOC == MATHUOC
                      select up).First();
         query.MATHUOC      = MATHUOC;
         query.TENBIETDUOC  = TENBIETDUOC;
         query.TENTHUONGMAI = TENTHUONGMAI;
         query.CACHDUNG     = CACHDUNG;
         query.DONVIDUNG    = DONVIDUNG;
         query.DONVI        = DONVI;
         query.GHICHU       = GHICHU;
         query.TRANGTHAI    = TRANGTHAI;
         dk.SaveChanges();
     }
 }
Ejemplo n.º 25
0
 public static void InsertNewStaff(string Manhanvien, string Maphongkham, string Manhomnhanvien, string Hoten, string Gioitinh, string Tendangnhap, string Matkhau, string Chucdanh, bool Tinhtrang, DateTime Ngaytao)
 {
     using (DB_HMS_Entities staff = new DB_HMS_Entities())
     {
         tbNHANVIEN infor = new tbNHANVIEN();
         infor.MANHANVIEN  = Manhanvien;
         infor.MAPHONGKHAM = Maphongkham;
         infor.MANHOMND    = Manhomnhanvien;
         infor.HOTEN       = Hoten;
         infor.GIOITINH    = Gioitinh;
         infor.CHUCDANH    = Chucdanh;
         infor.IDDANGNHAP  = Tendangnhap;
         infor.MATKHAU     = ToMD5(ToMD5(ToMD5(Matkhau)));
         infor.TRANGTHAI   = Tinhtrang;
         infor.NGAYTAO     = Ngaytao;
         staff.AddTotbNHANVIENs(infor);
         staff.SaveChanges();
     }
 }
Ejemplo n.º 26
0
 /// <summary>
 /// Nhập vào thông tin của sinh liệu
 /// </summary>
 /// <param name="MASINHLIEU"></param>
 /// <param name="MABENHNHAN"></param>
 /// <param name="MAYTA"></param>
 /// <param name="MACH"></param>
 /// <param name="NHIPTHO"></param>
 /// <param name="NHIETDO"></param>
 /// <param name="HUYETAP"></param>
 /// <param name="CHIEUCAO"></param>
 /// <param name="CANNANG"></param>
 /// <param name="VONGBUNG"></param>
 /// <param name="NGAYTAO"></param>
 /// <param name="TRANGTHAI"></param>
 public static void InsertInformation(string MASINHLIEU, string MABENHAN, string MAYTA, string MACH, string NHIPTHO, string NHIETDO, string HUYETAP, string CHIEUCAO, string CANNANG, string VONGBUNG, DateTime NGAYTAO, Boolean TRANGTHAI)
 {
     using (DB_HMS_Entities dk = new DB_HMS_Entities())
     {
         tbSINHLIEU sl = new tbSINHLIEU();
         sl.MASINHLIEU = MASINHLIEU;
         sl.MABENHAN   = MABENHAN;
         sl.MAYTA      = MAYTA;
         sl.MACH       = MACH;
         sl.NHIPTHO    = NHIPTHO;
         sl.NHIETDO    = NHIETDO;
         sl.HUYETAP    = HUYETAP;
         sl.CHIEUCAO   = CHIEUCAO;
         sl.CANNANG    = CANNANG;
         sl.VONGBUNG   = VONGBUNG;
         sl.NGAYTAO    = NGAYTAO;
         sl.TRANGTHAI  = TRANGTHAI;
         dk.AddTotbSINHLIEUx(sl);
         dk.SaveChanges();
     }
 }