Beispiel #1
0
        public FormInInventory()
        {
            InitializeComponent();

            #region 电子标签控制
            this.EleModel = SearialiserHelper <Ele_Lab> .DeSerializeFileToObj("EleSetup.bin");

            if (this.EleModel.IsEnabled)
            {
                this.toolStripButton1.Visible = true;//点亮按钮显示,配置标签后,可以显示
                if (elelab.unart_manage.com_manage.FirstOrDefault() == null)
                {
                    int[] ss = new int[] { int.Parse(this.EleModel.PortName.Substring(3)) };
                    elelab.unart_manage.init_com_sys(ss);//初始化串口
                }
            }
            #endregion

            this.Bcms = new BaseForm.BasicInfoRightMenu(this.dataGridView1);
            this.Bcms.InsertDrugBasicInfo();
            this.Bcms.InsertSupplyUnitBasicInfo();
            this.dataGridView1.RowPostPaint   += delegate(object o, DataGridViewRowPostPaintEventArgs ex) { DataGridViewOperator.SetRowNumber((DataGridView)o, ex); };
            this.dataGridView1.CellMouseClick += new DataGridViewCellMouseEventHandler(dataGridView1_CellMouseClick);
        }
        /// <summary>
        /// 初始化画面
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FormOutInventory_Load(object sender, EventArgs e)
        {
            //提交出库
            this.btnSubmit.Visible = this.Authorize(ModuleKeys.SubmitOutInventoryForOrder);
            //this.toolStripButton1.Visible = this.btnSubmit.Visible;

            //出库审核
            this.tsbtnAccept.Visible = this.Authorize(ModuleKeys.ApprovalOutInventoryForOrder);
            //销退申请
            this.tsbtnOrderReturn.Visible = this.Authorize(ModuleKeys.SubmitOrderReturn);
            //清空现有tab
            tabContorl.TabPages.Clear();

            #region 电子标签控制
            EleModel = SearialiserHelper <Ele_Lab> .DeSerializeFileToObj("EleSetup.bin");

            if (EleModel.IsEnabled)
            {
                this.toolStripButton1.Visible = true;//点亮按钮显示,配置标签后,可以显示
                if (elelab.unart_manage.com_manage.FirstOrDefault() == null)
                {
                    int[] ss = new int[] { int.Parse(EleModel.PortName.Substring(3)) };
                    elelab.unart_manage.init_com_sys(ss);//初始化串口
                }
            }
            #endregion

            string message = string.Empty;
            try
            {
                _salesOrder = PharmacyDatabaseService.GetSalesOrder(out message, _orderID);

                //获取现有的出库信息
                var list = PharmacyDatabaseService.GetOutInventoryByOrderID(out message, _salesOrder.Id);
                if (_outID != Guid.Empty)
                {
                    //此时应该只初始化一个
                    list = list.Where(p => p.Id == _outID).ToArray();
                }

                foreach (var item in list)
                {
                    string tabTitle = string.Empty;
                    if (item.Id != Guid.Empty)
                    {
                        string status = Utility.getEnumTypeDisplayName <OutInventoryStatus>((OutInventoryStatus)item.OutInventoryStatusValue);
                        tabTitle = string.Format("{0}[{1}]", item.CreateTime.ToString("yyyy年MM月dd日"), status);
                    }
                    else
                    {
                        tabTitle = "*新建拣货单";
                    }

                    InitTabPage(0, tabTitle, _salesOrder, item);
                }
            }
            catch (Exception ex)
            {
                Log.Error(ex);
                MessageBox.Show("拣货单窗体加载初始化失败!!!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            tabContorl_SelectedIndexChanged(null, null);
        }