Exemplo n.º 1
0
 /// <summary>
 /// Calls frmProductBom form
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void productBomToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         frmProductBom frm = new frmProductBom();
         frmProductBom open = Application.OpenForms["frmProductBom"] as frmProductBom;
         if (open == null)
         {
             frm.MdiParent = this;
             frm.Show();
         }
         else
         {
             open.Activate();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("MDI 93 : " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// to work on cmbBom cell leave
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cmbBom_Leave(object sender, EventArgs e)
        {
            try
            {
                // if (k.KeyCode != Keys.Escape)
                if (cmbBom.SelectedIndex == 1)
                {
                    if (txtName.Text.Trim() != string.Empty)
                    {
                        strProductName = txtName.Text.Trim();
                        frmBomObj = new frmProductBom();
                        frmBomObj.MdiParent = formMDI.MDIObj;
                        frmProductBom open = Application.OpenForms["frmProductBom"] as frmProductBom;
                        if (open == null)
                        {
                            if (isBomFromRegister && btnSave.Text == "Update")
                            {
                                BomTableForUpdate();
                                frmBomObj.CallFromProdutCreationForUpadte(this, strProductName, decProductIdForEdit, dtblBomForEdit);
                            }
                            else
                            {
                                if (strProductName != string.Empty)
                                {
                                    if (!isSaveBomCheck && btnSave.Text == "Update")
                                    {
                                        frmBomObj.CallFromProdutCreation(this, strProductName, decProductIdForEdit);
                                    }
                                    //------------------------------------CheckingBomSavedOnce-----------------------------------------------------------------------------------
                                    else if (isSaveBomCheck)
                                    {
                                        frmBomObj.CallFromProdutCreationAgain(this, strProductName, dtblBom);
                                    }
                                    else
                                    {
                                        frmBomObj.CallFromProdutCreation(this, strProductName);
                                    }

                                }

                            }
                            this.Enabled = false;
                        }

                    }
                    else
                    {
                        Messages.InformationMessage("Enter product name");
                        cmbBom.SelectedIndex = 0;
                        txtName.Focus();
                    }
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show("PC:93" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }