void setOrder(OrderOfPatient order)
 {
     if (order != null)
     {
         lookUpEditOrder.EditValue = order.ID_Order;
     }
 }
示例#2
0
        public void UpdateOrder(List <OrderOfPatient> listOrders)
        {
            SessionFactory SF = new SessionFactory();

            SF.Init();
            SF.OpenSession();

            GenericDaoImpl <OrderOfPatient, int> orderDao       = new GenericDaoImpl <OrderOfPatient, int>(SF.GetSession());
            GenericDaoImpl <OrderStatus, int>    orderStatusDao = new GenericDaoImpl <OrderStatus, int>(SF.GetSession());
            GenericDaoImpl <Patient, int>        patientDao     = new GenericDaoImpl <Patient, int>(SF.GetSession());
            GenericDaoImpl <Doctor, int>         doctorDao      = new GenericDaoImpl <Doctor, int>(SF.GetSession());

            OrderStatus orderStatus = new OrderStatus();
            Patient     patient     = new Patient();
            Doctor      doctor      = new Doctor();

            foreach (OrderOfPatient item in listOrders)
            {
                orderStatus = orderStatusDao.Get(item.OrderStatus.ID_OrderStatus);
                patient     = patientDao.Get(item.Patient.ID_Patient);
                doctor      = doctorDao.Get(item.Doctor.ID_Doctor);

                OrderOfPatient ord = orderDao.Get(item.ID_Order);
                ord.DateOrder   = item.DateOrder;
                ord.Symptoms    = item.Symptoms;
                ord.Patient     = patient;
                ord.Doctor      = doctor;
                ord.OrderStatus = orderStatus;

                orderDao.Save(ord);
            }

            SF.CloseSession();
        }
示例#3
0
        public void UpdateSpeciment(List <SpecimentsInOrder> listSpeciments)
        {
            SessionFactory SF = new SessionFactory();

            SF.Init();
            SF.OpenSession();

            GenericDaoImpl <SpecimentsInOrder, int> specimentDao       = new GenericDaoImpl <SpecimentsInOrder, int>(SF.GetSession());
            GenericDaoImpl <OrderOfPatient, int>    orderDao           = new GenericDaoImpl <OrderOfPatient, int>(SF.GetSession());
            GenericDaoImpl <Speciment, int>         specimentNameDao   = new GenericDaoImpl <Speciment, int>(SF.GetSession());
            GenericDaoImpl <SpecimentStatus, int>   specimentStatusDao = new GenericDaoImpl <SpecimentStatus, int>(SF.GetSession());

            OrderOfPatient  order           = new OrderOfPatient();
            Speciment       specimentName   = new Speciment();
            SpecimentStatus specimentStatus = new SpecimentStatus();

            foreach (SpecimentsInOrder item in listSpeciments)
            {
                order           = orderDao.Get(item.Order.ID_Order);
                specimentName   = specimentNameDao.Get(item.Speciment.ID_Speciment);
                specimentStatus = specimentStatusDao.Get(item.SpecimentStatus.ID_SpecimentStatus);

                SpecimentsInOrder sp = specimentDao.Get(item.ID_SpecimentOrder);
                sp.DateOfTaking    = item.DateOfTaking;
                sp.Nurse           = item.Nurse;
                sp.Order           = order;
                sp.Speciment       = specimentName;
                sp.SpecimentStatus = specimentStatus;

                specimentDao.Save(sp);
            }

            SF.CloseSession();
        }
示例#4
0
        public void AddSpeciment(List <SpecimentsInOrder> listSpeciments)
        {
            SessionFactory SF = new SessionFactory();

            SF.Init();
            SF.OpenSession();

            GenericDaoImpl <SpecimentsInOrder, int> specimentDao       = new GenericDaoImpl <SpecimentsInOrder, int>(SF.GetSession());
            GenericDaoImpl <OrderOfPatient, int>    orderDao           = new GenericDaoImpl <OrderOfPatient, int>(SF.GetSession());
            GenericDaoImpl <Speciment, int>         specimentNameDao   = new GenericDaoImpl <Speciment, int>(SF.GetSession());
            GenericDaoImpl <SpecimentStatus, int>   specimentStatusDao = new GenericDaoImpl <SpecimentStatus, int>(SF.GetSession());

            OrderOfPatient  order           = new OrderOfPatient();
            Speciment       specimentName   = new Speciment();
            SpecimentStatus specimentStatus = new SpecimentStatus();

            foreach (SpecimentsInOrder item in listSpeciments)
            {
                order           = orderDao.Get(item.Order.ID_Order);
                specimentName   = specimentNameDao.Get(item.Speciment.ID_Speciment);
                specimentStatus = specimentStatusDao.Get(item.SpecimentStatus.ID_SpecimentStatus);

                item.Order           = order;
                item.Speciment       = specimentName;
                item.SpecimentStatus = specimentStatus;
                item.Status          = 1;
                specimentDao.Save(item);
            }

            SF.CloseSession();
        }
示例#5
0
        public void DeleteSpeciment(List <SpecimentsInOrder> listSpeciments)
        {
            SessionFactory SF = new SessionFactory();

            SF.Init();
            SF.OpenSession();

            SpecimentsInOrderDaoImpl              specimentDao       = new SpecimentsInOrderDaoImpl(SF.GetSession());
            GenericDaoImpl <OrderOfPatient, int>  orderDao           = new GenericDaoImpl <OrderOfPatient, int>(SF.GetSession());
            GenericDaoImpl <Speciment, int>       specimentNameDao   = new GenericDaoImpl <Speciment, int>(SF.GetSession());
            GenericDaoImpl <SpecimentStatus, int> specimentStatusDao = new GenericDaoImpl <SpecimentStatus, int>(SF.GetSession());
            TestsInOrderDaoImpl              testDao       = new TestsInOrderDaoImpl(SF.GetSession());
            GenericDaoImpl <Test, int>       testNameDao   = new GenericDaoImpl <Test, int>(SF.GetSession());
            GenericDaoImpl <TestStatus, int> testStatusDao = new GenericDaoImpl <TestStatus, int>(SF.GetSession());
            List <TestsInOrder>              listTest;

            OrderOfPatient  order           = new OrderOfPatient();
            Speciment       specimentName   = new Speciment();
            SpecimentStatus specimentStatus = new SpecimentStatus();
            Test            testName        = new Test();
            TestStatus      testStatus      = new TestStatus();

            foreach (SpecimentsInOrder itemSpec in listSpeciments)
            {
                order           = orderDao.Get(itemSpec.Order.ID_Order);
                specimentName   = specimentNameDao.Get(itemSpec.Speciment.ID_Speciment);
                specimentStatus = specimentStatusDao.Get(itemSpec.SpecimentStatus.ID_SpecimentStatus);

                itemSpec.Order           = order;
                itemSpec.Speciment       = specimentName;
                itemSpec.SpecimentStatus = specimentStatus;
                itemSpec.Status          = 0;
                specimentDao.SaveOrUpdate(itemSpec);

                listTest = testDao.GetTestsOfSpeciment(itemSpec.ID_SpecimentOrder).ToList();

                if (listTest.Count > 0)
                {
                    foreach (TestsInOrder itemTest in listTest)
                    {
                        testName   = testNameDao.Get(itemTest.Test.ID_Test);
                        testStatus = testStatusDao.Get(itemTest.TestStatus.ID_TestStatus);

                        itemTest.Test       = testName;
                        itemTest.TestStatus = testStatus;
                        itemTest.Status     = 0;
                        testDao.SaveOrUpdate(itemTest);
                    }
                }
            }

            SF.CloseSession();
        }
示例#6
0
        public OrderOfPatient GetDataOrder()
        {
            SessionFactory SF = new SessionFactory();

            SF.Init();
            SF.OpenSession();

            GenericDaoImpl <OrderOfPatient, int> orderDao = new GenericDaoImpl <OrderOfPatient, int>(SF.GetSession());
            OrderOfPatient ord = orderDao.Get(2);

            SF.CloseSession();
            return(ord);
        }
 OrderOfPatient getOrder()
 {
     order = (OrderOfPatient)lookUpEditOrder.GetSelectedDataRow();
     return(order);
 }