/// <summary>
        /// 结束操作,包括主动提交和长时间未操作界面被动提交
        /// </summary>
        /// <param name="bExit">退出登陆还是回到首页</param>
        /// <param name="bAutoSubmit">是否是主动提交</param>
        private void EndOperation(bool bExit, bool bAutoSubmit = true)
        {
            if (isSuccess)
            {
                LoadingDataEvent(this, true);
                BasePostData <CommodityInventoryChange> bdBasePostData =
                    ConsumingBll.GetInstance().SubmitConsumingChangeWithOrder(bdCommodityCode, fetchParam.bdConsumingOrder.body.objects[0]);
                LoadingDataEvent(this, false);

                //校验是否含有数据
                HttpHelper.GetInstance().ResultCheck(bdBasePostData, out bool isSuccess1);

                if (!isSuccess1 && bAutoSubmit)
                {
                    MessageBox.Show("提交结果失败!" + bdBasePostData.message, "温馨提示", MessageBoxButton.OK);
                }

                ConsumingBll.GetInstance().InsertLocalCommodityCodeInfo(bdCommodityCode, "SurgeryConsumingOrder");
            }

            ApplicationState.SetGoodsInfo(after);

            //主动提交,需要发送退出事件
            if (bAutoSubmit)
            {
                EnterPopCloseEvent(this, bExit);
            }
        }
        /// <summary>
        /// 加载数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void onInitData(object sender, ElapsedEventArgs e)
        {
            App.Current.Dispatcher.Invoke((Action)(() =>
            {
                HashSet <CommodityEps> before = ApplicationState.GetGoodsInfo();

                LoadingDataEvent(this, true);
                List <CommodityCode> commodityCodeList = CommodityCodeBll.GetInstance().GetCompareSimpleCommodity(before, after);
                LoadingDataEvent(this, false);

                if (commodityCodeList == null || commodityCodeList.Count <= 0)
                {
                    MessageBox.Show("没有检测到商品变化!", "温馨提示", MessageBoxButton.OK);
                    isSuccess = false;
                    return;
                }

                LoadingDataEvent(this, true);
                bdCommodityCode = CommodityCodeBll.GetInstance().GetCommodityCode(commodityCodeList);
                HttpHelper.GetInstance().ResultCheck(bdCommodityCode, out isSuccess);
                if (isSuccess)
                {
                    bdCommodityCode = CommodityCodeBll.GetInstance().GetQualityStatus(bdCommodityCode, out isSuccess);
                }
                LoadingDataEvent(this, false);

                //校验是否含有数据
                HttpHelper.GetInstance().ResultCheck(bdCommodityCode, out isSuccess);

                if (!isSuccess)
                {
                    MessageBox.Show("获取商品比较信息错误!" + bdCommodityCode.message, "温馨提示", MessageBoxButton.OK);
                    return;
                }
                ConsumingBll.GetInstance().GetOperationOrderChangeWithOrder(bdCommodityCode, fetchParam.bdConsumingOrder.body.objects[0], fetchParam.bdOperationOrderGoodsDetail);

                listView1.DataContext = bdCommodityCode.body.objects;

                outNum.Content = bdCommodityCode.body.objects.Where(item => item.operate_type == 0).Count();                                         //领用数
                abnormalInNum.Content = bdCommodityCode.body.objects.Where(item => item.operate_type == 1).Count();                                  //异常入库
                abnormalOutNum.Content = bdCommodityCode.body.objects.Where(item => item.operate_type == 0 && item.AbnormalDisplay == "异常").Count(); //异常出库

                //领用产品上包含过期商品不让用户主动提交
                if (bdCommodityCode.body.objects.Where(item => item.operate_type == 0 && (item.QualityStatus == QualityStatusType.过期.ToString() || item.InventoryStatus == CommodityInventoryChangeStatus.待回收.ToString())).Count() == 0)
                {
                    normalBtmView.Visibility = Visibility.Visible;
                    abnormalBtmView.Visibility = Visibility.Collapsed;
                }
                else
                {
                    normalBtmView.Visibility = Visibility.Collapsed;
                    abnormalBtmView.Visibility = Visibility.Visible;
                }
            }));
        }
        /// <summary>
        /// 结束操作,包括主动提交和长时间未操作界面被动提交
        /// </summary>
        /// <param name="bExit">退出登陆还是回到首页</param>
        /// <param name="bAutoSubmit">是否是主动提交</param>
        private void EndOperation(bool bExit, bool bAutoSubmit = true)
        {
            if (isSuccess)
            {
                LoadingDataEvent(this, true);
                BasePostData <CommodityInventoryChange> basePostData = PickBll.GetInstance().CreatePickTaskCommodityInventoryChange(bdCommodityCode, pickTask, bAutoSubmit);
                LoadingDataEvent(this, false);

                HttpHelper.GetInstance().ResultCheck(basePostData, out bool isSuccess1);

                if (!isSuccess1)
                {
                    if (bAutoSubmit)
                    {
                        MessageBox.Show("创建取货任务单库存明细失败!" + basePostData.message, "温馨提示", MessageBoxButton.OK);
                    }
                }
                else
                {
                    if (!bAutoSubmit)
                    {
                        pickTask.BillStatus = DocumentStatus.异常.ToString();
                    }

                    pickTask.BillStatus = abnormalOptions.GetAbnormal();

                    LoadingDataEvent(this, true);
                    BasePutData <PickTask> putData = PickBll.GetInstance().PutPickTask(pickTask);
                    LoadingDataEvent(this, false);

                    HttpHelper.GetInstance().ResultCheck(putData, out bool isSuccess2);

                    if (!isSuccess2 && bAutoSubmit)
                    {
                        MessageBox.Show("更新取货任务单失败!" + putData.message, "温馨提示", MessageBoxButton.OK);
                    }
                }

                ConsumingBll.GetInstance().InsertLocalCommodityCodeInfo(bdCommodityCode, "PickTask");
            }

            ApplicationState.SetGoodsInfo(after);
            if (bAutoSubmit)
            {
                EnterPopCloseEvent(this, bExit);
            }
        }
Esempio n. 4
0
        public void ConsumingQueryOrderTestMethod()
        {
            //根据通过【领⽤用单码】从表格 【领⽤用单】中查询获取领⽤用单的id,以及markId(作废标识)。(如果领⽤用单作废标识为【是】则弹窗提醒⼿手术单作废,跳转回前⻚页)
            //var temp = ConsumingBll.GetInstance().GetConsumingOrder("456465412321");
            //LogUtils.Debug(temp.body.objects[0].id);

            /*            var id = "AQACQqweDg8BAAAAlQ6o8NWbsxUtQwQA";*//*
             * //通过【关联领⽤用单】(ConsumingOrder.id= ConsumingGoodsDetail.ConsumingOrderId)从表格 【领⽤用商品明细】中查询获取领⽤用商品的列列表信息。
             * var lists = ConsumingBll.GetInstance().GetOperationOrderGoodsDetail(temp);
             * LogUtils.Debug(lists);
             * //通过【商品编码】从表格【商品库存管理理】中查询商品详情获得商品名称。
             * var details = ConsumingBll.GetInstance().GetPrescriptionOrderGoodsDetail(temp);
             * LogUtils.Debug(details);
             */
            //根据医嘱处方名称获取医嘱处方信息
            var temp2 = ConsumingBll.GetInstance().GetPrescriptionBill("456465412321");

            LogUtils.Debug(temp2.body.objects[0]);
        }
        /// <summary>
        /// 结束操作,包括主动提交和长时间未操作界面被动提交
        /// </summary>
        /// <param name="bExit">退出登陆还是回到首页</param>
        /// <param name="bAutoSubmit">是否是主动提交</param>
        private void EndOperation(bool bExit, bool bAutoSubmit = true)
        {
            if (isSuccess)
            {
                LoadingDataEvent(this, true);
                BasePostData <CommodityInventoryChange> basePostData = AllotShelfBll.GetInstance().SubmitAllotShelfChangeWithOrder(bdCommodityCode, allotShelf, bdCommodityDetail);
                LoadingDataEvent(this, false);

                HttpHelper.GetInstance().ResultCheck(basePostData, out bool isSuccess1);

                if (!isSuccess1)
                {
                    if (bAutoSubmit)
                    {
                        MessageBox.Show("创建调拨上架任务单库存明细失败!" + basePostData.message, "温馨提示", MessageBoxButton.OK);
                    }
                }
                else
                {
                    allotShelf.AbnormalCauses = abnormalOptions.GetAbnormal().ToString();

                    LoadingDataEvent(this, true);
                    BasePutData <AllotShelf> putData = AllotShelfBll.GetInstance().PutAllotShelf(allotShelf);
                    LoadingDataEvent(this, false);

                    HttpHelper.GetInstance().ResultCheck(putData, out bool isSuccess2);

                    if (!isSuccess2 && bAutoSubmit)
                    {
                        MessageBox.Show("更新挑拨上架任务单失败!" + putData.message, "温馨提示", MessageBoxButton.OK);
                    }
                }
            }

            ConsumingBll.GetInstance().InsertLocalCommodityCodeInfo(bdCommodityCode, "AllotShelf");

            ApplicationState.SetGoodsInfo(after);
            if (bAutoSubmit)
            {
                EnterPopCloseEvent(this, bExit);
            }
        }
Esempio n. 6
0
        public Stock()
        {
            InitializeComponent();

            List <String> names = ConsumingBll.GetInstance().GetLocalCommodityName();

            comboBoxList2.Add(new LocalCommodityCode {
                name = "全部"
            });
            names.ForEach(item => {
                comboBoxList2.Add(new LocalCommodityCode {
                    name = item
                });
            });

            iniTimer           = new Timer(100);
            iniTimer.AutoReset = false;
            iniTimer.Enabled   = true;
            iniTimer.Elapsed  += new ElapsedEventHandler(onInitData);
        }
Esempio n. 7
0
        public void ConsumingPostOrderTestMethod()
        {
            //测试移动端 创建【领用单】,且领⽤用状态为 ‘已完成’。
            var temp = ConsumingBll.GetInstance().CreateConsumingOrder(new ConsumingOrder()
            {
                FinishDate   = "2019-07-23T09:31:00Z",              //完成时间
                Status       = ConsumingOrderStatus.已完成.ToString(), //领用状态
                StoreHouseId = null,                                //领用库房【暂未知数据来源】
                Type         = ConsumingOrderType.一般领用.ToString()
            });

            LogUtils.Debug(temp);
            //移动端 通过【领⽤用单编号】 查找更更新【领⽤用单】的领⽤用状态为 ‘已完成’

            var puttemp = ConsumingBll.GetInstance().UpdateConsumingOrderStatus(new ConsumingOrder()
            {
                id      = "AQACQqweDg8BAAAAv0_s8_fnsxXXagQA",
                Status  = ConsumingOrderStatus.未领用.ToString(),
                version = 4//必须和当前数据版本保持一致
            });

            LogUtils.Debug(puttemp);
        }
        /// <summary>
        /// 结束操作,包括主动提交和长时间未操作界面被动提交
        /// </summary>
        /// <param name="bExit">退出登陆还是回到首页</param>
        /// <param name="bAutoSubmit">是否是主动提交</param>
        private void EndOperation(bool bExit, bool bAutoSubmit = true)
        {
            if (isSuccess)
            {
                if (commodityRecovery == null)
                {
                    LoadingDataEvent(this, true);
                    BasePostData <CommodityInventoryChange> bdCommodityInventoryChange = CommodityInventoryChangeBll.GetInstance().CreateCommodityInventoryChangeInStockChange(bdCommodityCode);
                    LoadingDataEvent(this, false);

                    if (bdCommodityInventoryChange.code != 0)
                    {
                        MessageBox.Show("创建库存调整商品变更明细失败!" + bdCommodityInventoryChange.message, "温馨提示", MessageBoxButton.OK);
                    }

                    ConsumingBll.GetInstance().InsertLocalCommodityCodeInfo(bdCommodityCode, "IntentoryAdjust");
                }
                else
                {
                    LoadingDataEvent(this, true);
                    BasePostData <CommodityInventoryChange> bdCommodityInventoryChange = CommodityInventoryChangeBll.GetInstance().CreateCommodityInventoryChange(bdCommodityCode, commodityRecovery, bAutoSubmit);
                    LoadingDataEvent(this, false);

                    if (bdCommodityInventoryChange.code != 0)
                    {
                        MessageBox.Show("创建库存调整商品变更明细失败!" + bdCommodityInventoryChange.message, "温馨提示", MessageBoxButton.OK);
                    }

                    ConsumingBll.GetInstance().InsertLocalCommodityCodeInfo(bdCommodityCode, "CommodityRecovery");
                }
            }

            ApplicationState.SetGoodsInfo(after);

            EnterPopCloseEvent(this, bExit);
        }
Esempio n. 9
0
        protected override void OnStartup(StartupEventArgs e)
        {
            ProgramStarted = new EventWaitHandle(false, EventResetMode.AutoReset, "乘法云链", out bool createNew);

            if (!createNew)
            {
                MessageBox.Show("已有一个程序实例运行");
                Current.Shutdown();
                Environment.Exit(0);
            }

            base.OnStartup(e);

            //控制台信息展示
            ConsoleManager.Show();

            Console.ReadKey();

            // 注册Application_Error(全局捕捉异常)
            DispatcherUnhandledException += new DispatcherUnhandledExceptionEventHandler(App_DispatcherUnhandledException);

            //初始化日志
            LogUtils.InitLog4Net();

            //隐藏工具类
            Taskbar.HideTask(true);

            //开启启动
            BootUpHelper.GetInstance().SetMeAutoStart();

            //加载系统配置文件
            //Console.ReadKey();
            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.Load($"{ApplicationState.GetProjectRootPath()}/MyProject.xml");
            XmlNode root   = xmlDoc.SelectSingleNode("config");          //指向根节点
            XmlNode device = root.SelectSingleNode("device");            //指向设备节点

            ApplicationState.SetUserInfo(new User());
            //设置初始化goodsInfo
            ApplicationState.SetInitGoodsInfo(new HashSet <CommodityEps>());

            ApplicationState.SetEquipName(device.SelectSingleNode("equip_name").InnerText);
            ApplicationState.SetEquipId(device.SelectSingleNode("equip_id").InnerText);

            ApplicationState.SetHouseName(device.SelectSingleNode("house_name").InnerText);
            ApplicationState.SetHouseId(device.SelectSingleNode("house_id").InnerText);

            ApplicationState.SetMCabName(device.SelectSingleNode("mcab_name").InnerText);
            ApplicationState.SetMCabId(device.SelectSingleNode("mcab_id").InnerText);
#if DUALCAB
            ApplicationState.SetSCabName(device.SelectSingleNode("scab_name").InnerText);
            ApplicationState.SetSCabId(device.SelectSingleNode("scab_id").InnerText);
#endif
            ApplicationState.SetMLockerCOM(device.SelectSingleNode("mlocker_com").InnerText);         //"COM2"
            ApplicationState.SetSLockerCOM(device.SelectSingleNode("slocker_com").InnerText);         //"COM5"

            ApplicationState.SetMRfidCOM(device.SelectSingleNode("mrfid_com").InnerText);             //"COM1"
            ApplicationState.SetSRfidCOM(device.SelectSingleNode("srfid_com").InnerText);             //"COM4"

            ApplicationState.SetMVeinCOM(device.SelectSingleNode("mvein_com").InnerText);             //"COM9"

            LogUtils.Debug("App config initial...");

            #region 处理开机(即应用启动时)需要对比库存变化上传的逻辑

            //获取当前机柜所有商品数据
            HashSet <CommodityEps> currentCommodityEps = RfidHelper.GetEpcDataJson(out bool isGetSuccess);

            //判断是否是初次使用本地库存上次,如果是则不上传
            bool isInitLocalCommodityEpsInfo = CommodityCodeBll.GetInstance().isInitLocalCommodityEpsInfo();

            if (isGetSuccess && !isInitLocalCommodityEpsInfo)
            {
                //获取数据库记录的以前所有商品数据
                HashSet <CommodityEps> lastCommodityEps = CommodityCodeBll.GetInstance().GetLastLocalCommodityEpsInfo();

                //比对
                List <CommodityCode> commodityCodeList = CommodityCodeBll.GetInstance().GetCompareSimpleCommodity(lastCommodityEps, currentCommodityEps);

                //有不同的情况,则需要处理上传逻辑
                if (commodityCodeList != null && commodityCodeList.Count > 0)
                {
                    //根据商品码集合获取完整商品属性集合(已对比后结果)
                    var bdCommodityCodeList = CommodityCodeBll.GetInstance().GetCommodityCode(commodityCodeList);

                    var checkbdCommodityCodeList = HttpHelper.GetInstance().ResultCheck(bdCommodityCodeList, out bool isSuccess);

                    if (isSuccess)
                    {
                        //按照类似无单一般领用的方式(故障领用)
                        var bdBasePostData = ConsumingBll.GetInstance().SubmitConsumingChangeWithoutOrder(bdCommodityCodeList, ConsumingOrderType.故障领用);

                        //校验是否含有数据
                        HttpHelper.GetInstance().ResultCheck(bdBasePostData, out bool isSuccess1);
                        if (!isSuccess1)
                        {
                            LogUtils.Error("提交故障领用结果失败!" + bdBasePostData.message);
                        }
                        else
                        {
                            LogUtils.Info("提交故障领用结果成功!" + bdBasePostData.message);
                        }
                    }
                    else
                    {
                        LogUtils.Info("提交故障领用结果成功!");
                    }
                }
            }

            #endregion
        }
Esempio n. 10
0
        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void queryData(object sender, RoutedEventArgs e)
        {
            if (this.stockSnapshot.IsChecked == true)//库存快照
            {
                List <Commodity> list = listViewData;

                if ((Commodity)goods_name.SelectedValue != null)
                {
                    if (((Commodity)goods_name.SelectedValue).name != "全部")
                    {
                        list = listViewData.Where(item => item.name == ((Commodity)goods_name.SelectedValue).name).ToList();
                    }
                }

                listView.DataContext = list;
                totalNum.Content     = list.Sum(item => item.Count);
            }
            if (this.validity.IsChecked == true)//效期查询
            {
                List <CommodityCode> list = listView1Data;

                if ((Commodity)goods_name.SelectedValue != null)
                {
                    if (((Commodity)goods_name.SelectedValue).name != "全部")
                    {
                        list = listView1Data.Where(item => item.CommodityName == ((Commodity)goods_name.SelectedValue).name).ToList();
                    }
                }

                if (goods_code.Text != "")
                {
                    list = list.Where(item => item.name.Contains(goods_code.Text)).ToList();
                }

                if (single1.IsChecked == true)
                {
                    list = list.Where(item => item.ExpirationDate < DateTime.Now.AddMonths(1)).ToList();
                }
                if (single2.IsChecked == true)
                {
                    list = list.Where(item => item.ExpirationDate < DateTime.Now.AddMonths(2)).ToList();
                }
                if (single3.IsChecked == true)
                {
                    list = list.Where(item => item.ExpirationDate < DateTime.Now.AddMonths(3)).ToList();
                }

                listView1.DataContext = list;
            }
            else if (this.stock.IsChecked == true)//库存查询
            {
                InventoryChangesApo pageDataApo = new InventoryChangesApo();

                if (this.outStock.IsChecked == true)
                {
                    pageDataApo.operate_type = 0;
                }
                else if (this.inStock.IsChecked == true)
                {
                    pageDataApo.operate_type = 1;
                }
                if (!string.IsNullOrEmpty(startTime.Text) && !string.IsNullOrWhiteSpace(startTime.Text))
                {
                    pageDataApo.startTime = Convert.ToDateTime(startTime.Text);
                }

                if (!string.IsNullOrEmpty(endTime.Text) && !string.IsNullOrWhiteSpace(endTime.Text))
                {
                    DateTime time = Convert.ToDateTime(endTime.Text.Replace("0:00:00", "23:59:59"));
                    pageDataApo.endTime = new DateTime(time.Year, time.Month, time.Day, 23, 59, 59);
                }

                if ((LocalCommodityCode)goods_name.SelectedValue != null)
                {
                    if (((LocalCommodityCode)goods_name.SelectedValue).name != "全部")
                    {
                        pageDataApo.name = ((LocalCommodityCode)goods_name.SelectedValue).name;
                    }
                }

                List <LocalCommodityCode> list = ConsumingBll.GetInstance().GetLocalCommodityCodeChange(pageDataApo, out int count);

                listView2.DataContext = list;
            }
        }
        private void onSave(object sender, RoutedEventArgs e)
        {
            ApplicationState.SetEquipName(tbEquipName.Text.ToString());
            ApplicationState.SetHouseName(tbHouseName.Text.ToString());

            ApplicationState.SetMCabName(tbMCabName.Text.ToString());
#if DUALCAB
            ApplicationState.SetSCabName(tbSCabName.Text.ToString());
#endif

            ApplicationState.SetMLockerCOM(MLockerCB.SelectedItem.ToString());
#if DUALCAB
            ApplicationState.SetSLockerCOM(SLockerCB.SelectedItem.ToString());
#endif

            ApplicationState.SetMRfidCOM(MrfidCB.SelectedItem.ToString());
#if DUALCAB
            ApplicationState.SetSRfidCOM(SrfidCB.SelectedItem.ToString());
#endif

            ApplicationState.SetMVeinCOM(MVeinCB.SelectedItem.ToString());

            //xml文件回写
            XmlDocument xmlDoc  = new XmlDocument();
            string      xmlPath = $"{ApplicationState.GetProjectRootPath()}/MyProject.xml";
            xmlDoc.Load(xmlPath);
            XmlNode root   = xmlDoc.SelectSingleNode("config");          //指向根节点
            XmlNode device = root.SelectSingleNode("device");            //指向设备节点

            device.SelectSingleNode("equip_name").InnerText = tbEquipName.Text.ToString();
            device.SelectSingleNode("house_name").InnerText = tbHouseName.Text.ToString();
            device.SelectSingleNode("mcab_name").InnerText  = tbMCabName.Text.ToString();
#if DUALCAB
            device.SelectSingleNode("scab_name").InnerText = tbSCabName.Text.ToString();
#endif
            device.SelectSingleNode("mlocker_com").InnerText = MLockerCB.SelectedItem.ToString();
#if DUALCAB
            device.SelectSingleNode("slocker_com").InnerText = SLockerCB.SelectedItem.ToString();
#endif
            device.SelectSingleNode("mrfid_com").InnerText = MrfidCB.SelectedItem.ToString();
#if DUALCAB
            device.SelectSingleNode("srfid_com").InnerText = SrfidCB.SelectedItem.ToString();
#endif
            device.SelectSingleNode("mvein_com").InnerText = MVeinCB.SelectedItem.ToString();

            //获取线上id
            BaseData <string> bdEquip = ConsumingBll.GetInstance().GetIdByName <Equipment>(tbEquipName.Text.ToString());
            BaseData <string> bdHouse = ConsumingBll.GetInstance().GetIdByStoreHouseCode <StoreHouse>(tbHouseName.Text.ToString());
            BaseData <string> bdMCab  = ConsumingBll.GetInstance().GetIdByName <GoodsLocation>(tbMCabName.Text.ToString());
#if DUALCAB
            BaseData <string> bdSCab = ConsumingBll.GetInstance().GetIdByName <Equipment>(tbSCabName.Text.ToString());
#endif

            string err = "无法获取";


            if (bdEquip.code == 0)
            {
                ApplicationState.SetEquipId(bdEquip.body.objects[0]);
                device.SelectSingleNode("equip_id").InnerText = bdEquip.body.objects[0];
            }
            else
            {
                err += "设备ID、" + bdEquip.message;
            }

            if (bdHouse.code == 0)
            {
                ApplicationState.SetHouseId(bdHouse.body.objects[0]);
                device.SelectSingleNode("house_id").InnerText = bdHouse.body.objects[0];
            }
            else
            {
                err += "库房ID、" + bdHouse.message;
            }

            if (bdMCab.code == 0)
            {
                ApplicationState.SetMCabId(bdMCab.body.objects[0]);
                device.SelectSingleNode("mcab_id").InnerText = bdMCab.body.objects[0];
            }
            else
            {
                err += "主货架ID、" + bdMCab.message;
            }

#if DUALCAB
            if (bdSCab.code == 0)
            {
                ApplicationState.SetSCabId(bdSCab.body.objects[0]);
                device.SelectSingleNode("scab_id").InnerText = bdSCab.body.objects[0];
            }
            else
            {
                err += "副货架ID、" + bdSCab.message;
            }
#endif
            if (err != "无法获取")
            {
                MessageBox.Show(err.Remove(err.Length - 1) + "!", "温馨提示", MessageBoxButton.OK);
            }
            else
            {
                MessageBox.Show("保存成功!", "温馨提示", MessageBoxButton.OK);
            }

            //节点修改值保存
            xmlDoc.Save(xmlPath);
        }
Esempio n. 12
0
        /// <summary>
        /// 处理输入事件
        /// </summary>
        /// <returns></returns>
        private bool HandleEnterDetail()
        {
            var inputStr = tbInputCode.Text;

            if (string.IsNullOrWhiteSpace(inputStr))
            {
                MessageBox.Show("单号不可以为空!", "温馨提示", MessageBoxButton.OK);
                return(false);
            }

            TaskOrder taskOrder;
            string    name;

            try
            {
                taskOrder = JsonConvert.DeserializeObject <TaskOrder>(inputStr);
                name      = taskOrder.name;
            }
            catch
            {
                name = inputStr;
            }

            if (consumingOrderType != ConsumingOrderType.医嘱处方领用)
            {
                FetchParam fetchParam = new FetchParam();
                LoadingDataEvent(this, true);
                fetchParam.bdConsumingOrder = ConsumingBll.GetInstance().GetConsumingOrder(name.ToUpper());
                LoadingDataEvent(this, false);

                //校验是否含有数据
                HttpHelper.GetInstance().ResultCheck(fetchParam.bdConsumingOrder, out bool isSuccess);
                if (!isSuccess)
                {
                    MessageBox.Show("无法获取领用单详情!" + fetchParam.bdConsumingOrder.message, "温馨提示", MessageBoxButton.OK);
                    return(false);
                }

                LoadingDataEvent(this, true);
                fetchParam.bdOperationOrderGoodsDetail = ConsumingBll.GetInstance().GetOperationOrderGoodsDetail(fetchParam.bdConsumingOrder);
                LoadingDataEvent(this, false);

                //校验是否含有数据
                HttpHelper.GetInstance().ResultCheck(fetchParam.bdOperationOrderGoodsDetail, out bool isSuccess1);
                if (!isSuccess1)
                {
                    MessageBox.Show("无法获取手术单物品详情!" + fetchParam.bdOperationOrderGoodsDetail.message, "温馨提示", MessageBoxButton.OK);
                    return(false);
                }

                HashSet <CommodityEps>   hs = ApplicationState.GetGoodsInfo();
                BaseData <CommodityCode> bdCommodityCode = CommodityCodeBll.GetInstance().GetCommodityCode(ApplicationState.GetGoodsInfo());

                ConsumingBll.GetInstance().CombinationStockNum(fetchParam.bdOperationOrderGoodsDetail, bdCommodityCode);

                EnterSurgeryDetailEvent(this, fetchParam);
            }
            else
            {
                LoadingDataEvent(this, true);
                BaseData <PrescriptionBill> baseData = ConsumingBll.GetInstance().GetPrescriptionBill(name);
                LoadingDataEvent(this, false);

                //校验是否含有数据
                HttpHelper.GetInstance().ResultCheck(baseData, out bool isSuccess);

                if (!isSuccess)
                {
                    MessageBox.Show("无法获取处方单!" + baseData.message, "温馨提示", MessageBoxButton.OK);
                    return(false);
                }

                EnterPrescriptionOpenEvent(this, new ConsumingOrder {
                    SourceBill = new SourceBill
                    {
                        object_name = "PrescriptionBill",
                        object_id   = baseData.body.objects[0].id
                    }
                });
            }

            return(true);
        }