Пример #1
0
    //---------------------------------------------------------------------------
    /// <summary>
    /// The About panel load event handler.
    /// </summary>
    protected void pnlAbout_LoadContent(object sender, EventArgs e)
    {
        PXLabel lbl = (PXLabel)pnlAbout.FindControl("lblVersion");

        lbl.Text = this.GetVersion(false);

        lbl      = (PXLabel)pnlAbout.FindControl("lblAcumatica");
        lbl.Text = "Acumatica " + PXVersionInfo.ProductVersion;

        if (PX.SM.UpdateMaint.CheckForUpdates())
        {
            lbl                  = (PXLabel)pnlAbout.FindControl("lblUpdates");
            lbl.Text             = PXMessages.LocalizeFormatNoPrefix(PX.AscxControlsMessages.PageTitle.Updates, PXVersionInfo.Version);
            lbl.Style["display"] = "";
        }

        var lastRestoredSnapshot = CompanyMaint.GetLastRestoredSnapshot();

        if (lastRestoredSnapshot != null &&
            lastRestoredSnapshot.IsSafe != null &&
            !lastRestoredSnapshot.IsSafe.Value &&
            lastRestoredSnapshot.Dismissed != null &&
            !lastRestoredSnapshot.Dismissed.Value)
        {
            lbl      = (PXLabel)pnlAbout.FindControl("lblRestoredSnapshotIsUnsafe");
            lbl.Text = PXMessages.LocalizeFormatNoPrefixNLA(PX.Data.Update.Messages.UnsafeSnapshotRestoredShort,
                                                            lastRestoredSnapshot.CreatedDateTime != null ? lastRestoredSnapshot.CreatedDateTime.ToString() : "uknown date");
            lbl.ForeColor        = System.Drawing.Color.Red;
            lbl.Style["display"] = "";
        }

        lbl      = (PXLabel)pnlAbout.FindControl("lblCopyright2");
        lbl.Text = PXMessages.LocalizeFormatNoPrefix(PX.AscxControlsMessages.PageTitle.Copyright2);

        lbl = (PXLabel)pnlAbout.FindControl("lblInstallationID");
        // hiding InstallationID if it is empty
        if (String.IsNullOrEmpty(PXVersionInfo.InstallationID))
        {
            lbl.Visible = false;
        }
        lbl.Text = PXMessages.LocalizeFormatNoPrefix(PX.AscxControlsMessages.PageTitle.InstallationID, PXLicenseHelper.InstallationID);

        string copyR = PXVersionInfo.Copyright;

        lbl = (PXLabel)pnlAbout.FindControl("lblCopyright1");
        if (!string.IsNullOrEmpty(copyR))
        {
            lbl.Text = copyR;
        }
    }
Пример #2
0
    protected void OnFileUploadFinished(PX.Web.UI.UserControls.PXUploadFilePanel.PXFileUploadedEventArgs e)
    {
        CompanyMaint graph = (CompanyMaint)this.ds.DataGraph;

        try
        {
            graph.OnPackageUploaded(e.FileName, e.Password, e.BinData);
        }
        catch (PXException ex)
        {
            this.ClientScript.RegisterClientScriptBlock(this.GetType(), "uploadErr", "window.uploadErr = \"Error during file upload: " + ex.MessageNoPrefix.Replace('"', '\'') + "\";", true);
            throw;
        }
    }