Exemple #1
0
        private void Cmb_SelectedIndexChanged(object sender, EventArgs e)
        {
            ComboBox cmb = (ComboBox)sender;

            if (cmb.Text == "Challan")
            {
                string orderID = dgvBills.CurrentRow.Cells["OrderID"].Value.ToString();
                PurchaseChallanEntry frmChallanEntry = new PurchaseChallanEntry(orderID);
                frmChallanEntry.OnClose += GenerateOrderList;
                frmChallanEntry.ShowDialog();
            }
            if (cmb.Text == "Bill")
            {
                string            orderID      = dgvBills.CurrentRow.Cells["OrderID"].Value.ToString();
                PurchaseBillEntry frmbillEntry = new PurchaseBillEntry(PurchaseBillEntry._CameFrom.Order, orderID, "");
                frmbillEntry.OnClose += GenerateOrderList;
                frmbillEntry.ShowDialog();
            }
            if (cmb.Text == "Advance Payment")
            {
                string         orderID           = dgvBills.CurrentRow.Cells["OrderID"].Value.ToString();
                AdvancePayment frmadvancePayment = new AdvancePayment(AdvancePayment._FromWherere.Order, orderID);
                frmadvancePayment.Onclose += GenerateOrderList;
                frmadvancePayment.ShowDialog();
            }
        }
        private void btnNewBillEntry_Click(object sender, EventArgs e)
        {
            PurchaseBillEntry purchasebillentry = new PurchaseBillEntry(PurchaseBillEntry._CameFrom.PurchaseBill);

            purchasebillentry.OnClose += GenerateBillingList;
            purchasebillentry.ShowDialog();
        }
 private void dgvBills_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (dgvBills.SelectedCells.Count > 0 && dgvBills.Columns[e.ColumnIndex].Name != "Action" && e.ColumnIndex >= 0 && e.RowIndex >= 0)
     {
         if (UserTools._IsEdit)
         {
             string            billid            = dgvBills.CurrentRow.Cells["Billid"].Value.ToString();
             string            status            = dgvBills.CurrentRow.Cells["STATUS"].Value.ToString();
             PurchaseBillEntry purchasebillentry = new PurchaseBillEntry(billid, status);
             purchasebillentry.OnClose += GenerateBillingList;
             purchasebillentry.ShowDialog();
         }
         else
         {
             MessageBox.Show("Edit permission denied by Admin", "Permission", MessageBoxButtons.OK, MessageBoxIcon.Stop);
             GenerateBillingList();
         }
     }
 }