示例#1
0
        private void FormAbout_Load(object sender, System.EventArgs e)
        {
            string softwareName = PrefC.GetString(PrefName.SoftwareName);

            if (Programs.GetCur(ProgramName.BencoPracticeManagement).Enabled)
            {
                pictureOpenDental.Image = Properties.Resources.bencoLogo;
            }
            if (softwareName != "Open Dental Software" && !Programs.GetCur(ProgramName.BencoPracticeManagement).Enabled)
            {
                pictureOpenDental.Visible = false;
            }
            labelVersion.Text = Lan.g(this, "Version:") + " " + Application.ProductVersion;
            UpdateHistory updateHistory = UpdateHistories.GetForVersion(Application.ProductVersion);

            if (updateHistory != null)
            {
                labelVersion.Text += "  " + Lan.g(this, "Since:") + " " + updateHistory.DateTimeUpdated.ToShortDateString();
            }
            //keeps the trailing year up to date
            labelCopyright.Text      = softwareName + " " + Lan.g(this, "Copyright 2003-") + DateTime.Now.ToString("yyyy") + ", Jordan S. Sparks, D.M.D.";
            labelMySQLCopyright.Text = Lan.g(this, "MySQL - Copyright 1995-") + DateTime.Now.ToString("yyyy") + Lan.g(this, ", www.mysql.com");
            //Database Server----------------------------------------------------------
            List <string> serviceList = Computers.GetServiceInfo();

            labelName.Text         += serviceList[2].ToString();         //MiscData.GetODServer();//server name
            labelService.Text      += serviceList[0].ToString();         //service name
            labelMySqlVersion.Text += serviceList[3].ToString();         //service version
            labelServComment.Text  += serviceList[1].ToString();         //service comment
            labelMachineName.Text  += Environment.MachineName.ToUpper(); //current client or remote application machine name
        }
示例#2
0
        private void FormUpdate_Load(object sender, System.EventArgs e)
        {
            if (ODBuild.IsWeb())
            {
                MsgBox.Show(this, "Updates are not allowed manually from within the program. Please call support.");
                Close();
                return;
            }
            SetButtonVisibility();
            labelVersion.Text = Lan.g(this, "Using Version:") + " " + Application.ProductVersion;
            UpdateHistory updateHistory = UpdateHistories.GetForVersion(Application.ProductVersion);

            if (updateHistory != null)
            {
                labelVersion.Text += "  " + Lan.g(this, "Since") + ": " + updateHistory.DateTimeUpdated.ToShortDateString();
            }
            if (PrefC.GetBool(PrefName.UpdateWindowShowsClassicView))
            {
                //Default location is (74,9).  We move it 5 pixels up since butShowPrev is 5 pixels bigger then labelVersion
                butShowPrev.Location  = new Point(74 + labelVersion.Width + 2, 9 - 5);
                panelClassic.Visible  = true;
                panelClassic.Location = new Point(67, 29);
                textUpdateCode.Text   = PrefC.GetString(PrefName.UpdateCode);
                textWebsitePath.Text  = PrefC.GetString(PrefName.UpdateWebsitePath); //should include trailing /
                butDownload.Enabled   = false;
                if (!Security.IsAuthorized(Permissions.Setup))                       //gives a message box if no permission
                {
                    butCheck.Enabled = false;
                }
            }
            else
            {
                if (Security.IsAuthorized(Permissions.Setup, true))
                {
                    butCheck2.Visible = true;
                }
                else
                {
                    textConnectionMessage.Text = Lan.g(this, "Not authorized for") + " " + GroupPermissions.GetDesc(Permissions.Setup);
                }
            }
        }
示例#3
0
        ///<summary>Inserts an UpdateHistory for the version passed in if there is no entry for that version. Returns the primary key of the row inserted
        ///or 0 if an UpdateHistory of that version already exists.</summary>
        public static long CreateUpdateHistory(string version, DateTime dateTimeUpdate = default(DateTime))
        {
            List <UpdateHistory> listUpdates = UpdateHistories.GetAll();

            if (listUpdates.Any(x => x.ProgramVersion == version))
            {
                return(0);
            }
            UpdateHistory update = new UpdateHistory();

            update.ProgramVersion = "16.1.1.0";
            long updateHistoryNum = UpdateHistories.Insert(update);

            if (dateTimeUpdate != default(DateTime))
            {
                //DateTimeUpdated is a DateTEntry column, so we have to forcefully update it.
                string command = "UPDATE updatehistory SET DateTimeUpdated=" + POut.DateT(dateTimeUpdate) + " WHERE UpdateHistoryNum=" + POut.Long(updateHistoryNum);
                DataCore.NonQ(command);
            }
            return(updateHistoryNum);
        }
示例#4
0
        private void FillGrid()
        {
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col = new ODGridColumn(Lan.g(this, "Version"), 117);

            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Date"), 117);
            gridMain.Columns.Add(col);
            gridMain.Rows.Clear();
            ODGridRow            row = null;
            List <UpdateHistory> listUpdateHistories = UpdateHistories.GetAll();

            foreach (UpdateHistory updateHistory in listUpdateHistories)
            {
                row = new ODGridRow();
                row.Cells.Add(updateHistory.ProgramVersion);
                row.Cells.Add(updateHistory.DateTimeUpdated.ToString());
                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
        }