Esempio n. 1
0
        public int GetIdTask()
        {
            try
            {
                int      idtask, resultcompare;
                string   getdays;
                TimeSpan tasktime;
                DateTime nextStartDatetime;
                do
                {
                    BDAL.OpenConnection();
                    t = BDAL.SelFullTask(Idserver);
                    BDAL.CloseConnection();

                    idtask            = (int)t.Rows[0]["id_task"];
                    nextStartDatetime = (DateTime)t.Rows[0]["Next_Start"];
                    getdays           = (string)t.Rows[0]["sel_day"];
                    tasktime          = (TimeSpan)t.Rows[0]["task_time"];

                    resultcompare = DateTime.Compare(nextStartDatetime, CurrentDateTime);
                    if (resultcompare < 0)
                    {
                        UpdateNextDatetime(idtask, getdays, tasktime);
                    }
                } while (resultcompare < 0);


                return(idtask);
            }
            catch
            {
                return(0);
            }
        }
Esempio n. 2
0
 public void UpdateSosttask(int idsost)
 {
     try
     {
         BDAL.OpenConnection();
         BDAL.EditDiffTaskSost(DTask.Idtask, idsost, DTask.Nextstart);
         BDAL.CloseConnection();
     }
     catch
     {
     }
 }