Exemplo n.º 1
0
        private void btnSendToSupplier_Click(object sender, EventArgs e)
        {
            try
            {
                //get selected row id and send it to the supplier form
                object  id          = dataGridView1.CurrentRow.Cells["ORDER_id"].Value;
                DataRow selectedRow = dtOrders.Rows.Find(id);

                //if orderid is in the sorder table
                ClassLibrary.SupplierOrder sorder = new ClassLibrary.SupplierOrder();
                sorder.OrderId = Convert.ToInt32(id);
                DataTable dt = sorder.GetSorderByOrderId().Tables[0];

                //if customer order hasnt been sent to suppliers before
                if (dt.Rows.Count == 0)
                {
                    frmDisSupplierOrder f = new frmDisSupplierOrder(this, selectedRow);
                    f.MdiParent     = this.MdiParent;
                    f.StartPosition = FormStartPosition.CenterScreen;
                    f.Show();
                }
                else
                {
                    DialogResult dlgResult = MessageBox.Show
                                                 ("the order has already been sent to the suppliers!",
                                                 "Continue?", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            catch (Exception ex) { }
        }
Exemplo n.º 2
0
 public frmChooseSupplier(int id, int index, frmDisSupplierOrder form)
 {
     this.index           = index;
     formDisSupplierOrder = form;
     partId = id;
     InitializeComponent();
 }
Exemplo n.º 3
0
 public frmDisSupplierOrder_Parts(frmDisSupplierOrder form)
 {
     formDisSupplierOrder = form;
     InitializeComponent();
 }
Exemplo n.º 4
0
 public frmAddPart(DataRow drRowToEdit, frmDisSupplierOrder form)
 {
     formDisSupplierOrder = form;
     drRow = drRowToEdit;
     InitializeComponent();
 }