Ejemplo n.º 1
0
        static void Main()
        {
            TaskBarAdapter.CheckCreated();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            PrepareAppEnvironment();
            string authEndPoint = INIAdapter.ReadValue(Common.INI_SECTION_WEB, Common.INI_KEY_AUTH_END_POINT, Common.INI_FILE_PATH);
            string smsEndPoint  = INIAdapter.ReadValue(Common.INI_SECTION_WEB, Common.INI_KEY_SMS_END_POINT, Common.INI_FILE_PATH);

            DialogResult dr = DialogResult.OK;

            if (string.IsNullOrEmpty(authEndPoint) || string.IsNullOrEmpty(smsEndPoint))
            {
                frmSetting frmS = new frmSetting();
                frmS.SectionSettingsSave += new dSectionSettingsSave((o, ce) =>
                {
                    INIAdapter.WriteValue(Common.INI_SECTION_WEB, Common.INI_KEY_AUTH_END_POINT, ce.AuthEndPoint, Common.INI_FILE_PATH);
                    INIAdapter.WriteValue(Common.INI_SECTION_WEB, Common.INI_KEY_SMS_END_POINT, ce.SmsEndPoint, Common.INI_FILE_PATH);
                    INIAdapter.WriteValue(Common.INI_SECTION_WEB, Common.INI_KEY_ISMG_END_POINT, ce.IsmgEndPoint, Common.INI_FILE_PATH);
                });
                dr = frmS.ShowDialog();
            }
            if (dr == DialogResult.OK)
            {
                Application.Run(new frmMain());
            }
        }
Ejemplo n.º 2
0
        static void Main()
        {
            TaskBarAdapter.CheckCreated();

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

            //http://localhost/SmartLife.Auth.Merchant.Services/v1/AuthenticateMerchant
            string authEndPoint = INIAdapter.ReadValue(Common.INI_SECTION_WEB, Common.INI_KEY_AUTH_END_POINT, Common.INI_FILE_PATH);
            string remindType   = INIAdapter.ReadValue(Common.INI_SECTION_BIZ, Common.INI_KEY_REMIND_TYPE, Common.INI_FILE_PATH);

            if (string.IsNullOrEmpty(remindType))
            {
                SettingsVar.CurrentRemindType = RemindType.提醒;
                INIAdapter.WriteValue(Common.INI_SECTION_BIZ, Common.INI_KEY_REMIND_TYPE, ((int)SettingsVar.CurrentRemindType).ToString(), Common.INI_FILE_PATH);
            }
            else
            {
                SettingsVar.CurrentRemindType = e0571.web.core.Utils.EnumAdapter.GetEnum <RemindType>(remindType);
            }
            DialogResult dr = DialogResult.OK;

            if (string.IsNullOrEmpty(authEndPoint))
            {
                frmSettings frmS = new frmSettings();
                frmS.SectionWebSettingsSave += new dSectionWebSettingsSave((o, ce) =>
                {
                    INIAdapter.WriteValue(Common.INI_SECTION_WEB, Common.INI_KEY_AUTH_END_POINT, ce.AuthEndPoint, Common.INI_FILE_PATH);
                });
                frmS.SectionBizSettingsSave += new dSectionBizSettingsSave((o, ce) =>
                {
                    SettingsVar.CurrentRemindType = ce.Type;
                    INIAdapter.WriteValue(Common.INI_SECTION_BIZ, Common.INI_KEY_REMIND_TYPE, ((int)ce.Type).ToString(), Common.INI_FILE_PATH);
                });
                dr = frmS.ShowDialog();
            }
            if (dr == DialogResult.OK)
            {
                frmLogin frm = new frmLogin();
                frm.ShowDialog();
                if (frm.DialogResult == DialogResult.OK)
                {
                    Application.Run(new frmMain());
                }
            }
        }