Esempio n. 1
0
        void dataGridView2_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (this.dataGridView2.Columns[e.ColumnIndex].Name == this.Column22.Name)
            {
                return;
            }

            this.ClearCurrent();
            this.FStatus.FStatus = FormStatusEnum.Edit;
            Business.Models.DirectSalesModel dsom = this.dataGridView2.Rows[e.RowIndex].DataBoundItem as Business.Models.DirectSalesModel;

            var dsod = this.PharmacyDatabaseService.GetDirectSalesOrderDetailModelByDirectSalesModel(dsom.DirectSalesOrderId, out msg);

            dsod.ToList <Business.Models.DirectSalesOrderDetailModel>().ForEach(r => { this._ListDirectSalesDetail.Add(r); });
            this.label2.Text       = dsom.SupplyUnitName;
            this.label5.Text       = dsom.PurchaseUnitName;
            this.textBox4.Text     = dsom.Checker;
            this.richTextBox1.Text = dsom.Memo;
            this._SupplyUnit       = this.PharmacyDatabaseService.GetSupplyUnit(out msg, dsom.SupplyUnitId);
            this._PurchaseUnit     = this.PharmacyDatabaseService.GetPurchaseUnit(out msg, dsom.PurchaseUnitId);
            this.dsOrder           = this.PharmacyDatabaseService.GetDirectSalesOrder(dsom.DirectSalesOrderId, out msg);

            this._Id = dsom.DirectSalesOrderId;
            this.dataGridView1.Refresh();
        }
Esempio n. 2
0
        void textBox1_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode != Keys.Return)
            {
                return;
            }

            using (Form_SupplyUnits frm = new Form_SupplyUnits(this.textBox1.Text.Trim()))
            {
                if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    this.label2.Text = frm._SU.Name;
                    this._SupplyUnit = frm._SU;
                }
            }
        }
Esempio n. 3
0
 private void ClearCurrent()
 {
     this.dsOrder = null;
     this._Id     = Guid.NewGuid();
     this._ListDirectSalesDetail.Clear();
     this.FStatus.FStatus   = FormStatusEnum.New;
     this._PurchaseUnit     = null;
     this._SupplyUnit       = null;
     this.textBox1.Text     = this.textBox2.Text = this.textBox3.Text = string.Empty;
     this.textBox4.Text     = this.textBox5.Text = string.Empty;
     this.label5.Text       = this.label2.Text = "无";
     this.label6.Text       = "地址:";
     this.label7.Text       = "联系电话:";
     this.label10.Text      = "负责人:";
     this.label11.Text      = "企业法人:";
     this.richTextBox1.Text = string.Empty;
     this.GetDirectSalesOrderUnapproved();
     this.dataGridView1.Refresh();
 }
Esempio n. 4
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);
        }
Esempio n. 5
0
 void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     _SU = this.dataGridView1.Rows[e.RowIndex].DataBoundItem as Models.SupplyUnit;
     this.DialogResult = System.Windows.Forms.DialogResult.OK;
     this.Close();
 }