/// <summary> /// Copy Constructor /// </summary> public GOUserDataObject(GOUserDataObject template, bool deepCopy) { this.SetPasswordExpiryValue(template.PasswordExpiry, false, false); this._passwordExpiry_WithTimezoneOffset = template._passwordExpiry_WithTimezoneOffset; this.SetBlockedValue(template.Blocked, false, false); this.SetEmailAddressValue(template.EmailAddress, false, false); this.SetEmailValidatedValue(template.EmailValidated, false, false); this.SetFirstNameValue(template.FirstName, false, false); this.SetFullNameValue(template.FullName, false, false); this.SetIdValue(template.Id, false, false); this.SetLastNameValue(template.LastName, false, false); this.SetPasswordValue(template.Password, false, false); this.SetUnregisteredValue(template.Unregistered, false, false); this.SetUserNameValue(template.UserName, false, false); this.SetUserValidatedValue(template.UserValidated, false, false); this._userProfile_NewObjectId = template._userProfile_NewObjectId; this.SetIsNewValue(template.IsNew, false, false); if (deepCopy) { this.ObjectsDataSet = template.ObjectsDataSet.Clone(); // Remove the template object from the dataset this.ObjectsDataSet.RemoveObject(template); // And Replace by the one we're currently constructing this.ObjectsDataSet.AddObject(this); } this.SetIsDirtyValue(template.IsDirty, false, false); this.SetIsMarkedForDeletionValue(template.IsMarkedForDeletion, false, false); }
/// <summary> /// Copy Constructor /// </summary> public VisitedPlaceDataObject(VisitedPlaceDataObject template, bool deepCopy) { this.SetDateValue(template.Date, false, false); this._date_WithTimezoneOffset = template._date_WithTimezoneOffset; this.SetCountryURIValue(template.CountryURI, false, false); this.SetDescriptionValue(template.Description, false, false); this.SetIdValue(template.Id, false, false); this.SetPlaceURIValue(template.PlaceURI, false, false); this.SetTypeofplaceValue(template.Typeofplace, false, false); this.SetUserProfileUriValue(template.UserProfileUri, false, false); this._country_NewObjectId = template._country_NewObjectId; this._place_NewObjectId = template._place_NewObjectId; this._userProfile_NewObjectId = template._userProfile_NewObjectId; this.SetIsNewValue(template.IsNew, false, false); if (deepCopy) { this.ObjectsDataSet = template.ObjectsDataSet.Clone(); // Remove the template object from the dataset this.ObjectsDataSet.RemoveObject(template); // And Replace by the one we're currently constructing this.ObjectsDataSet.AddObject(this); } this.SetIsDirtyValue(template.IsDirty, false, false); this.SetIsMarkedForDeletionValue(template.IsMarkedForDeletion, false, false); }
public override System.Web.Mvc.ActionResult UpdateTruckArrival(int id, System.DateTimeOffset?truckArrivalTime, System.DateTimeOffset appointmentTime) { var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateTruckArrival); ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id); ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "truckArrivalTime", truckArrivalTime); ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "appointmentTime", appointmentTime); UpdateTruckArrivalOverride(callInfo, id, truckArrivalTime, appointmentTime); return(callInfo); }
public Object( string id, IBaseUser author, System.DateTimeOffset?createdAt, string data) { Id = id; Author = author; CreatedAt = createdAt; Data = data; }
public OwnerFormStub(owner dbItem) : this() { this.Id = dbItem.id; this.Code = dbItem.code; this.Name = dbItem.name; this.CreatedBy = dbItem.created_by; this.CreatedTime = dbItem.created_time; this.UpdatedBy = dbItem.updated_by; this.UpdatedTime = dbItem.updated_time; this.IdCity = (int)dbItem.id_city; }
//protected string ConvertDataParam(System.DateTime? dt) //{//例如:yyyy-mm-dd // if (dt.HasValue) // //速卖通使用的是 UTC-7 的时区 // return dt.Value.ToUniversalTime().AddHours(-7).ToString("yyyy-MM-dd"); // else // return null; //} protected string ConvertDataParam(System.DateTimeOffset?dt) {//例如:yyyy-mm-dd if (dt.HasValue) { //速卖通使用的是 UTC-7 的时区 //return dt.Value.ToUniversalTime().AddHours(-7).ToString("yyyy-MM-dd"); return(dt.Value.ToOffset(new TimeSpan(-7, 0, 0)).ToString("yyyy-MM-dd")); } else { return(null); } }
protected string ConvertTimeParam(System.DateTimeOffset?dt) {//格式: mm/dd/yyyy hh:mm:ss,如10/09/2013 00:00:00 if (dt.HasValue) { //速卖通使用的是 UTC-7 的时区 //return dt.Value.ToUniversalTime().AddHours(-7).ToString("MM\\/dd\\/yyyy HH:mm:ss"); return(dt.Value.ToOffset(new TimeSpan(-7, 0, 0)).ToString("MM\\/dd\\/yyyy HH:mm:ss")); } else { return(null); } }
public static System.DateTime?ToDateTimeNullable(this System.DateTimeOffset? dto) { System.DateTime?dt; if (dto.HasValue) { dt = (System.DateTime?)dto.Value.DateTime; } else { dt = null; } return(dt); }
/// <summary> /// Creates a new PeekedMessage instance for mocking. /// </summary> public static PeekedMessage PeekedMessage( string messageId, BinaryData message, long dequeueCount, System.DateTimeOffset?insertedOn = default, System.DateTimeOffset?expiresOn = default) { return(new PeekedMessage() { MessageId = messageId, Body = message, DequeueCount = dequeueCount, InsertedOn = insertedOn, ExpiresOn = expiresOn, }); }
/// <summary> /// Helps to update the ItemsSource of Day column by excluding weekend days. /// </summary> /// <param name="Date">The SelectedDateTime value of DateTimeSpinnerBase.</param> /// <param name="column">The day column.</param> /// <returns>The day column ItemsSource.</returns> private IEnumerable <object> RemoveWeekendItems(System.DateTimeOffset?Date, SpinnerColumn column) { var itemsSource = new List <object>(); foreach (var item in column.ItemsSource) { int day = int.Parse(item.ToString()); if (day <= DateTime.DaysInMonth(Date.Value.Year, Date.Value.Month)) { var dateTime = new DateTime(Date.Value.Year, Date.Value.Month, day); if (dateTime.DayOfWeek != DayOfWeek.Saturday && dateTime.DayOfWeek != DayOfWeek.Sunday) { itemsSource.Add(item); } } } return(itemsSource); }
/// <summary> /// Creates a new QueueMessage instance for mocking. /// </summary> public static QueueMessage QueueMessage( string messageId, string popReceipt, BinaryData body, long dequeueCount, System.DateTimeOffset?nextVisibleOn = default, System.DateTimeOffset?insertedOn = default, System.DateTimeOffset?expiresOn = default) { return(new QueueMessage() { MessageId = messageId, PopReceipt = popReceipt, Body = body, DequeueCount = dequeueCount, NextVisibleOn = nextVisibleOn, InsertedOn = insertedOn, ExpiresOn = expiresOn, }); }
/// <summary> /// Copy Constructor /// </summary> public GOLoginHistoryDataObject(GOLoginHistoryDataObject template, bool deepCopy) { this.SetTimestampValue(template.Timestamp, false, false); this._timestamp_WithTimezoneOffset = template._timestamp_WithTimezoneOffset; this.SetIdValue(template.Id, false, false); this.SetInfoValue(template.Info, false, false); this.SetResultValue(template.Result, false, false); this.SetUserValue(template.User, false, false); this.SetIsNewValue(template.IsNew, false, false); if (deepCopy) { this.ObjectsDataSet = template.ObjectsDataSet.Clone(); // Remove the template object from the dataset this.ObjectsDataSet.RemoveObject(template); // And Replace by the one we're currently constructing this.ObjectsDataSet.AddObject(this); } this.SetIsDirtyValue(template.IsDirty, false, false); this.SetIsMarkedForDeletionValue(template.IsMarkedForDeletion, false, false); }
// //Display Profile Dataplan Status information // string GetDataPlanStatusInfo(DataPlanStatus dataPlan) { string dataplanStatusInfo = string.Empty; dataplanStatusInfo = "Dataplan Status Information:\n"; dataplanStatusInfo += "====================\n"; if (dataPlan == null) { dataplanStatusInfo += "Dataplan Status not available\n"; return(dataplanStatusInfo); } if (dataPlan.DataPlanUsage != null) { dataplanStatusInfo += "Usage In Megabytes : " + dataPlan.DataPlanUsage.MegabytesUsed + "\n"; dataplanStatusInfo += "Last Sync Time : " + dataPlan.DataPlanUsage.LastSyncTime + "\n"; } else { dataplanStatusInfo += "Usage In Megabytes : Not Defined\n"; } ulong?inboundBandwidth = dataPlan.InboundBitsPerSecond; if (inboundBandwidth.HasValue) { dataplanStatusInfo += "InboundBitsPerSecond : " + inboundBandwidth + "\n"; } else { dataplanStatusInfo += "InboundBitsPerSecond : Not Defined\n"; } ulong?outboundBandwidth = dataPlan.OutboundBitsPerSecond; if (outboundBandwidth.HasValue) { dataplanStatusInfo += "OutboundBitsPerSecond : " + outboundBandwidth + "\n"; } else { dataplanStatusInfo += "OutboundBitsPerSecond : Not Defined\n"; } uint?dataLimit = dataPlan.DataLimitInMegabytes; if (dataLimit.HasValue) { dataplanStatusInfo += "DataLimitInMegabytes : " + dataLimit + "\n"; } else { dataplanStatusInfo += "DataLimitInMegabytes : Not Defined\n"; } System.DateTimeOffset?nextBillingCycle = dataPlan.NextBillingCycle; if (nextBillingCycle.HasValue) { dataplanStatusInfo += "NextBillingCycle : " + nextBillingCycle + "\n"; } else { dataplanStatusInfo += "NextBillingCycle : Not Defined\n"; } uint?maxTransferSize = dataPlan.MaxTransferSizeInMegabytes; if (maxTransferSize.HasValue) { dataplanStatusInfo += "MaxTransferSizeInMegabytes : " + maxTransferSize + "\n"; } else { dataplanStatusInfo += "MaxTransferSizeInMegabytes : Not Defined\n"; } return(dataplanStatusInfo); }
public virtual async Task<ItemResult<WeatherDataDtoGen>> GetWeatherAsync([FromServices] Coalesce.Domain.AppDbContext parameterDbContext, LocationDtoGen location, System.DateTimeOffset? dateTime) { IncludeTree includeTree = null; var methodResult = await Service.GetWeatherAsync(parameterDbContext, location.MapToModel(new Coalesce.Domain.Services.Location(), new MappingContext(User)), dateTime); var result = new ItemResult<WeatherDataDtoGen>(); var mappingContext = new MappingContext(User, ""); result.Object = Mapper.MapToDto<Coalesce.Domain.Services.WeatherData, WeatherDataDtoGen>(methodResult, mappingContext, includeTree); return result; }
public static string ToFhirDateTime(this System.DateTimeOffset?me) => me.HasValue ? PrimitiveTypeConverter.ConvertTo <string>(me) : null;
public static string ToFhirDate(this System.DateTimeOffset?me) => me.HasValue ? me.Value.ToString("yyyy-MM-dd") : null;
/// <summary> /// When used as part of a LINQ to Entities query, this method return the given date with the time portion cleared. /// </summary> /// <param name="dateValue"></param> /// <returns></returns> public static System.DateTimeOffset?TruncateTime(System.DateTimeOffset? dateValue) { throw new NotImplementedException(); }
/// <summary> /// When used as part of a LINQ to Entities query, this method return the given date with the time portion cleared. /// </summary> /// <param name="dateValue"></param> /// <returns></returns> public static System.DateTimeOffset?TruncateTime(System.DateTimeOffset? dateValue) { if (dateValue.HasValue == false) { return(default);
public static System.Int32?DiffDays(System.DateTimeOffset? dateValue1, System.DateTimeOffset? dateValue2) { throw new NotImplementedException(); }
public List <Read_Only_GetNarsStatusModel> Read_Only_GetNarsStatuss(System.Data.DataTable groupNames, System.Data.DataTable htrStatus, System.DateTimeOffset?issuedStartDateTime, System.DateTimeOffset?issuedEndDateTime, string teamCode, string subTeamCode, out int procResult) { var groupNamesParam = new System.Data.SqlClient.SqlParameter { ParameterName = "@Group_Names", SqlDbType = System.Data.SqlDbType.Structured, Direction = System.Data.ParameterDirection.Input, Value = groupNames, TypeName = "dbo.StringTable" }; if (groupNamesParam.Value == null) { groupNamesParam.Value = System.DBNull.Value; } var htrStatusParam = new System.Data.SqlClient.SqlParameter { ParameterName = "@Htr_Status", SqlDbType = System.Data.SqlDbType.Structured, Direction = System.Data.ParameterDirection.Input, Value = htrStatus, TypeName = "dbo.StringTable" }; if (htrStatusParam.Value == null) { htrStatusParam.Value = System.DBNull.Value; } var issuedStartDateTimeParam = new System.Data.SqlClient.SqlParameter { ParameterName = "@Issued_Start_Date_Time", SqlDbType = System.Data.SqlDbType.DateTimeOffset, Direction = System.Data.ParameterDirection.Input, Value = issuedStartDateTime.GetValueOrDefault() }; if (!issuedStartDateTime.HasValue) { issuedStartDateTimeParam.Value = System.DBNull.Value; } var issuedEndDateTimeParam = new System.Data.SqlClient.SqlParameter { ParameterName = "@Issued_End_Date_Time", SqlDbType = System.Data.SqlDbType.DateTimeOffset, Direction = System.Data.ParameterDirection.Input, Value = issuedEndDateTime.GetValueOrDefault() }; if (!issuedEndDateTime.HasValue) { issuedEndDateTimeParam.Value = System.DBNull.Value; } var teamCodeParam = new System.Data.SqlClient.SqlParameter { ParameterName = "@Team_Code", SqlDbType = System.Data.SqlDbType.VarChar, Direction = System.Data.ParameterDirection.Input, Value = teamCode, Size = 10 }; if (teamCodeParam.Value == null) { teamCodeParam.Value = System.DBNull.Value; } var subTeamCodeParam = new System.Data.SqlClient.SqlParameter { ParameterName = "@Sub_Team_Code", SqlDbType = System.Data.SqlDbType.VarChar, Direction = System.Data.ParameterDirection.Input, Value = subTeamCode, Size = 10 }; if (subTeamCodeParam.Value == null) { subTeamCodeParam.Value = System.DBNull.Value; } var procResultParam = new System.Data.SqlClient.SqlParameter { ParameterName = "@procResult", SqlDbType = System.Data.SqlDbType.Int, Direction = System.Data.ParameterDirection.Output }; var procResultData = Database.SqlQuery <Read_Only_GetNarsStatusModel>("EXEC @procResult = [dbo].[get_nars_status] @Group_Names, @Htr_Status, @Issued_Start_Date_Time, @Issued_End_Date_Time, @Team_Code, @Sub_Team_Code", groupNamesParam, htrStatusParam, issuedStartDateTimeParam, issuedEndDateTimeParam, teamCodeParam, subTeamCodeParam, procResultParam).ToList();; procResult = (int)procResultParam.Value; return(procResultData); }
public void InvokeProcedureWithDateParams_Expect_CorrectResultFromDb() { System.DateTime? pDatecol = DateTime.Now; System.DateTime? pTimestampcol = DateTime.Now; System.DateTime? pDatedefaultcol = DateTime.Now; System.DateTime? pDatedefault2Col = DateTime.Now; System.DateTime? pTimestampdefaultcol = DateTime.Now; System.DateTime? pTimestampdefault2Col = DateTime.Now; System.DateTimeOffset?pTimestamptzcol = DateTimeOffset.Now; System.DateTime? pTimestampltzzcol = DateTime.Now; decimal?pIntervalYearToMonth = 50; System.TimeSpan?pIntervalDayToSec = new TimeSpan(20, 15, 10, 5); _db.TypeDateProc( pDatecol, pTimestampcol, pDatedefaultcol, pDatedefault2Col, pTimestampdefaultcol, pTimestampdefault2Col, pTimestamptzcol, pTimestampltzzcol, pIntervalYearToMonth, pIntervalDayToSec, out var xDatecol, out var xTimestampcol, out var xDatedefaultcol, out var xDatedefault2Col, out var xTimestampdefaultcol, out var xTimestampdefault2Col, out var xTimestamptzcol, out var xTimestampltzzcol, out var xIntervalYearToMonth, out var xIntervalDayToSec ); Assert.NotNull(xDatecol); // we can't directly compare System.DateTime to Oracle Date. Oracle Date does not have ms precision. Assert.AreEqual(xDatecol.Value.ToString("s"), pDatecol.Value.ToString("s")); Assert.NotNull(xTimestampcol); // we can't directly compare System.DateTime to Oracle Timestamp(6). System.DateTime has precision 7 and default Oracle Timestamp has 6. // Expected: 636609705670488750 -> passing through Oracle and back to .NET // But was: 636609705670488748 -> original value Assert.AreEqual(RoundOneDigit(xTimestampcol.Value.Ticks), RoundOneDigit(xTimestampcol.Value.Ticks)); Assert.NotNull(xDatecol); Assert.AreEqual(xDatedefaultcol.Value.ToString("s"), pDatedefaultcol.Value.ToString("s")); Assert.NotNull(xDatecol); Assert.AreEqual(xDatedefault2Col.Value.ToString("s"), pDatedefault2Col.Value.ToString("s")); Assert.NotNull(xTimestampdefaultcol); Assert.AreEqual(RoundOneDigit(xTimestampdefaultcol.Value.Ticks), RoundOneDigit(pTimestampdefaultcol.Value.Ticks)); Assert.NotNull(xTimestampdefault2Col); Assert.AreEqual(RoundOneDigit(xTimestampdefault2Col.Value.Ticks), RoundOneDigit(pTimestampdefault2Col.Value.Ticks)); Assert.NotNull(xTimestamptzcol); Assert.AreEqual(RoundOneDigit(xTimestamptzcol.Value.Ticks), RoundOneDigit(pTimestamptzcol.Value.Ticks)); Assert.AreEqual(xTimestamptzcol.Value.Offset.Ticks, pTimestamptzcol.Value.Offset.Ticks); Assert.NotNull(xTimestampltzzcol); Assert.AreEqual(RoundOneDigit(xTimestampltzzcol.Value.Ticks), RoundOneDigit(pTimestampltzzcol.Value.Ticks)); Assert.AreEqual(xIntervalYearToMonth, pIntervalYearToMonth); Assert.AreEqual(xIntervalDayToSec.Value.Ticks, pIntervalDayToSec.Value.Ticks); }
public void SetValue(System.DateTimeOffset?dateTimeOffset) { Value = dateTimeOffset; }
public override System.Web.Mvc.HttpStatusCodeResult SetDateOfCargoReceipt(long id, System.DateTimeOffset?dateOfCargoReceipt) { var callInfo = new T4MVC_System_Web_Mvc_HttpStatusCodeResult(Area, Name, ActionNames.SetDateOfCargoReceipt); ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id); ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "dateOfCargoReceipt", dateOfCargoReceipt); SetDateOfCargoReceiptOverride(callInfo, id, dateOfCargoReceipt); return(callInfo); }
partial void SetDateOfCargoReceiptOverride(T4MVC_System_Web_Mvc_HttpStatusCodeResult callInfo, long id, System.DateTimeOffset?dateOfCargoReceipt);
public async System.Threading.Tasks.Task <IPagedResponseDtoOfProductDataResponseDto> GetListAsync(string barcode, System.DateTimeOffset?modificationDate, System.DateTimeOffset?modifiedStartDate, System.DateTimeOffset?modifiedEndDate, IList <Include31> include, int?limit, int?offset) { string url = BaseUrl.ToString(); url = url.AppendPathSegment("/v2/products"); if (barcode != null) { url = url.SetQueryParam("barcode", barcode); } if (modificationDate != null) { url = url.SetQueryParam("modificationDate", modificationDate.Value.ToString("s")); } if (modifiedStartDate != null) { url = url.SetQueryParam("modifiedStartDate", modifiedStartDate.Value.ToString("s")); } if (modifiedEndDate != null) { url = url.SetQueryParam("modifiedEndDate", modifiedEndDate.Value.ToString("s")); } if (include != null) { url = url.SetQueryParam("include", string.Join(",", include).ToLower(), true); } if (limit != null) { url = url.SetQueryParam("limit", limit); } if (offset != null) { url = url.SetQueryParam("offset", offset); } return(await url .WithHeader("Authorization", $"Basic {Convert.ToBase64String(Encoding.UTF8.GetBytes(":" + websericeKey))}") .GetJsonAsync <IPagedResponseDtoOfProductDataResponseDto>()); }
partial void UpdateTruckArrivalOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id, System.DateTimeOffset?truckArrivalTime, System.DateTimeOffset appointmentTime);
public List <WrapperGetNarsStatusReturnModel> WrapperGetNarsStatus(System.Data.DataTable groupNames, System.Data.DataTable htrStatus, System.DateTimeOffset?issuedStartDateTime, System.DateTimeOffset?issuedEndDateTime, string teamCode, string subTeamCode) { int procResult; return(WrapperGetNarsStatus(groupNames, htrStatus, issuedStartDateTime, issuedEndDateTime, teamCode, subTeamCode, out procResult)); }
public RangeDateTime(System.DateTimeOffset?lower, System.DateTimeOffset?upper) { this.LowerBound = lower; this.UpperBound = upper; }