Example #1
0
        private List <CommContracts.MedicineOutStoreDetail> GetDetails()
        {
            List <MyDetail> list = myTableEdit.GetAllDetails();
            List <CommContracts.MedicineOutStoreDetail> Details = new List <CommContracts.MedicineOutStoreDetail>();

            foreach (var tem in list)
            {
                CommContracts.MedicineOutStoreDetail detail = new CommContracts.MedicineOutStoreDetail();
                detail.Num                    = tem.SingleDose;
                detail.SellPrice              = tem.SellPrice;
                detail.StorePrice             = tem.StockPrice;
                detail.StoreRoomMedicineNumID = tem.StoreRoomNumID;
                detail.SellPrice              = tem.SellPrice;
                detail.StorePrice             = tem.StockPrice;

                Details.Add(detail);
            }
            return(Details);
        }
Example #2
0
        private List <CommContracts.MaterialCheckStoreDetail> GetDetails()
        {
            List <MyDetail> list = myTableEdit.GetAllDetails();
            List <CommContracts.MaterialCheckStoreDetail> Details = new List <CommContracts.MaterialCheckStoreDetail>();

            foreach (var tem in list)
            {
                CommContracts.MaterialCheckStoreDetail detail = new CommContracts.MaterialCheckStoreDetail();
                detail.Num        = tem.SingleDose;
                detail.SellPrice  = tem.SellPrice;
                detail.StorePrice = tem.StockPrice;
                //detail.Batch = tem.BatchID;
                //detail.ExpirationDate = tem.ExpirationDate;
                //detail.MaterialID = tem.ID;
                detail.StoreRoomMaterialNumID = tem.StoreRoomNumID;

                Details.Add(detail);
            }
            return(Details);
        }
        private void SaveBtn_Click(object sender, RoutedEventArgs e)
        {
            List <MyDetail> listDetail = myTableEdit.GetAllDetails();
            List <CommContracts.TherapyDoctorAdviceDetail> list = new List <CommContracts.TherapyDoctorAdviceDetail>();
            decimal sum = 0.0m;

            foreach (var tem in listDetail)
            {
                CommContracts.TherapyDoctorAdviceDetail recipeDetail = new CommContracts.TherapyDoctorAdviceDetail();
                recipeDetail.TherapyID = tem.ID;
                recipeDetail.AllNum    = tem.SingleDose;
                recipeDetail.Remarks   = tem.Illustration;
                list.Add(recipeDetail);
                sum += tem.SellPrice * tem.SingleDose;
            }

            CommContracts.TherapyDoctorAdvice therapyDoctorAdvice = new CommContracts.TherapyDoctorAdvice();

            var vm = this.DataContext as HISGUIDoctorVM;

            if (vm.IsClinicOrInHospital)
            {
                if (vm.CurrentRegistration != null)
                {
                    therapyDoctorAdvice.RegistrationID = vm.CurrentRegistration.ID;
                    therapyDoctorAdvice.PatientID      = vm.CurrentRegistration.PatientID;
                }
            }
            else
            {
                if (vm.CurrentInHospital != null)
                {
                    therapyDoctorAdvice.InpatientID = vm.CurrentInHospital.ID;
                    therapyDoctorAdvice.PatientID   = vm.CurrentInHospital.PatientID;
                }
            }
            therapyDoctorAdvice.SumOfMoney = sum;
            therapyDoctorAdvice.WriteTime  = DateTime.Now;
            if (vm.CurrentUser != null)
            {
                therapyDoctorAdvice.WriteDoctorUserID = vm.CurrentUser.ID;
            }

            therapyDoctorAdvice.TherapyDoctorAdviceDetails = list;

            bool?saveResult = vm?.SaveTherapyDoctorAdvice(therapyDoctorAdvice);


            if (!saveResult.HasValue)
            {
                MessageBox.Show("保存失败!");
                return;
            }
            else if ((bool)saveResult.Value)
            {
                MessageBox.Show("保存成功!");
                newTherapy();
                getAllTherapyList();
            }
            else
            {
                MessageBox.Show("保存失败!");
                return;
            }
        }
Example #4
0
        private void SaveBtn_Click(object sender, RoutedEventArgs e)
        {
            List <MyDetail> listDetail = new List <MyDetail>();

            CommContracts.DoctorAdviceContentEnum doctorAdviceContentEnum = CommContracts.DoctorAdviceContentEnum.西药成药;
            if (this.tabControl.SelectedIndex == 0)
            {
                listDetail = myXiChengTableEdit.GetAllDetails();
                doctorAdviceContentEnum = CommContracts.DoctorAdviceContentEnum.西药成药;
            }
            else if (this.tabControl.SelectedIndex == 1)
            {
                listDetail = myZhongTableEdit.GetAllDetails();
                doctorAdviceContentEnum = CommContracts.DoctorAdviceContentEnum.中药;
            }

            List <CommContracts.MedicineDoctorAdviceDetail> list = new List <CommContracts.MedicineDoctorAdviceDetail>();
            decimal sum = 0.0m;

            foreach (var tem in listDetail)
            {
                CommContracts.MedicineDoctorAdviceDetail doctorAdviceDetail = new CommContracts.MedicineDoctorAdviceDetail();
                //doctorAdviceDetail.GroupNum = tem.GroupNum;
                doctorAdviceDetail.MedicineID = tem.ID;
                doctorAdviceDetail.AllNum     = tem.SingleDose;
                //doctorAdviceDetail.Usage = tem.Usage;
                //doctorAdviceDetail.DDDS = tem.DDDS;
                //doctorAdviceDetail.DaysNum = tem.DaysNum;
                //doctorAdviceDetail.IntegralDose = tem.IntegralDose;
                doctorAdviceDetail.Remarks = tem.Illustration;

                list.Add(doctorAdviceDetail);

                sum += tem.SellPrice * tem.SingleDose;
            }

            CommContracts.MedicineDoctorAdvice medicineDoctorAdvice = new CommContracts.MedicineDoctorAdvice();

            var vm = this.DataContext as HISGUIDoctorVM;

            medicineDoctorAdvice.RecipeContentEnum = doctorAdviceContentEnum;
            medicineDoctorAdvice.ChargeStatusEnum  = CommContracts.ChargeStatusEnum.未收费;
            if (vm.IsClinicOrInHospital)
            {
                if (vm.CurrentRegistration != null)
                {
                    medicineDoctorAdvice.RegistrationID = vm.CurrentRegistration.ID;
                    medicineDoctorAdvice.PatientID      = vm.CurrentRegistration.PatientID;
                }
            }
            else
            {
                if (vm.CurrentInHospital != null)
                {
                    medicineDoctorAdvice.InpatientID = vm.CurrentInHospital.ID;
                    medicineDoctorAdvice.PatientID   = vm.CurrentInHospital.PatientID;
                }
            }
            medicineDoctorAdvice.SumOfMoney = sum;
            medicineDoctorAdvice.WriteTime  = DateTime.Now;
            if (vm.CurrentUser != null)
            {
                medicineDoctorAdvice.WriteDoctorUserID = vm.CurrentUser.ID;
            }

            medicineDoctorAdvice.MedicineDoctorAdviceDetails = list;


            bool?saveResult = vm?.SaveMedicineDoctorAdvice(medicineDoctorAdvice);

            if (!saveResult.HasValue)
            {
                MessageBox.Show("保存失败!");
                return;
            }
            else if ((bool)saveResult.Value)
            {
                MessageBox.Show("保存成功!");
                newDoctorAdvice();
                getDoctorAdviceList();
            }
            else
            {
                MessageBox.Show("保存失败!");
                return;
            }
        }