private void GetDrugInfo()
        {
            if (this.dataGridView1.CurrentRow == null)
            {
                return;
            }
            var d = this.dataGridView1.CurrentRow.DataBoundItem as DrugInfo;

            var di = this.PharmacyDatabaseService.GetDrugInfo(out msg, d.Id);

            UI.UserControls.ucGoodsInfo ucControl = new UserControls.ucGoodsInfo(di);
            Form f = new Form();

            f.WindowState   = FormWindowState.Normal;
            f.StartPosition = FormStartPosition.CenterScreen;
            f.Text          = di.ProductGeneralName;
            f.AutoSize      = true;
            f.AutoSizeMode  = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
            Panel p = new Panel();

            p.AutoSize = true;
            p.Controls.Add(ucControl);
            f.Controls.Add(p);
            SetControls.SetControlReadonly(f, true);
            f.ShowDialog();
        }
Example #2
0
        public void OpenDrugInfo()
        {
            var dr = this.dataGridView1.CurrentRow;

            if (dr == null)
            {
                return;
            }

            var  druginfo = dr.DataBoundItem as Business.Models.PurchaseOrderImpt;
            Guid DrugId   = druginfo.DrugInfoId;

            using (BaseFunctionForm bf = new Pharmacy.AppClient.UI.BaseFunctionForm())
            {
                var di = bf.PharmacyDatabaseService.GetDrugInfo(out msg, DrugId);
                if (di == null)
                {
                    return;
                }
                if (di.BusinessScopeCode.Contains("医疗器械"))
                {
                    Forms.BaseDataManage.FormInstrument frm = new BaseDataManage.FormInstrument();
                    frm.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
                    frm.entity        = di;
                    Common.SetControls.SetControlReadonly(frm, true);
                    frm.ShowDialog();
                    return;
                }

                if (di.BusinessScopeCode.Contains("保健食品"))
                {
                    Forms.BaseDataManage.FormFood frm = new BaseDataManage.FormFood();
                    frm.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
                    frm.entity        = di;
                    Common.SetControls.SetControlReadonly(frm, true);
                    frm.ShowDialog();
                    return;
                }

                UI.UserControls.ucGoodsInfo ucControl = new UserControls.ucGoodsInfo(di);
                System.Windows.Forms.Form   f         = new System.Windows.Forms.Form();
                f.WindowState   = System.Windows.Forms.FormWindowState.Normal;
                f.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
                f.Text          = di.ProductGeneralName;
                f.AutoSize      = true;
                f.AutoSizeMode  = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
                System.Windows.Forms.Panel p = new System.Windows.Forms.Panel();
                p.AutoSize = true;
                p.Controls.Add(ucControl);
                f.Controls.Add(p);
                Forms.Common.SetControls.SetControlReadonly(f, true);
                f.ShowDialog();
                f.Dispose();
            }
        }
Example #3
0
        public void GetDrugInfo()
        {
            using (BaseFunctionForm bf = new Pharmacy.AppClient.UI.BaseFunctionForm())
            {
                if (this.DrugId == Guid.Empty && this.DrugInventoryId != Guid.Empty)
                {
                    var div = bf.PharmacyDatabaseService.GetDrugInventoryRecord(out msg, this.DrugInventoryId);
                    this.DrugId = div.DrugInfoId;
                }

                var di = bf.PharmacyDatabaseService.GetDrugInfo(out msg, this.DrugId);
                if (di == null)
                {
                    return;
                }
                if (di.BusinessScopeCode.Contains("医疗器械"))
                {
                    Forms.BaseDataManage.FormInstrument frm = new BaseDataManage.FormInstrument();
                    frm.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
                    frm.entity        = di;
                    Common.SetControls.SetControlReadonly(frm, true);
                    frm.ShowDialog();
                    return;
                }

                if (di.BusinessScopeCode.Contains("保健食品"))
                {
                    Forms.BaseDataManage.FormFood frm = new BaseDataManage.FormFood();
                    frm.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
                    frm.entity        = di;
                    Common.SetControls.SetControlReadonly(frm, true);
                    frm.ShowDialog();
                    return;
                }

                UI.UserControls.ucGoodsInfo ucControl = new UserControls.ucGoodsInfo(di);
                System.Windows.Forms.Form   f         = new System.Windows.Forms.Form();
                f.WindowState   = System.Windows.Forms.FormWindowState.Normal;
                f.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
                f.Text          = di.ProductGeneralName;
                f.AutoSize      = true;
                f.AutoSizeMode  = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
                System.Windows.Forms.Panel p = new System.Windows.Forms.Panel();
                p.AutoSize = true;
                p.Controls.Add(ucControl);
                f.Controls.Add(p);
                Forms.Common.SetControls.SetControlReadonly(f, true);
                f.ShowDialog();
                f.Dispose();
            }
        }
Example #4
0
        //右键菜单事件
        private void GetDrugInfo(int Method)
        {
            if (this.dgvMain.SelectedRows.Count <= 0)
            {
                return;
            }
            var      c  = this.dgvMain.SelectedRows[0].DataBoundItem as Business.Models.DrugInfoModel;
            DrugInfo di = this.PharmacyDatabaseService.GetDrugInfo(out msg, c.id);

            if (di == null)
            {
                return;
            }
            if (Method == 0)
            {
                UI.UserControls.ucGoodsInfo ucControl = new UserControls.ucGoodsInfo(di);
                Form f = new Form();
                f.WindowState   = FormWindowState.Normal;
                f.StartPosition = FormStartPosition.CenterScreen;
                f.Text          = di.ProductGeneralName;
                f.AutoSize      = true;
                f.AutoSizeMode  = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
                Panel p = new Panel();
                p.AutoSize = true;
                p.Controls.Add(ucControl);
                f.Controls.Add(p);
                SetControls.SetControlReadonly(f, true);
                f.ShowDialog();
            }

            if (Method == 1)
            {
                Forms.Approval.FormApprovalFlowCenter form = new Forms.Approval.FormApprovalFlowCenter(di, di.FlowID, false);
                form.ShowDialog();
            }

            if (Method == 2)
            {
                MyExcelUtls.DataGridview2Sheet(this.dgvMain, "已锁定品种信息查询结果");
            }
        }
Example #5
0
        //右键菜单事件
        private void GetDrugInfo(int Method)
        {
            if (this.dataGridView1.SelectedRows.Count <= 0)
            {
                return;
            }
            var      c  = this.dataGridView1.SelectedRows[0].DataBoundItem as Business.Models.DrugInfoModel;
            DrugInfo di = this.PharmacyDatabaseService.GetDrugInfo(out msg, c.id);

            if (di == null)
            {
                return;
            }
            if (Method == 0)
            {
                UI.UserControls.ucGoodsInfo ucControl = new UserControls.ucGoodsInfo(di);
                Form f = new Form();
                f.WindowState   = FormWindowState.Normal;
                f.StartPosition = FormStartPosition.CenterScreen;
                f.Text          = di.ProductGeneralName;
                f.AutoSize      = true;
                f.AutoSizeMode  = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
                Panel p = new Panel();
                p.AutoSize = true;
                p.Controls.Add(ucControl);
                f.Controls.Add(p);
                SetControls.SetControlReadonly(f, true);
                f.ShowDialog();
            }

            if (Method == 1)
            {
                FormApprovalFlowCenter form = new FormApprovalFlowCenter(di, di.FlowID, false);
                form.ShowDialog();
            }

            if (Method == 2)
            {
                MyExcelUtls.DataGridview2Sheet(this.dataGridView1, "品种信息查询结果");
            }

            if (Method == 3)
            {
                var    u = this.dataGridView1.SelectedRows[0].DataBoundItem as Business.Models.DrugInfoModel;
                byte[] b = this.PharmacyDatabaseService.GetUpdateFiles("ApprovalFiles\\9047DBCF-CD15-4904-8786-006A76DD4799").FirstOrDefault().bytes;

                using (System.IO.FileStream fs = new System.IO.FileStream("File", System.IO.FileMode.OpenOrCreate))
                {
                    fs.Write(b, 0, b.Length);
                    fs.Close();
                    CreateWinWord cww = new CreateWinWord();
                    cww.d = u;
                    if (cww.CreateWord(fs.Name, u.ProductGeneralName, 2))
                    {
                        MessageBox.Show(u.ProductGeneralName + ":审批信息表导出成功!");
                        this.PharmacyDatabaseService.WriteLog(BugsBox.Pharmacy.AppClient.Common.AppClientContext.currentUser.Id, "导出首营信息审批表成功!品种名称:" + di.ProductGeneralName);
                    }
                    else
                    {
                        this.PharmacyDatabaseService.WriteLog(BugsBox.Pharmacy.AppClient.Common.AppClientContext.currentUser.Id, "导出首营信息审批表失败!品种名称:" + di.ProductGeneralName);
                    }
                    fs.Dispose();
                }
            }

            if (Method == 4)
            {
                var u = this.dataGridView1.SelectedRows[0].DataBoundItem as Business.Models.DrugInfoModel;

                Form_DrugQualityTrace frm = new Form_DrugQualityTrace(u.id, u.ProductGeneralName);
                frm.ShowDialog();
                frm.Dispose();
            }
        }
Example #6
0
        public FormPurchaseHistoryBySupplyer()
        {
            InitializeComponent();
            this.dataGridView1.AutoGenerateColumns = false;
            this.dataGridView1.RowPostPaint       += delegate(object o, DataGridViewRowPostPaintEventArgs ex) { DataGridViewOperator.SetRowNumber((DataGridView)o, ex); };

            dtpf.Value = DateTime.Now.AddMonths(-3).Date;
            dtpt.Value = DateTime.Now.Date;
            this.toolStrip1.Items.Insert(5, new ToolStripControlHost(dtpf));
            this.toolStrip1.Items.Insert(7, new ToolStripControlHost(dtpt));
            cms = new Pharmacy.UI.Common.BaseRightMenu(this.dataGridView1);
            cms.InsertMenuItem("查询选中供货商", SupplyStatic);

            cms.InsertMenuItem("查看选中供货商资料", delegate()
            {
                var u = this.dataGridView1.CurrentRow.DataBoundItem as Business.Models.SupplyUnitHistoryDrugList;
                Models.SupplyUnit su         = this.PharmacyDatabaseService.GetSupplyUnit(out msg, u.SupplyUnitId);
                UserControls.ucSupplyUnit us = new UserControls.ucSupplyUnit(su, false);
                Form f         = new Form();
                f.Text         = su.Name;
                f.AutoSize     = true;
                f.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
                Panel p        = new Panel();
                p.AutoSize     = true;
                p.Controls.Add(us);
                f.Controls.Add(p);
                f.ShowDialog();
            });

            cms.InsertMenuItem("查看选中品种资料", delegate()
            {
                var u = this.dataGridView1.CurrentRow.DataBoundItem as Business.Models.SupplyUnitHistoryDrugList;
                Models.DrugInfo di = this.PharmacyDatabaseService.GetDrugInfo(out msg, u.DrugInfoId);
                if (di == null)
                {
                    return;
                }

                UI.UserControls.ucGoodsInfo ucControl = new UserControls.ucGoodsInfo(di);
                Form f          = new Form();
                f.WindowState   = FormWindowState.Normal;
                f.StartPosition = FormStartPosition.CenterScreen;
                f.Text          = di.ProductGeneralName;
                f.AutoSize      = true;
                f.AutoSizeMode  = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
                Panel p         = new Panel();
                p.AutoSize      = true;
                p.Controls.Add(ucControl);
                f.Controls.Add(p);
                Forms.Common.SetControls.SetControlReadonly(f, true);
                f.ShowDialog();
            });

            cms.InsertMenuItem("按选中品种批号查询", delegate()
            {
                if (this.ListS.Count > 0)
                {
                    var c = this.dataGridView1.CurrentRow.DataBoundItem as Business.Models.SupplyUnitHistoryDrugList;
                    if (BtchFrm == null || BtchFrm.IsDisposed)
                    {
                        BtchFrm = new Form_FormPurchaseHistoryBySupplyer_Batch(c.batchNumber);
                    }
                    BtchFrm.StartPosition = FormStartPosition.CenterScreen;
                    BtchFrm.TopMost       = true;
                    BtchFrm.Show(this);
                    BtchFrm.GetBatch += (sender, ex) =>
                    {
                        if (ex.IsPrecise)
                        {
                            var qre = this.ListS.Where(r => r.batchNumber == ex.Batch);
                            this.dataGridView1.DataSource = qre.ToList();
                        }
                        else
                        {
                            var qre = this.ListS.Where(r => r.batchNumber.Contains(ex.Batch));
                            this.dataGridView1.DataSource = qre.ToList();
                        }
                    };
                }
            });
            cms.InsertMenuItem("采购品种汇总", DrugStatic);
            cms.InsertMenuItem("全部显示", ShowAll);
            cms.InsertMenuItem("统计该药品购销情况", SupplyAndSale);
            tsmi = new ToolStripMenuItem("打开采购单");
            cms.InsertStripMenuItems(tsmi, InsertDropDownMenuEvt);
            tsmi = new ToolStripMenuItem("打开验收单");
            cms.InsertStripMenuItems_Checking(tsmi, this.InsertDropDownMenuEvt_Checking);
        }