Example #1
0
        public static void init()
        {
            readSettings();
            listAllBenh = BenhDAO.getAllList();
            if (!listAllBenh.Any())
            {
                BenhDAO.addOrUpdateBenh("unidentified", new QuanLyPhongKham.Benh());
                listAllBenh.Add(new Benh());
            }
            listAllThuoc = ThuocDAO.getAllList();
            foreach (Thuoc t in listAllThuoc)
            {
                bindingListAllThuoc.Add(t);
            }
            IList <LuotKham> list = LuotKhamDAO.getAllLuotKhamOfCurrentDay();

            listBenhNhan = new BindingList <BenhNhan>();
            if (list.Any())
            {
                for (int i = 0; i < list.Count; i++)
                {
                    listBenhNhan.Add(list.ElementAt(i).BenhNhan1);
                }
            }
            listLuotKhamTrongNgay = new BindingList <LuotKham>();
            listThongKeLuotkham   = new BindingList <ThongKeLuotKham>();
            listThongKeLuotThuoc  = new BindingList <ThongKeLuotThuoc>();
        }
Example #2
0
        public static int addOrUpdateBenh(string loaibenh, string trieuchung)
        {
            Benh benh = BenhDAO.getBenh(loaibenh);

            if (benh == null)
            {
                benh = new QuanLyPhongKham.Benh();
            }
            benh.LoaiBenh   = loaibenh;
            benh.TrieuChung = trieuchung;
            int res = BenhDAO.addOrUpdateBenh(loaibenh, benh);

            if (res == 1)
            {
                listAllBenh.Add(benh);
            }
            if (res == 0)
            {
                foreach (Benh b in listAllBenh)
                {
                    if (b.LoaiBenh.Equals(loaibenh))
                    {
                        b.TrieuChung = trieuchung;
                    }
                }
            }
            return(res);
        }