/// <summary> /// Calls corresponding voucher on ViewDetails button click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnViewDetails_Click(object sender, EventArgs e) { try { if (dgvSiRegister.CurrentRow != null) { inCurrenRowIndex = dgvSiRegister.CurrentRow.Index; if (bool.Parse(dgvSiRegister.CurrentRow.Cells["dgvtxtPos"].Value.ToString())) { frmPOS objfrmpos = new frmPOS(); decimal dcRegister = Convert.ToDecimal(dgvSiRegister.CurrentRow.Cells["dgvtxtsalesMasterId"].Value.ToString()); frmPOS openpos = Application.OpenForms["frmPOS"] as frmPOS; if (openpos == null) { objfrmpos.WindowState = FormWindowState.Normal; objfrmpos.MdiParent = formMDI.MDIObj; objfrmpos.Show(); objfrmpos.CallFromSalesRegister(dcRegister, this); } else { openpos.MdiParent = formMDI.MDIObj; openpos.BringToFront(); openpos.CallFromSalesRegister(dcRegister, this); if (openpos.WindowState == FormWindowState.Minimized) { openpos.WindowState = FormWindowState.Normal; } } } else { frmSalesInvoice objfrmSalesInvoice = new frmSalesInvoice(); frmSalesInvoice open = Application.OpenForms["frmSalesInvoice"] as frmSalesInvoice; decimal dcRegister = Convert.ToDecimal(dgvSiRegister.CurrentRow.Cells["dgvtxtsalesMasterId"].Value.ToString()); if (open == null) { objfrmSalesInvoice.WindowState = FormWindowState.Normal; objfrmSalesInvoice.MdiParent = formMDI.MDIObj; objfrmSalesInvoice.Show(); objfrmSalesInvoice.CallFromSalesInvoiceRegister(this, dcRegister); } else { objfrmSalesInvoice.MdiParent = formMDI.MDIObj; open.BringToFront(); open.CallFromSalesInvoiceRegister(this, dcRegister); if (open.WindowState == FormWindowState.Minimized) { open.WindowState = FormWindowState.Normal; } } } } } catch (Exception ex) { MessageBox.Show("SIR: 13" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Call Corresponding Voucher to View details for updation in edit mode /// </summary> public void GotoSalesInvoice() { try { SalesMasterSP SpMaster = new SalesMasterSP(); SalesMasterInfo InfoMaster = new SalesMasterInfo(); InfoMaster = SpMaster.SalesMasterView(Convert.ToDecimal(dgvVoucherSearch.CurrentRow.Cells["Id"].Value.ToString())); if (InfoMaster.POS == true) { frmPOS objfrm = new frmPOS(); objfrm.WindowState = FormWindowState.Normal; objfrm.MdiParent = formMDI.MDIObj; objfrm.Show(); objfrm.CallFromVoucherSearch(this, Convert.ToDecimal(dgvVoucherSearch.CurrentRow.Cells["Id"].Value.ToString())); } else { frmSalesInvoice objfrmSalesInvoice = new frmSalesInvoice(); frmSalesInvoice open = Application.OpenForms["frmSalesInvoice"] as frmSalesInvoice; if (open == null) { objfrmSalesInvoice.WindowState = FormWindowState.Normal; objfrmSalesInvoice.MdiParent = formMDI.MDIObj; objfrmSalesInvoice.Show(); objfrmSalesInvoice.CallFromVoucherSearch(this, Convert.ToDecimal(dgvVoucherSearch.CurrentRow.Cells["Id"].Value.ToString())); } else { open.MdiParent = formMDI.MDIObj; if (open.WindowState == FormWindowState.Minimized) { open.WindowState = FormWindowState.Normal; } else { open.Activate(); } open.CallFromVoucherSearch(this, Convert.ToDecimal(dgvVoucherSearch.CurrentRow.Cells["Id"].Value.ToString())); open.BringToFront(); } } } catch (Exception ex) { MessageBox.Show("VS24:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Calls corresponding voucher for updation /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dgvSIReport_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { if (e.RowIndex > -1 && e.ColumnIndex > -1) { if (dgvSIReport.CurrentRow != null) { inCurrenRowIndex = dgvSIReport.CurrentRow.Index; if (bool.Parse(dgvSIReport.CurrentRow.Cells["dgvtxtPOS"].Value.ToString())) { frmPOS objfrmpos; decimal dcRegister = Convert.ToDecimal(dgvSIReport.CurrentRow.Cells["dgvtxtSalesMasterId"].Value.ToString()); objfrmpos = Application.OpenForms["frmPOS"] as frmPOS; if (objfrmpos == null) { objfrmpos = new frmPOS(); objfrmpos.MdiParent = formMDI.MDIObj; objfrmpos.Show(); objfrmpos.CallFromSalesInvoiceReport(dcRegister, this); objfrmpos.WindowState = FormWindowState.Normal; } else { objfrmpos.CallFromSalesInvoiceReport(dcRegister, this); if (objfrmpos.WindowState == FormWindowState.Minimized) { objfrmpos.WindowState = FormWindowState.Normal; } } } else { frmSalesInvoice objfrmSalesInvoice = new frmSalesInvoice(); frmSalesInvoice open = Application.OpenForms["frmSalesInvoice"] as frmSalesInvoice; decimal dcRegister = Convert.ToDecimal(dgvSIReport.CurrentRow.Cells["dgvtxtSalesMasterId"].Value.ToString()); if (open == null) { objfrmSalesInvoice.WindowState = FormWindowState.Normal; objfrmSalesInvoice.MdiParent = formMDI.MDIObj; objfrmSalesInvoice.Show(); objfrmSalesInvoice.CallFromSalesInvoiceReport(this, dcRegister); } else { open.CallFromSalesInvoiceReport(this, dcRegister); if (open.WindowState == FormWindowState.Minimized) { open.WindowState = FormWindowState.Normal; } } } } } } catch (Exception ex) { MessageBox.Show("SIRPT: 17" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }