Exemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            getImageLogo();
            lblLastUpdate.InnerHtml = "Last Update : " + Star.VersionControl.Versions.DateCreate.ToString("dd/MM/yyyy");
            lblVersion.InnerHtml    = Star.VersionControl.Versions.ProductName + " V. " + Star.VersionControl.Versions.ProductVersion;

            string   strSql = " Select * From Config ";
            DataView dv     = Conn.Select(strSql);                                                   // get วันที่ Update ล่าสุด เพื่อเช็คค่า

            TimeSpan ts = Convert.ToDateTime(dv[0]["LastUpdate"].ToString()).Subtract(DateTime.Now); // เทียบวันที่เท่ากัน //DateTime.ParseExact(dv[0]["LastUpdate"].ToString(), "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).Subtract(DateTime.Now);
            if (ts.Days < 0)
            {
                if (Star.Product.ProductKey.ProductID == null)
                {
                    Star.Product.ProductKey.ProductID = Program.ProductID;
                }

                string UpdateLink = btc.SchoolFieldName("UpdateLink", "");
                Star.VersionControl.VersionHandler version = new Star.VersionControl.VersionHandler(UpdateLink);   //Url ที่ใช้ Download
                if (!version.IsLastVersion && version.LastVersion != null)
                {
                    Conn.Update("Config", "", "LastUpdate, Version", DateTime.Now, version.LastVersion);
                    //Page.Cache.Remove("CNFG");
                }
            }
        }
    }
Exemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Star.Product.ProductKey.ProductID == null)
        {
            Star.Product.ProductKey.ProductID = Program.ProductID;
        }

        Star.Web.LicenseControl.LicenseHandler license = new Star.Web.LicenseControl.LicenseHandler();
        pnlLicense.InnerHtml = license.ProcessRequestHtml(this.Context);
        Program.Settings     = null;

        string UpdateLink = btc.SchoolFieldName("UpdateLink", CurrentUser.SchoolID);

        Star.VersionControl.VersionHandler version = new Star.VersionControl.VersionHandler(UpdateLink);
        version.RenderVersionToControl(AutoUpdate, "ระบบกำลังดำเนินการ<br/>ห้ามปิดหน้าจอนี้จนกว่าจะดำเนินการเสร็จ");

        Connection Conn = new Connection();

        Conn.Update("Config", "", "Version", "");
    }