Пример #1
0
 /// <summary>
 /// Loads account of user according to thier account category
 /// </summary>
 /// <param name="category"></param>
 /// <param name="id"></param>
 public void loadAccount(string category, int id)
 {
     if (category.Equals("new"))
     {
         pages.welcome newPage = new pages.welcome(this, id);
         pageTransitionControl.TransitionType = PageTransitionType.Fade;
         pageTransitionControl.ShowPage(newPage);
     }
     else if (category.Equals("doctor"))
     {
         pages.doctor.doctor_frame newPage = new pages.doctor.doctor_frame(this, id);
         pageTransitionControl.TransitionType = PageTransitionType.Fade;
         pageTransitionControl.ShowPage(newPage);
     }
     else if (category.Equals("patient"))
     {
         pages.patient.patient_frame newPage = new pages.patient.patient_frame(this, id);
         pageTransitionControl.TransitionType = PageTransitionType.Fade;
         pageTransitionControl.ShowPage(newPage);
     }
     else if (category.Equals("admin"))
     {
         pages.admin.admin_frame newPage = new pages.admin.admin_frame(this, id);
         pageTransitionControl.TransitionType = PageTransitionType.Fade;
         pageTransitionControl.ShowPage(newPage);
     }
 }
Пример #2
0
        public settings(MainWindow root, patient_frame _sub)
        {
            InitializeComponent();
            parent            = root;
            subparent         = _sub;
            profilePix.Source = subparent.image1.Source;

            loadAccountInfo();
        }
Пример #3
0
        public dashboard(MainWindow root, patient_frame subroot)
        {
            parent    = root;
            subparent = subroot;
            InitializeComponent();

            timer          = new DispatcherTimer();
            timer.Tick    += new EventHandler(timer_tick);
            timer.Interval = new TimeSpan(0, 0, 3);
            timer.Start();
        }
Пример #4
0
        /// <summary>
        /// Get list of all drugs
        /// </summary>
        /// <param name="root"></param>
        /// <param name="_sub"></param>
        public pharmacy(MainWindow root, patient_frame _sub)
        {
            parent    = root;
            subparent = _sub;
            InitializeComponent();

            DataTable qry = parent.query("select * from drugs order by drug_name asc");

            listDrugs(qry);
            checkCart();
        }
Пример #5
0
        int refreshConversationListDelay = 2; //4 seconds (2 second equals 1 counts)


        public messages(MainWindow root, patient_frame _sub)
        {
            parent    = root;
            subparent = _sub;
            InitializeComponent();
            timer          = new DispatcherTimer();
            timer.Tick    += new EventHandler(timer_tick);
            timer.Interval = new TimeSpan(0, 0, 2);
            timer.Start();

            rectFrame.Visibility = rtb.Visibility = sendBut.Visibility = bodyBox.Visibility = threadLabel.Visibility = messagecountLabel.Visibility = Visibility.Hidden;
        }
Пример #6
0
        /// <summary>
        /// Load up result history
        /// </summary>
        /// <param name="root"></param>
        /// <param name="_sub"></param>
        public result(MainWindow root, patient_frame _sub)
        {
            parent    = root;
            subparent = _sub;
            InitializeComponent();

            DataTable qry = parent.query("select recordid,date_added from record where patientid=" + subparent.PatientId + " order by recordid");

            foreach (DataRow rw in qry.Rows)
            {
                id.Add(int.Parse(rw["recordid"].ToString()));
                listBox.Items.Add(rw["date_added"].ToString());
            }
        }
Пример #7
0
        /// <summary>
        /// Get list of all doctors
        /// </summary>
        /// <param name="_root"></param>
        /// <param name="_root2"></param>
        /// <param name="_sub"></param>
        public AddConversation(MainWindow _root, patient_frame _root2, messages _sub)
        {
            parent    = _root;
            subparent = _sub;
            parent2   = _root2;
            InitializeComponent();
            DataTable qry = parent.query("select login_user_id, concat(lastname,' ',firstname) as name,specialization from doctor");

            foreach (DataRow rw in qry.Rows)
            {
                doctors.Add(rw["login_user_id"].ToString());
                specialization.Add(rw["specialization"].ToString());
                doctorList.Items.Add(rw["name"].ToString());
            }
        }
Пример #8
0
        /// <summary>
        /// Load up all bill history
        /// </summary>
        /// <param name="root"></param>
        /// <param name="_sub"></param>
        public bill(MainWindow root, patient_frame _sub)
        {
            parent    = root;
            subparent = _sub;
            InitializeComponent();

            DataTable tab   = parent.query("select amount,date from bills where patientid=" + subparent.PatientId + " order by bill_id");
            int       Count = 0;

            foreach (DataRow rw in tab.Rows)
            {
                Count++;
                BillHolder bill = new BillHolder();
                bill.ID     = Count;
                bill.amount = rw["amount"].ToString();
                bill.date   = rw["date"].ToString();

                listView1.Items.Add(bill);
            }
        }
Пример #9
0
        /// <summary>
        /// Display list of items in cart
        /// </summary>
        /// <param name="_parent"></param>
        /// <param name="_subparent"></param>
        /// <param name="_sub"></param>
        public cart(MainWindow _parent, patient_frame _subparent, pharmacy _sub)
        {
            parent    = _parent;
            subparent = _subparent;
            pharmacy  = _sub;
            InitializeComponent();

            DataTable qry   = parent.query("select * from cart where login_user_id=" + _subparent.AccountId);
            int       count = 0;

            foreach (DataRow rw in qry.Rows)
            {
                CartItem item = new CartItem();
                item.cost = rw["cost"].ToString();
                item.drug = rw["drug"].ToString();
                item.cid  = rw["cart_id"].ToString();
                count++;
                item.id = count;
                listView.Items.Add(item);
            }
        }
Пример #10
0
        /// <summary>
        /// Add all schedules for current date to a listview. Trigger calendar date change event
        /// </summary>
        /// <param name="root"></param>
        /// <param name="_sub"></param>
        public appointment(MainWindow root, patient_frame _sub)
        {
            parent    = root;
            subparent = _sub;
            InitializeComponent();

            DataTable qry = parent.query("select scheduleid, (select concat(lastname,' ',firstname) from doctor where doctor.doctorid=schedule.doctorid) as name, status as attended, schedule.date as schedule, date_added as created from schedule where convert(date,date)=str_to_date('" + DateTime.Now.ToShortDateString() + "','%m/%d/%Y') and patientid = " + subparent.PatientId);

            foreach (DataRow rw in qry.Rows)
            {
                ScheduleHolder schedule = new ScheduleHolder();
                schedule.ID          = int.Parse(rw["scheduleid"].ToString());
                schedule.doctor_name = (rw["name"].ToString());
                schedule.attended    = (rw["attended"].ToString());
                schedule.schedule    = (rw["schedule"].ToString());
                schedule.created     = (rw["created"].ToString());

                listView1.Items.Add(schedule);
            }


            calendar_SelectedDatesChanged(null, null);
        }