コード例 #1
0
ファイル: Event.cs プロジェクト: LeeActon/BarringtonTree
        public String DateString()
        {
            String dateString = null;

            if (Date1 != null)
            {
                if ((Date2 != null) && !Date2.Julian)
                {
                    dateString = String.Format("BET {0} AND {1}", Date1.ToString(), Date2.ToString());
                }
                else
                {
                    dateString = Date1.ToString();
                }
            }

            return(dateString);
        }
コード例 #2
0
        public async void SaveChanges()
        {
            if (Date1 < Date2)
            {
                bool confirmed = await JsRunTime.InvokeAsync <bool>("confirm", "Are you sure you want to make these changes?");

                if (confirmed)
                {
                    string tasks = "";
                    foreach (var item in results.Where(i => i.IsJobSelected == true))
                    {
                        tasks += "'" + item.TASK_ID + "'" + ",";
                        item.ScheduledDownTime = Date1.ToString() + " - " + Date2.ToString();
                    }
                    tasks = tasks.TrimEnd(',');
                    string insertSql = "update " + OracleTableNames.JobService + " set service_suspend_start = to_date('" + Date1.ToString() + "','MM/DD/YYYY HH:MI:SS AM')," +
                                       " service_suspend_stop = to_date('" + Date2.ToString() + "','MM/DD/YYYY HH:MI:SS AM')  where task_id in (" + tasks + ")";
                    var sqlString = new StringContent(insertSql, Encoding.UTF8, "text/plain");
                    await HttpClient.PostAsync(ServiceEndpoints.EXECUTE_SQL_POST, sqlString);
                    await GetData();

                    GetStatus();
                    ClearSelected();
                    Date1 = DateTime.Now;
                    Date2 = DateTime.Now;
                }
                else
                {
                    GetStatus();
                    Date1 = DateTime.Now;
                    Date2 = DateTime.Now;
                }
            }
            else
            {
                FontColor = "red";
                Message   = "Start Time must be less than End Time";
                GetStatus();
            }
            await GetData();

            GetStatus();
            StateHasChanged();
        }
コード例 #3
0
 public void VerifyDate1()
 {
     Date1String = Date1.ToString("g");
 }
コード例 #4
0
 public bool Find(string toFind)
 {
     return(DateType.ToString() == toFind ||
            Date1.ToString() == toFind);
 }