Example #1
0
        /// <summary>
        /// Set the loop pre-warned status to true
        /// </summary>
        private void UpdatePreWarning()
        {
            Database db = new Database(this.database);

            UpdateQuery update = new UpdateQuery();
            update.SetTable("loop");
            update.SetFields(new string[] { "looPreWarned" });
            update.AddRowValue(1.ToString());
            update.SetId(this.loopId.ToString());

            db.Update(update);

            this.preWarned = true;
        }
        /// <summary>
        /// Updates the last check row in the table
        /// </summary>
        private void UpdateLastCheck()
        {
            Database db = new Database(this.database);

            UpdateQuery update = new UpdateQuery();
            update.SetTable("welfarecheck");
            update.SetFields(new string[] { "welLastCheck" });
            update.AddRowValue(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
            update.SetId(this.welfareId.ToString());

            db.Update(update);
        }
Example #3
0
        /// <summary>
        /// Updates the last completion row in the table
        /// </summary>
        /// <param name="dt"></param>
        private void UpdateLastCompletion(DateTime dt)
        {
            Database db = new Database(this.database);

            UpdateQuery update = new UpdateQuery();
            update.SetTable("loop");
            update.SetFields(new string[] { "looLastCompletion" });
            update.AddRowValue(dt.ToString("yyyy-MM-dd HH:mm:ss"));
            update.SetId(this.loopId.ToString());

            db.Update(update);

            this.lastCompletion = dt;
        }
Example #4
0
        /// <summary>
        /// Updates the last check row in the table
        /// </summary>
        private void UpdateLastCheck()
        {
            Database db = new Database(this.database);
            DateTime dt = DateTime.Now;

            UpdateQuery update = new UpdateQuery();
            update.SetTable("loop");
            update.SetFields(new string[] { "looLastCheck", "looPreWarned" });
            update.AddRowValue(dt.ToString("yyyy-MM-dd HH:mm:ss"));
            update.AddRowValue(0.ToString());
            update.SetId(this.loopId.ToString());

            db.Update(update);

            this.lastCheck = dt;
        }
        private void UpdateLastCheck(int HighRiskRecord_Id)
        {
            Database db = new Database(this.database);

            UpdateQuery update = new UpdateQuery();
            update.SetTable("checkpointhighrisk");
            update.SetFields(new string[] { "chrLastCheck" });
            update.AddRowValue(DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss"));
            update.SetId(HighRiskRecord_Id.ToString());

            db.Update(update);
        }
        /// <summary>
        /// Writes data to the database for the records and sets the chrStartDate and chrLastCheck
        /// </summary>
        /// <param name="HighRiskData"></param>
        private void CheckandInitialiseNullRecords(CheckPointHighRisk HighRiskRecord)
        {
            Database db = new Database(this.database);

            UpdateQuery update = new UpdateQuery();
            update.SetTable("checkpointhighrisk");
            update.SetFields(new string[] { "chrLastCheck", "chrStartTime" });

            string _nullDateTime = DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss");
            List<string> _nullDates = new List<string>();
            _nullDates.Add(_nullDateTime);
            _nullDates.Add(_nullDateTime);

            update.SetRowValues(_nullDates);
            update.SetId(HighRiskRecord.id.ToString());

            db.Update(update);
        }
Example #7
0
 /*********************************************************
  * UPDATE STATEMENTS
  *********************************************************/
 public void UpdateTaskScheduler(UpdateQuery update)
 {
     // Insert the Import into the database
     Database db = new Database(this.newDatabase);
     db.Update(update);
 }