Hi, I have a calendar control to receive the Date of Birth of the person. The application zone is set to Beirut which is +2 GMT. On the server, I am using Utc Provider.
So, let's say the user selects his birthday as 4/11/2000, since I am using PrimeNG date picker, I see the date stored in the DB as 3/11/2000 21:00:00. (In summer, we are +3 GMT)
Next time, I want to edit the record, also, the Date of Birth shows as 4/11/2000.
Now, when I want to export the data to Excel, because I had the need to use PIVOTs in TSQL, so I am using a DataTable to read the data from the SQL (calling a Stored Procedure).
When I export the data, I see the Date of Birth field as 3/11/2000
Here is the code I am using to parse and format date in Excel:
case "System.DateTime":
var dateTime = (DateTime?)pocDataTable.Rows[r][columnName];
DateTime? tempDateTime = null;
if (dateTime.HasValue)
{
tempDateTime = Clock.Normalize(dateTime.Value);
}
value = _timeZoneConverter.Convert(tempDateTime);
break;
Hi, I am running my application on a new laptop. I installed the database via update-database command and then tried to run the app. I get the following exception:
"Cannot insert explicit value for identity column in table 'XXX' when IDENTITY_INSERT is set to OFF."
The exception occurs on this line:
var parent = _context.SpecificNeeds.Add(new SpecificNeed("Child at risk")).Entity;
_context.SaveChanges();
All was working fine on the previous machine.
Any idea what might be the problem?
Hello, Is there a place to explain more about the new license checking in the 5.x version? What are the rules that shouldn't be violated, etc.
For instance, one of the things I read is about developer count. If I have my code over 2 machines one at home and one at the office, does that count as 2 developers or 1?
Thank you Bilal
Hello, I am searching the code to see where the AddApplied is being used. I am adding a new Interceptor and need to check if the "CrossCuttingConcern" is applied.
Thank you
Hello, I am facing a new issue with DateTimes. I am using ASP.NET Core / Angular 2.
On the server, I've configured the server to use UtcProvider. On the client, I've configured the application for UTC+02:00 (Beirut) timezone.
When a date is sent to the server something like 22/10/2017 00:00:00 it gets stored as 21/10/2017 21:00:00. The point is, I've selected a UTC+02:00 so logically the dates should be stored at 21/10/2017 22:00:00. However, given the Day Light thingy, I assume that was taken into consideration when converting to the user's timezone. Correct?
Now on the server, all dates are usually returned as moment.Moment instances.
The calendar I am using (Primeng Calendar) render the date correctly.
When it is time to display a date as a string, I am using several formats as follows:
<span>{{ poc.dateofBirth | momentFormat:'DD-MM-YYYY' }}</span><br/>
21-10-1980
<span>{{ poc.DateofBirth.format() }}</span><br/>
1980-10-21T23:00:00+02:00
<span>{{ poc.dateofBirth.toDate() }}</span><br/>
Tue Oct 22 1980 00:00:00 GMT+0300 (GTB Daylight Time)
<span>{{ abp.timing.convertToUserTimezone(poc.dateofBirth.toDate()) }}</span>
Mon Oct 21 1980 23:00:00 GMT+0200
Notice how the first renders 21 and not 22. Also the second is related to first and renders accordingly with timezone offset of +02:00. The third renders correctly taking into consideration machine's timezone and not the one configured for the application. The fourth also is behaving as the first 2.
If the server is interpreting the application's timezone (UTC+02:00 Beirut) and taking into consideration the Day Light changes, and storing the data in the DB as 21/10/2017 21:00:00 (current time - 3 hours). Why is the client using moment() not taking into consideration the Day Light changes and hence showing the time to be 23:00:00 instead of 00:00:00 and hence a correct Date.
I really appreciate your assistance.
I've posted before on GitHub: <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/issues/2606">https://github.com/aspnetboilerplate/as ... ssues/2606</a>
Bottom line, the timezones in the app are:
In the DB: Middle East Standard Time On the client: abp.timing.timeZoneInfo.iana.timeZoneId is Asia/Beirut
MEST could be a range according to this document: <a class="postlink" href="http://www.timetemperature.com/middleeast/middle_east_time_zones.shtml">http://www.timetemperature.com/middleea ... ones.shtml</a>
Thanks
Hi,
Where are the associated css/js/ts files related to the Modal being used in the template? I am in need to change the width of the Modal and I not able to see where those files are.
Thanks
<div bsModal #viewModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="viewModal"
aria-hidden="true" [config]="{backdrop: 'static'}">
Hello In Abp, is there a standard way to intercept AppService or DomainManager so that I run some checking code before running the method?
The concept is similar to ASP. NET filters. I'm wondering if Abp offers a way to define such interceptors.
If not. An ASP. NET filter can be used for AppService methods?
Thanks
Hi, For the ASP.NET Core / Angular project (v 4.3.0)
I have an entity that defines 2 properties of type User.
public virtual User RcmMember { get; set; }
public virtual long RcmMemberId { get; set; }
public virtual User RcmCoordinator { get; set; }
public virtual long RcmCoordinatorId { get; set; }
In the DbContext, I have the following:
modelBuilder.Entity<Assignment>().ToTable("Assignments").HasIndex(r => new { r.ReferralId, r.Id }).IsUnique();
modelBuilder.Entity<Assignment>().Property(p => p.AssignmentDate).IsRequired();
modelBuilder.Entity<Assignment>().Property(p => p.TransportationId).IsRequired();
modelBuilder.Entity<Assignment>().Property(p => p.ServiceId).IsRequired();
modelBuilder.Entity<Assignment>().Property(p => p.State).IsRequired();
modelBuilder.Entity<Assignment>().Property(p => p.Comments).HasMaxLength(550);
modelBuilder.Entity<Assignment>().Property(p => p.RcmMemberComments).HasMaxLength(550);
modelBuilder.Entity<Assignment>().Property(p => p.RcmCoordinatorComments).HasMaxLength(550);
modelBuilder.Entity<Assignment>()
.HasOne(e => e.RcmCoordinator)
.WithMany()
.HasForeignKey(e => e.RcmCoordinatorId);
modelBuilder.Entity<Assignment>()
.HasOne(e => e.RcmMember)
.WithMany()
.HasForeignKey(e => e.RcmMemberId);
When I receive the Dto from the client, the RcmMemberId has a value for a valid User Id (the logged-in user would have selected a valid user created in the application from a dropdown list).
Upon running this line of code, I get an exception:
The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Assignments_AbpUsers_RcmMemberId". The conflict occurred in database "AppDb1", table "dbo.AbpUsers", column 'Id'.
The statement has been terminated.
The code that is causing the exception:
[UnitOfWork]
public async Task CreateAsync(UserIdentifier user, Assignment input)
{
// Assign an Rcm Coordinator
input.RcmCoordinatorId = user.UserId;
// Insert the record
await _repo.InsertAsync(input);
try
{
await CurrentUnitOfWork.SaveChangesAsync();
}
catch (Exception ex)
{
var s = ex.ToString();
}
[UnitOfWork]
public async Task CreateAsync(UserIdentifier user, Assignment input)
{
// check if there is any collision
// TODO
//CheckCollision(input);
// Assign an Rcm Coordinator
input.RcmCoordinatorId = user.UserId;
// Insert the record
await _repo.InsertAsync(input);
try
{
await CurrentUnitOfWork.SaveChangesAsync();
}
catch (Exception ex)
{
var s = ex.ToString();
}
// Trigger the Workflow
await AssignToMember(input);
}
}
Hello,
For some reason, the application is not logging anything in the Log.txt file.
I even deleted the log file and then the application is not creating a new one.
Any hints to where I should be looking to help resolve this issue?
Thanks
Hi, I would like to add a new functionality to my app in a sense I will need to build Manager classes and use repositories. The module might or might not need to expose AppServices.
How shall I organize this new module? Shall it contain also layers like Core, AppService, etc. Or what? How to add dependencies, etc.
If you have a sample module you have created so that I could have a look at it.
Thank you Bilal