void setSpecimentStatus(SpecimentStatus specimentStatus)
 {
     if (specimentStatus != null)
     {
         lookUpEditSpecimentStatus.EditValue = specimentStatus.ID_SpecimentStatus;
     }
 }
Beispiel #2
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();
        }
Beispiel #3
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();
        }
Beispiel #4
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();
        }
 SpecimentStatus getSpecimentStatus()
 {
     specimentStatus = (SpecimentStatus)lookUpEditSpecimentStatus.GetSelectedDataRow();
     return(specimentStatus);
 }