private void dgvadvanceReceipt_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex >= 0 && e.ColumnIndex >= 0)
     {
         if (UserTools._IsEdit)
         {
             object advamt   = dgvadvanceReceipt.Rows[e.RowIndex].Cells["Amount"].Value.ToString();
             double adtot    = advamt.ISValidObject() ? double.Parse(advamt.ToString()) : 0;
             object dueamunt = dgvadvanceReceipt.Rows[e.RowIndex].Cells["DueAmount"].Value.ToString();
             double due      = dueamunt.ISValidObject() ? double.Parse(dueamunt.ToString()) : 0;
             string status   = "Open";
             if (adtot != due)
             {
                 status = "Close";
             }
             string         receiptno = dgvadvanceReceipt.Rows[e.RowIndex].Cells["ReceiptNo"].Value.ToString();
             AdvanceReceipt adreceipt = new AdvanceReceipt(receiptno, status, "");
             adreceipt.Onclose += GenerateAdvanceReceiptList;
             adreceipt.ShowDialog();
         }
         else
         {
             MessageBox.Show("Permission Denied", "Edit", MessageBoxButtons.OK, MessageBoxIcon.Stop);
         }
     }
 }
示例#2
0
 private void dgvSuppliersDetails_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (dgvSuppliersDetails.Columns[e.ColumnIndex].Name == "Action" && e.RowIndex >= 0 && e.ColumnIndex >= 0)
     {
         string         ledgerid      = dgvSuppliersDetails.Rows[e.RowIndex].Cells["ledgerid"].Value.ToString();
         AdvanceReceipt advancerecept = new AdvanceReceipt(AdvanceReceipt._FromWherere.Direct, ledgerid);
         advancerecept.ShowDialog();
     }
 }
示例#3
0
        private void Cmb_SelectedIndexChanged(object sender, EventArgs e)
        {
            ComboBox cmb = (ComboBox)sender;

            if (cmb.Text == "Create Challan")
            {
                string       orderID         = dgvBills.CurrentRow.Cells["OrderID"].Value.ToString();
                string       orderNo         = dgvBills.CurrentRow.Cells["No"].Value.ToString();
                ChallanEntry frmChallanEntry = new ChallanEntry(orderID, orderNo);
                frmChallanEntry.OnClose += GenerateOrderList;
                frmChallanEntry.ShowDialog();
            }
            else if (cmb.Text == "Advance receipt")
            {
                string         orderid = dgvBills.CurrentRow.Cells["Orderid"].Value.ToString();
                AdvanceReceipt ar      = new AdvanceReceipt(AdvanceReceipt._FromWherere.Order, orderid);
                ar.ShowDialog();
            }
            else if (cmb.Text == "Create Invoice")
            {
                string         name            = dgvBills.CurrentRow.Cells["PartyName"].Value.ToString();
                string         slno            = dgvBills.CurrentRow.Cells["slno"].Value.ToString();
                Invoice_Direct frmChallanEntry = new Invoice_Direct(slno, name);
                frmChallanEntry.OnClose += GenerateOrderList;
                frmChallanEntry.ShowDialog();
            }
            else if (cmb.Text == "Cancel Order")
            {
                string name = dgvBills.CurrentRow.Cells["PartyName"].Value.ToString();
                string slno = dgvBills.CurrentRow.Cells["slno"].Value.ToString();
                if (OrderCancel(slno))
                {
                    GenerateOrderList();
                }
            }
        }