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); }
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(); }
public void VerifyDate1() { Date1String = Date1.ToString("g"); }
public bool Find(string toFind) { return(DateType.ToString() == toFind || Date1.ToString() == toFind); }