示例#1
0
        public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton)
        {
            string inputValue = "";

            return(CustomMsgBox.Show(owner, text, caption, buttons, icon, defaultButton, null, null, ref inputValue));
        }
示例#2
0
 public static DialogResult Show(IWin32Window owner, string text)
 {
     return(CustomMsgBox.Show(owner, text, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1));
 }
示例#3
0
 public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon)
 {
     return(CustomMsgBox.Show(owner, text, caption, buttons, icon, MessageBoxDefaultButton.Button1));
 }
示例#4
0
        static void Main()
        {
            const string applicationName = "TotalSmartCodingSolution"; bool createdNew;

            mutex = new Mutex(true, applicationName, out createdNew);
            if (!createdNew)
            {
                return;
            }                              //app is already running! Exiting the application

            Registries.ProductName = Application.ProductName.ToUpper();

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);


            AutoMapperConfig.SetupMappings();

            //string ApplicationRoleRequired = "false"; //COMMENT ON 11-JUL-2018: NOT USE ApplicationRoleRequired. JUST REMOVE THIS COMMENT ONLY -> TO USE ApplicationRoleRequired (GET ApplicationRoleRequired OPTION FROM CONFIG SETTING BY THE FOLLOWING CommonConfigs.ReadSetting("ApplicationRoleRequired")).
            string ApplicationRoleRequired = CommonConfigs.ReadSetting("ApplicationRoleRequired");

            ApplicationRoles.Required = true; ApplicationRoles.Name = ""; ApplicationRoles.Password = ""; bool applicationRoleRequired = false;
            if (bool.TryParse(ApplicationRoleRequired, out applicationRoleRequired))
            {
                ApplicationRoles.Required = applicationRoleRequired;
            }


            TrialConnects trialConnects      = new TrialConnects();
            DialogResult  trialConnectResult = trialConnects.Connected();

            if (trialConnectResult == DialogResult.Yes)
            {
                Logon logon = new Logon();

                if (logon.ShowDialog() == DialogResult.OK)
                {
                    if (!GlobalEnums.CBPP)
                    {
                        LegalNotice legalNotice = new LegalNotice();
                        legalNotice.ShowDialog(); legalNotice.Dispose();
                    }

                    if (GlobalVariables.FillingLineID == GlobalVariables.FillingLine.Smallpack || GlobalVariables.FillingLineID == GlobalVariables.FillingLine.Pail || GlobalVariables.FillingLineID == GlobalVariables.FillingLine.Medium4L || GlobalVariables.FillingLineID == GlobalVariables.FillingLine.Import || GlobalVariables.FillingLineID == GlobalVariables.FillingLine.Drum)
                    {
                        Application.Run(new MasterMDI(GlobalEnums.NmvnTaskID.SmartCoding, new SmartCoding()));
                    }
                    else
                    {
                        if (GlobalVariables.ConfigID == (int)GlobalVariables.FillingLine.Pickup)
                        {
                            Application.Run(new MasterMDI(GlobalEnums.NmvnTaskID.Pickups, new Pickups()));
                        }
                        else if (GlobalVariables.ConfigID == (int)GlobalVariables.FillingLine.GoodsIssue)
                        {
                            Application.Run(new MasterMDI(GlobalEnums.NmvnTaskID.GoodsIssues, new GoodsIssues()));
                        }
                        else
                        {
                            Application.Run(new MasterMDI());
                        }
                    }
                }
                logon.Dispose();
            }
            else
            if (trialConnectResult == DialogResult.No)
            {
                if (ApplicationRoles.Required)
                {
                    ConnectServer connectServer = new ConnectServer(false);
                    connectServer.ShowDialog(); connectServer.Dispose();
                }
                else
                if (CustomMsgBox.Show(new Form(), "Do you want to specify new application role and password?", "Warning", MessageBoxButtons.YesNoCancel) == DialogResult.Yes)
                {
                    ConnectServer connectServer = new ConnectServer(true);
                    connectServer.ShowDialog(); connectServer.Dispose();
                }
            }
        }