示例#1
0
        private void PageInit()
        {
            UpdateBLL          bll    = new UpdateBLL();
            AndroidVersionInfo adInfo = bll.getAndroidVersion();

            txtname.Value         = adInfo.Name;
            txtVersionCode.Value  = Convert.ToString(adInfo.VersionCode);
            txtVersionName.Value  = adInfo.VersionName;
            txtDownloadAddr.Value = adInfo.Src;
            txtIntroduction.Value = adInfo.Introduction;
        }
        //static void Main(string[] args)
        //{
        //    Logger.Initialize(mode: LoggingMode.Both, useBackgroundTask: true);
        //    Logger.Info("lol");
        //    Logger.Flush();
        //}

        static void Main(string[] args)
        {
            Logger.Initialize(mode: LoggingMode.Both, useBackgroundTask: true);

            IConfigBLL configBLL = new ConfigBLL();
            IUpdateBLL updateBLL = new UpdateBLL();

            try
            {
                if (args.Length > 0)
                {
                    if (args[0] == _argCreateConfigFile)
                    {
                        if (args.Length < 3)
                        {
                            Console.Error.WriteLine($"Wrong usage of {_argCreateConfigFile}");
                        }

                        configBLL
                        .SaveConfiguration
                        (
                            new ConfigurationItem
                        {
                            DBeaverInstallPath = args[1].TrimStart().TrimEnd(),
                            Architecture       = args[2].ToUpperInvariant().ToEnum(Architecture.X86)
                        }
                        );

                        return;
                    }
                }

                if (!configBLL.ConfigFileExists())
                {
                    Console.WriteLine($"Configuration file not found, please call with line arguments {_argCreateConfigFile} DBeaverInstallPath Architecture");
                    return;
                }

                ConfigurationItem configItem = configBLL.RetrieveConfiguration();
                updateBLL.UpdateVersion(configItem).Wait();
            }
            catch (Exception ex)
            {
                Logger.Error("An error occurred", ex);
            }
            finally
            {
                Logger.Flush();
            }
        }
示例#3
0
        protected void btnsubmit_Click(object sender, EventArgs e)
        {
            AndroidVersionInfo adInfo = new AndroidVersionInfo();

            adInfo.Name         = txtname.Value;
            adInfo.VersionCode  = Convert.ToInt32(txtVersionCode.Value);
            adInfo.VersionName  = txtVersionName.Value;
            adInfo.Src          = txtDownloadAddr.Value;
            adInfo.Introduction = txtIntroduction.Value;

            UpdateBLL bll = new UpdateBLL();

            if (bll.UpdateAndroidVersion(adInfo) > 0)
            {
                base.JscriptPrint("修改成功!", "android.aspx", "Success");
            }
            else
            {
                base.JscriptPrint("修改失败!", "android.aspx", "Fail");
            }
        }
示例#4
0
        public AndroidVersionInfo getVersionInfo()
        {
            UpdateBLL bll = new UpdateBLL();

            return(bll.getAndroidVersion());
        }
示例#5
0
 internal static async Task <UpdateBLL> GetUpdateBLL()
 {
     return(await UpdateBLL.CreateGitHub("jannikbecker", "leibit", false));
 }