private void btnEditContract_Click(object sender, EventArgs e)
        {
            frmContracts _frmContract = new frmContracts();

            _frmContract.StartPosition = FormStartPosition.CenterScreen;
            _frmContract.ContractId    = ContractId;
            _frmContract.IsEdit        = true;
            _frmContract.databaseId    = DatabaseId;
            _frmContract.CustomerId    = CustomerId;
            _frmContract.ShowDialog();
            BindContracts(CustomerId);
        }
Пример #2
0
        public void SBO_Application_MenuEvent(ref SAPbouiCOM.MenuEvent pVal, out bool BubbleEvent)
        {
            BubbleEvent = true;

            try
            {
                if (pVal.BeforeAction && pVal.MenuUID == "UGRS.AddOn.Machinery.Forms.MachineryForm")
                {
                    MachineryForm lObjMachineryForm = new MachineryForm();
                    lObjMachineryForm.Show();
                }

                if (pVal.BeforeAction && pVal.MenuUID == "UGRS.AddOn.Machinery.Forms.frmRiseSearch")
                {
                    frmRiseSearch lObjFrmRiseSearch = new frmRiseSearch();
                    lObjFrmRiseSearch.Show();
                }

                if (pVal.BeforeAction && pVal.MenuUID == "UGRS.AddOn.Machinery.Forms.frmRisesCommissions")
                {
                    frmRisesCommissions lObjfrmRisesCommissions = new frmRisesCommissions();
                    lObjfrmRisesCommissions.Show();
                }

                if (pVal.BeforeAction && pVal.MenuUID == "UGRS.AddOn.Machinery.Forms.frmStockTransfer")
                {
                    frmStockTransfer lObjfrmStockTransfer = new frmStockTransfer();
                    lObjfrmStockTransfer.Show();
                }

                if (pVal.BeforeAction && pVal.MenuUID == "UGRS.AddOn.Machinery.Forms.frmContracts")
                {
                    frmContracts lObjFrmContracts = new frmContracts();
                    lObjFrmContracts.Show();
                }
            }
            catch (Exception ex)
            {
                LogService.WriteError(string.Format("[Menu - SBO_Application_MenuEvent: {0}]", ex.Message));

                if (ex.Message.Contains("Failed to create form. Please check the form attributes"))
                {
                    if (pVal.MenuUID == "UGRS.AddOn.Machinery.Forms.MachineryForm")
                    {
                        UIApplication.GetApplication().Forms.Item("frmRise").Close();
                    }
                    else if (pVal.MenuUID == "UGRS.AddOn.Machinery.Forms.frmRiseSearch")
                    {
                        UIApplication.GetApplication().Forms.Item("frmRSch").Close();
                    }
                    else if (pVal.MenuUID == "UGRS.AddOn.Machinery.Forms.frmRisesCommissions")
                    {
                        UIApplication.GetApplication().Forms.Item("frmRCom").Close();
                    }
                    else if (pVal.MenuUID == "UGRS.AddOn.Machinery.Forms.frmStockTransfer")
                    {
                        UIApplication.GetApplication().Forms.Item("frmStkTrn").Close();
                    }
                    else if (pVal.MenuUID == "UGRS.AddOn.Machinery.Forms.frmContracts")
                    {
                        UIApplication.GetApplication().Forms.Item("frmCont").Close();
                    }
                }
                else
                {
                    Application.SBO_Application.MessageBox(ex.ToString(), 1, "Ok", "", "");
                }
            }
        }