Skip to content

Commit

Permalink
Format with csharpier
Browse files Browse the repository at this point in the history
  • Loading branch information
toburger committed Aug 18, 2022
1 parent afca581 commit 2d9400f
Show file tree
Hide file tree
Showing 211 changed files with 34,075 additions and 16,623 deletions.
679 changes: 574 additions & 105 deletions CDB/GetAccommodationDataCDB.cs

Large diffs are not rendered by default.

29 changes: 24 additions & 5 deletions DSS/GetDSSData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ public class GetDSSData
public const string serviceurlslopebase = "pistebasis";
public const string serviceurlslopestatus = "pistenstatus";

private static async Task<HttpResponseMessage> RequestDSSInfo(DSSRequestType dssRequestType, string dssuser, string dsspswd, string serviceurl)
private static async Task<HttpResponseMessage> RequestDSSInfo(
DSSRequestType dssRequestType,
string dssuser,
string dsspswd,
string serviceurl
)
{
try
{
Expand Down Expand Up @@ -53,19 +58,33 @@ private static async Task<HttpResponseMessage> RequestDSSInfo(DSSRequestType dss
}
catch (Exception ex)
{
return new HttpResponseMessage { StatusCode = HttpStatusCode.BadRequest, Content = new StringContent(ex.Message) };
return new HttpResponseMessage
{
StatusCode = HttpStatusCode.BadRequest,
Content = new StringContent(ex.Message)
};
}
}

public static async Task<dynamic?> GetDSSDataAsync(DSSRequestType dssRequestType, string dssuser, string dsspswd, string serviceurl)
public static async Task<dynamic?> GetDSSDataAsync(
DSSRequestType dssRequestType,
string dssuser,
string dsspswd,
string serviceurl
)
{
//Request
HttpResponseMessage response = await RequestDSSInfo(dssRequestType, dssuser, dsspswd, serviceurl);
HttpResponseMessage response = await RequestDSSInfo(
dssRequestType,
dssuser,
dsspswd,
serviceurl
);
//Parse JSON Response to
var responsetask = await response.Content.ReadAsStringAsync();
dynamic? responseobject = JsonConvert.DeserializeObject(responsetask);

return responseobject;
}
}
}
}
348 changes: 252 additions & 96 deletions DSS/Parser/ParseDSSToODHActivityPoi.cs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion DataModel/BDPResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class BDPData
//public string sname { get; set; }
//public string sorigin { get; set; }
public BDPMetaData smetadata { get; set; }
//public BDPCoordinate scoordinate { get; set; }
//public BDPCoordinate scoordinate { get; set; }
}

public class BDPMetaData
Expand Down
30 changes: 27 additions & 3 deletions DataModel/GenericResults.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,24 @@ public static UpdateDetail MergeUpdateDetail(IEnumerable<UpdateDetail> updatedet
deleted = updatedetail.deleted + deleted;
}

return new UpdateDetail() { created = created, updated = updated, deleted = deleted };
return new UpdateDetail()
{
created = created,
updated = updated,
deleted = deleted
};
}

public static UpdateResult GetSuccessUpdateResult(string id, string source, string operation, string updatetype, string message, string otherinfo, UpdateDetail detail, bool createlog)
public static UpdateResult GetSuccessUpdateResult(
string id,
string source,
string operation,
string updatetype,
string message,
string otherinfo,
UpdateDetail detail,
bool createlog
)
{
var result = new UpdateResult()
{
Expand All @@ -90,7 +104,17 @@ public static UpdateResult GetSuccessUpdateResult(string id, string source, stri
return result;
}

public static UpdateResult GetErrorUpdateResult(string id, string source, string operation, string updatetype, string message, string otherinfo, UpdateDetail detail, Exception ex, bool createlog)
public static UpdateResult GetErrorUpdateResult(
string id,
string source,
string operation,
string updatetype,
string message,
string otherinfo,
UpdateDetail detail,
Exception ex,
bool createlog
)
{
var result = new UpdateResult()
{
Expand Down
25 changes: 14 additions & 11 deletions DataModel/GpsConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ namespace DataModel
{
public static class GpsConverter
{

public static IDictionary<string, GpsInfo> ToGpsPointsDictionary(this ICollection<GpsInfo> gpsinfos, bool ltsactivitypoi = false)
public static IDictionary<string, GpsInfo> ToGpsPointsDictionary(
this ICollection<GpsInfo> gpsinfos,
bool ltsactivitypoi = false
)
{
//ODHActivityPoi should already pass
if (!ltsactivitypoi)
Expand All @@ -22,37 +24,39 @@ public static IDictionary<string, GpsInfo> ToGpsPointsDictionary(this ICollectio
.ToDictionary(x => x.Gpstype!, x => x);
else
return new Dictionary<string, GpsInfo>();
}
}
//For LTS POI & LTS Activity
else
{
var gpspoints = new Dictionary<string, GpsInfo>();
var positioncount = 0;

foreach (var gpsinfo in gpsinfos)
{
{
string postionstr = "position";

if (positioncount > 0)
postionstr = postionstr + positioncount;

if (gpsinfo.Gpstype == "Endpunkt" || gpsinfo.Gpstype == "Bergstation")
gpspoints.Add("endposition", gpsinfo);

if (gpsinfo.Gpstype == "position" || gpsinfo.Gpstype == "Standpunkt" || gpsinfo.Gpstype == "Startpunkt" || gpsinfo.Gpstype == "Start und Ziel" || gpsinfo.Gpstype == "Talstation")
if (
gpsinfo.Gpstype == "position"
|| gpsinfo.Gpstype == "Standpunkt"
|| gpsinfo.Gpstype == "Startpunkt"
|| gpsinfo.Gpstype == "Start und Ziel"
|| gpsinfo.Gpstype == "Talstation"
)
gpspoints.Add(postionstr, gpsinfo);

positioncount = gpspoints.Where(x => x.Key == "position").Count();
}

return gpspoints;
}



}


//public IDictionary<string, GpsInfo> GpsPoints
//{
// get
Expand All @@ -69,6 +73,5 @@ public static IDictionary<string, GpsInfo> ToGpsPointsDictionary(this ICollectio
// }
// }
//}

}
}
1 change: 0 additions & 1 deletion DataModel/JsonBData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,3 @@ public class RawDataStore
public string raw { get; set; }
}
}

12 changes: 10 additions & 2 deletions DataModel/JsonRaw.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ public override void WriteJson(JsonWriter writer, JsonRaw? value, JsonSerializer
writer.WriteRawValue(value.Value);
}

public override JsonRaw ReadJson(JsonReader reader, Type objectType, JsonRaw? existingValue, bool hasExistingValue, JsonSerializer serializer)
public override JsonRaw ReadJson(
JsonReader reader,
Type objectType,
JsonRaw? existingValue,
bool hasExistingValue,
JsonSerializer serializer
)
{
string json = reader.ReadAsString();
return new JsonRaw(json);
Expand Down Expand Up @@ -49,7 +55,9 @@ public void AddParameter(IDbCommand command, string name)

public override string? ToString()
{
throw new InvalidOperationException("ToString on JsonRaw shouldn't be called, there is somewhere an implicit ToString() happening (maybe from a manual JSON serialization).");
throw new InvalidOperationException(
"ToString on JsonRaw shouldn't be called, there is somewhere an implicit ToString() happening (maybe from a manual JSON serialization)."
);
}

public static explicit operator JsonRaw(string x) => new JsonRaw(x);
Expand Down
4 changes: 3 additions & 1 deletion DataModel/JsonResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public class JsonResultWithOnlineResultsAndResultIdLowercase<T> : IResponse<T>
public int onlineResults { get; set; }
public string? resultId { get; set; }
public IEnumerable<T> items { get; set; } = Enumerable.Empty<T>();

[JsonIgnore]
public IEnumerable<T> Items => items;
}
Expand All @@ -62,7 +63,8 @@ public class SearchResult<T> : IResponse<T>
{
public uint totalResults { get; set; }
public string? searchTerm { get; set; }
public Dictionary<string, uint> detailedResults { get; set; } = new Dictionary<string, uint>();
public Dictionary<string, uint> detailedResults { get; set; } =
new Dictionary<string, uint>();
public IEnumerable<T> Items { get; set; } = Enumerable.Empty<T>();
}

Expand Down
21 changes: 12 additions & 9 deletions DataModel/MssResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ public class MssResult
public string? CheapestChannel { get; set; }
public double? Cheapestprice { get; set; }
public int? bookableHotels { get; set; }
public virtual ICollection<MssResponseShort> MssResponseShort { get; set; } = new HashSet<MssResponseShort>();
public virtual ICollection<MssResponseShort> MssResponseShort { get; set; } =
new HashSet<MssResponseShort>();
}

public class MssResponseShort
Expand Down Expand Up @@ -48,7 +49,6 @@ public MssResponseShort()
public virtual ICollection<RoomDetails> RoomDetails { get; set; } = new List<RoomDetails>();

public virtual ICollection<CheapestRoomCombination> CheapestOfferDetail { get; set; }

}

public class RoomDetails
Expand All @@ -69,14 +69,17 @@ public class RoomDetails

//Zusatz RoomMax
public int? Roommax { get; set; }

//Zusatz RoomMin
public int? Roommin { get; set; }

//Zusatz RoomStd
public int? Roomstd { get; set; }

public string? Roomtitle { get; set; }
public string? Roomdesc { get; set; }
public string? RoomChannelLink { get; set; }

//public string Service { get; set; }

public string? TotalPriceString { get; set; }
Expand Down Expand Up @@ -121,7 +124,7 @@ public class CancelPolicy
public DateTime? RefundableUntil { get; set; }
public string? Description { get; set; }

public List<Penalty> Penalties { get; set; } //=> new List<Penalty>();
public List<Penalty> Penalties { get; set; } //=> new List<Penalty>();
}

public class Penalty
Expand All @@ -140,7 +143,6 @@ public class CheapestOffer
public int? RoomFree { get; set; }
}


public class CheapestRoomCombination
{
public CheapestRoomCombination()
Expand All @@ -155,14 +157,15 @@ public double Price
{
get
{
return this.CheapestRoomCombinationDetail != null && this.CheapestRoomCombinationDetail.Count > 0 ? this.CheapestRoomCombinationDetail.Sum(x => x.Price) : 0;
return
this.CheapestRoomCombinationDetail != null
&& this.CheapestRoomCombinationDetail.Count > 0
? this.CheapestRoomCombinationDetail.Sum(x => x.Price)
: 0;
}
}
}


//TODO
public class MssResponseComplete
{
}
public class MssResponseComplete { }
}
8 changes: 3 additions & 5 deletions DataModel/PushServerModels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ namespace DataModel
{
public class PushServerMessage
{
public PushServerMessage()
{

}
public PushServerMessage() { }

public string? title { get; set; }
public string? text { get; set; }
Expand All @@ -33,6 +30,7 @@ public PushServerCustomMessage()
public string text { get; set; }

public PushServerCustom custom { get; set; }

//public Dictionary<string, string> image { get; set; }
//public Dictionary<string, string> video { get; set; }
public Dictionary<string, List<string>> destination { get; set; }
Expand All @@ -45,4 +43,4 @@ public class PushServerCustom
public string listName { get; set; }
public string listOwner { get; set; }
}
}
}
45 changes: 9 additions & 36 deletions DataModel/ReducedModels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,50 +8,23 @@ namespace DataModel
{
#region ReducedClasses

public class LTSActivityLinkedReduced : LTSActivityLinked
{
public class LTSActivityLinkedReduced : LTSActivityLinked { }

}
public class LTSPoiLinkedReduced : LTSPoiLinked { }

public class LTSPoiLinkedReduced : LTSPoiLinked
{
public class LTSODHActivityPoiReduced : ODHActivityPoiLinked { }

}
public class AccommodationLinkedReduced : AccommodationLinked { }

public class LTSODHActivityPoiReduced : ODHActivityPoiLinked
{
public class EventLinkedReduced : EventLinked { }

}
public class GastronomyLinkedReduced : GastronomyLinked { }

public class AccommodationLinkedReduced : AccommodationLinked
{
public class MeasuringpointLinkedReduced : MeasuringpointLinked { }

}
public class WebcamInfoLinkedReduced : WebcamInfoLinked { }

public class EventLinkedReduced : EventLinked
{

}

public class GastronomyLinkedReduced : GastronomyLinked
{

}

public class MeasuringpointLinkedReduced : MeasuringpointLinked
{

}

public class WebcamInfoLinkedReduced : WebcamInfoLinked
{

}

public class DDVenueReduced : DDVenue
{

}
public class DDVenueReduced : DDVenue { }

#endregion
}
Loading

0 comments on commit 2d9400f

Please sign in to comment.