/// <summary> /// Button default godown add click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnDefaultGodownAdd_Click(object sender, EventArgs e) { try { if (cmbDefaultGodown.SelectedValue != null) { strGodownName = cmbDefaultGodown.SelectedValue.ToString(); } else { strGodownName = string.Empty; } frmGodown frmGodown = new frmGodown(); frmGodown.MdiParent = formMDI.MDIObj; frmGodown open = Application.OpenForms["frmGodown"] as frmGodown; if (open == null) { frmGodown.WindowState = FormWindowState.Normal;//Edited by Najma frmGodown.MdiParent = formMDI.MDIObj; frmGodown.CallFromProdutCreation(this); } else { open.MdiParent = formMDI.MDIObj; open.CallFromProdutCreation(this); open.BringToFront(); if (open.WindowState == FormWindowState.Minimized) { open.WindowState = FormWindowState.Normal; } } } catch (Exception ex) { MessageBox.Show("PC:86" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to call godown form to create a new godown /// </summary> public void CreateGodownFromGrid() { try { isCallFromGrid = true; if (dgvProductCreation.CurrentRow.Cells["dgvcmbtgodown"].Value != null) { decGowdownId = Convert.ToDecimal(dgvProductCreation.CurrentRow.Cells["dgvcmbtgodown"].Value); } else { decGowdownId = -1; } frmGodown frmGodownObj = new frmGodown(); frmGodownObj.MdiParent = formMDI.MDIObj; frmGodownObj.CallFromProdutCreation(this); } catch (Exception ex) { MessageBox.Show("PC:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }