public string LocalDateToInt(NodaTime.LocalDate ld) { string year = ld.Year.ToString("D4"); string month = ld.Month.ToString("D2"); string day = ld.Day.ToString("D2"); return(year + month + day); }
public GetSchools.SchoolStatus GetEffectiveStatus(NodaTime.LocalDate today) { return(_status switch { GetSchools.SchoolStatus.Unknown => GetSchools.SchoolStatus.Unknown, GetSchools.SchoolStatus.HasAgreedInitially => GetSchools.SchoolStatus.HasAgreedInitially, GetSchools.SchoolStatus.HasResigned => HasResignedEffectively(today) ? GetSchools.SchoolStatus.HasResigned : GetSchools.SchoolStatus.Unknown, GetSchools.SchoolStatus.HasSignedAgreement => IsAgreementEffective(today) ? GetSchools.SchoolStatus.HasSignedAgreement : GetSchools.SchoolStatus.Unknown, _ => GetSchools.SchoolStatus.Unknown });
public TestDataGenerator(int Iterations, NodaTime.LocalDate SDate, NodaTime.LocalDate EDate) { FirstNames = new List <string>(); LastNames = new List <string>(); Locations = new List <GeoEngine_Workspace.Location>(); ContactTypes = new List <DataObjects.Zombie.ZType>(); DataSetSize = Iterations; StartDate = SDate; EndDate = EDate; random = new Random(); LoadLists(); }
public static String[] GetAllMarkersByDateRange(String StartDate, String EndDate) { DataObjects.Toolset Tools = new DataObjects.Toolset(); NodaTime.LocalDate ZStartDate = Tools.StringToNodaDate(StartDate); NodaTime.LocalDate ZEndDate = Tools.StringToNodaDate(EndDate); using (DataAccessClass.DataAccessClass TheDatabase = new DataAccessClass.DataAccessClass()) { MasterZombieList = TheDatabase.GetAllZombiesByDateRange(ZStartDate, ZEndDate); } String[] ZombieArray = Tools.ConvertZombieListToStringArray(MasterZombieList); return(ZombieArray); }
public ArticleMetadataModel( ArticleStatus status, Version version, NodaTime.LocalDate firstRevision, NodaTime.LocalDate lastRevision, NodaTime.LocalDate lastReview, NodaTime.LocalDate nextReview) { Status = status; Version = version; FirstRevision = firstRevision; LastRevision = lastRevision; LastReview = lastReview; NextReview = nextReview; }
private DataObjects.Zombie RandomZombie() { NodaTime.Period P = NodaTime.Period.Between(StartDate, EndDate); int Days = random.Next(0, P.Days); NodaTime.LocalDate ZDate = StartDate.PlusDays(Days); DataObjects.Zombie Z = new DataObjects.Zombie(); Z.ContactLocation.SetDate(ZDate.Year, ZDate.Month, ZDate.Day); Z.ContactName = FirstNames[random.Next(0, FirstNames.Count - 1)] + " " + LastNames[random.Next(0, LastNames.Count - 1)]; Z.ContactType = ContactTypes[random.Next(0, ContactTypes.Count - 1)]; Z.ContactLocation.SetLatitude(Convert.ToDouble(random.Next(0, 90))); Z.ContactLocation.SetLongitude(Convert.ToDouble(random.Next(-180, 0))); Z.ContactLocation.SetElevation(Convert.ToDouble(random.Next(0, 250))); return(Z); }
public static int CreateMarker(String Name, Double Elevation, String Date, int Serial, String ContactType, Double Lat, Double Long) { //We are going to have to some syntax acrobatics to get the Zombie in the database. //Lets try to figure the date out DataObjects.Toolset Tools = new DataObjects.Toolset(); NodaTime.LocalDate D = Tools.StringToNodaDate(Date); GeoEngine_Workspace.Location Loc = new GeoEngine_Workspace.Location(Lat, Long, Elevation); Loc.SetDate(D.Year, D.Month, D.Day); DataObjects.Zombie Z = new DataObjects.Zombie(Loc, Name, DataObjects.Zombie.ZType.Slow); Z.SetZType(ContactType); DataObjects.Zombie ReturnZombie = new DataObjects.Zombie(); using (DataAccessClass.DataAccessClass TheDatabase = new DataAccessClass.DataAccessClass()) { ReturnZombie = TheDatabase.InsertZombie(Z); } return(ReturnZombie.ZombieSerialNumber); }
/// <summary> /// Date Coder Vers Notes /// 2020-02-06 Clay 1.0 Initial /// /// Get all the zombies from the database based on a date range /// </summary> /// <returns></returns> public List <DataObjects.Zombie> GetAllZombiesByDateRange(NodaTime.LocalDate StartDate, NodaTime.LocalDate EndDate) { MasterZombieList = new List <DataObjects.Zombie>(); try { System.Data.SqlClient.SqlDataReader t = PDM.Data.SqlHelper.ExecuteReader(GetConnectionString(), "sp_GetAllZombiesByDateRange", StartDate.ToString(), EndDate.ToString()); if (t.HasRows) { while (t.Read()) { //I copied my query from the database so I can get the order right. :) //SELECT L.LocationID, L.Elevation, L.Latitude, L.Longitude, DATEPART(YEAR, L.OccurenceDate), DATEPART(MONTH, L.OccurenceDate), DATEPART(DAY, L.OccurenceDate), CT.[Name] FROM tbl_ContactLocation CL //JOIN tbl_Location L ON L.LocationID = CL.LocationFK //JOIN tbl_ContactType CT ON CT.ContactTypeID = CL.ContactTypeFK DataObjects.Zombie NewZombie = new DataObjects.Zombie(Convert.ToInt32(t[0])); NewZombie.ContactLocation = new GeoEngine_Workspace.Location(Convert.ToDouble(t[2]), Convert.ToDouble(t[3]), Convert.ToInt32(t[1])); //I really should add a new Location Constructor to include the date. NewZombie.ContactLocation.SetDate(Convert.ToInt32(t[4]), Convert.ToInt32(t[5]), Convert.ToInt32(t[6])); NewZombie.SetZType(t[7].ToString()); NewZombie.ContactName = (t[8].ToString()); MasterZombieList.Add(NewZombie); } } } //This is the catch block catch (SqlException SQLE) { } catch (Exception e) { } finally { } return(MasterZombieList); }
public FixedTermAgreementSigned( Guid id, byte[] scannedDocument, string scannedDocumentExtension, string scannedDocumentContentType, NodaTime.LocalDate agreementEndDate, Guid recordingUserId, string?additionalNotes) { Guard.Against.Default(id, nameof(id)); Guard.Against.Empty(scannedDocument, nameof(scannedDocument)); Guard.Against.NullOrWhiteSpace(scannedDocumentExtension, nameof(scannedDocumentExtension)); Guard.Against.NullOrWhiteSpace(scannedDocumentContentType, nameof(scannedDocumentContentType)); Guard.Against.Default(agreementEndDate, nameof(agreementEndDate)); Guard.Against.Default(recordingUserId, nameof(recordingUserId)); Id = id; ScannedDocument = scannedDocument; ScannedDocumentExtension = scannedDocumentExtension; ScannedDocumentContentType = scannedDocumentContentType; AgreementEndDate = agreementEndDate; RecordingUserId = recordingUserId; AdditionalNotes = additionalNotes; }
public IHttpActionResult GetByDate3([FromUri] NodaTime.LocalDate date) { return(Ok(date.ToString())); }
private LocalDate(NodaTime.LocalDate localDate) { this.localDate = localDate; }
public LocalDate(int year, int month, int day) { this.localDate = new NodaTime.LocalDate(year, month, day); }
public static string ToSimpleDateString(this NodaTime.LocalDate date) => date.AtMidnight().ToDateTimeUnspecified().ToString("yyyy-MM-dd");
internal LocalDate(NodaTime.LocalDate localDate) { Day = localDate.Day; Month = localDate.Month; Year = localDate.Year; }