예제 #1
0
        private void Open()
        {
            try
            {
                if (this.dataGridView1.CurrentRow.Index < 0)
                {
                    return;
                }
                int RowIndex = this.dataGridView1.CurrentRow.Index;
                switch (_orderType)
                {
                case OrderType.PurchaseReceivingOrder:
                    PurchaseCommonEntity selectedOrder = (PurchaseCommonEntity)_listPurchaseCommonEntity[RowIndex];
                    FormReceivingOrder   form          = new FormReceivingOrder(selectedOrder, onlySearch);
                    form.ShowDialog();

                    btnSearch_Click(this, null);

                    break;

                case OrderType.PurchaseCheckingOrder:
                    FormCheckOrder formCheckingOrder = new FormCheckOrder((PurchaseCommonEntity)_listPurchaseCommonEntity[RowIndex], onlySearch);
                    formCheckingOrder.ShowDialog();
                    btnSearch_Click(this, null);
                    break;

                case OrderType.PurchaseInInventeryOrder:
                    FormInInventory formInInventory = new FormInInventory((PurchaseCommonEntity)_listPurchaseCommonEntity[RowIndex], onlySearch);
                    formInInventory.ShowDialog();

                    btnSearch_Click(this, null);

                    break;

                case OrderType.PurchaseBillingOrder:
                    FormCashOrder formCashOrder = new FormCashOrder((PurchaseCommonEntity)_listPurchaseCommonEntity[RowIndex]);
                    formCashOrder.ShowDialog();
                    btnSearch_Click(this, null);
                    break;

                case OrderType.PurchaseOrderReturn:
                    FormReturnOrder frm = new FormReturnOrder((PurchaseCommonEntity)_listPurchaseCommonEntity[RowIndex], false);
                    frm.ShowDialog();
                    if (frm.DialogResult == System.Windows.Forms.DialogResult.OK)
                    {
                        btnSearch_Click(this, null);
                    }
                    break;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "错误", MessageBoxButtons.OK);
                Log.Error(ex);
            }
        }
예제 #2
0
 private void RightMenuClick(int type)
 {
     if (type == 0)
     {
         Clipboard.SetData(DataFormats.Text, this.dataGridView1.CurrentCell.Value.ToString());
     }
     if (type == 1)
     {
         this.Open();
     }
     if (type == 2)
     {
         this.Search();
     }
     if (type == 3)
     {
         Guid sid = (this.dataGridView1.CurrentRow.DataBoundItem as PurchaseCommonEntity).SupplyUnitId;
         FormPurchaseHistoryBySupplyer frm = new FormPurchaseHistoryBySupplyer(string.Empty, sid, DateTime.Now.AddYears(-3).Date, DateTime.Now.AddDays(1).Date);
         frm.Show(this);
     }
     if (type == 4)
     {
         Guid pid = (this.dataGridView1.CurrentRow.DataBoundItem as PurchaseCommonEntity).PurchaseOrderId;
         var  po  = this.PharmacyDatabaseService.GetPurchaseOrderEntity(out msg, pid);
         PurchaseBusiness.FormPurchaseOrderEdit frm = new FormPurchaseOrderEdit(po, false, true);
         frm.Show(this);
     }
     if (type == 5)
     {
         Guid pid = (this.dataGridView1.CurrentRow.DataBoundItem as PurchaseCommonEntity).PurchaseOrderId;
         PurchaseCommonEntity pcod = this.PharmacyDatabaseService.GetPurchaseReceivingOrdersByPurchaseOrderId(out msg, pid).FirstOrDefault();
         if (pcod == null)
         {
             MessageBox.Show("该单据无收货单信息,请联系管理员!"); return;
         }
         FormReceivingOrder frm = new FormReceivingOrder(pcod, true);
         frm.Show(this);
     }
     if (type == 6)
     {
         Guid Pid = (this.dataGridView1.CurrentRow.DataBoundItem as PurchaseCommonEntity).PurchaseOrderId;
         PurchaseCommonEntity pcod = this.PharmacyDatabaseService.GetPurchaseInInventeryOrdersByPurchaseOrderId(out msg, Pid).FirstOrDefault();
         if (pcod == null)
         {
             MessageBox.Show("该单据暂无入库信息!"); return;
         }
         FormInInventory frm = new FormInInventory(pcod, true);
         frm.Show(this);
     }
 }