Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
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();
        }