Hello i set the default culture to ar to the page should render from rtl but when i load the page for the first time it render from ltr so i must refresh the page to take effect and render from rtl as expected i made sure the cookies of Abp.Localization.CultureName have the value ar what i miss here ?
Hello
i'm trying to update record but must be sure to prevent updating some fields so i retrieve the old record before editing but i got this error nHandling.AbpApiExceptionFilterAttribute - Attaching an entity of type 'Umbrella.Models.Patient.Patient' failed because another entity of the same type already has the same primary key value. This can happen when using the 'Attach' method or setting the state of an entity to 'Unchanged' or 'Modified' if any entities in the graph have conflicting key values. This may be because some entities are new and have not yet received database-generated key values. In this case use the 'Add' method or the 'Added' entity state to track the graph and then set the state of non-new entities to 'Unchanged' or 'Modified' as appropriate.
protected virtual async Task EditRecordAsync(CreateOrEditPatientDto input)
{
Debug.Assert(input.Patient.Id != null, "input.Patient.Id should be set.");
var patient = input.Patient.MapTo<Models.Patient.Patient>();
//Make sure some fields not editied in patien object
var oldPatient = await _patientRepository.GetAsync(patient.Id);
patient.IsActive = oldPatient.IsActive;
patient.IsCertified = oldPatient.IsCertified;
patient.ParentId = oldPatient.ParentId;
patient.DateEnd = oldPatient.DateEnd;
await _patientRepository.UpdateAsync(patient); // the error been thrown at this line
await _unitOfWorkManager.Current.SaveChangesAsync();
input.User.Name = input.Patient.NameAr;
input.User.Surname = input.Patient.NameEn;
Debug.Assert(input.User.Id != null, "input.User.Id should be set.");
var user = await UserManager.FindByIdAsync(input.User.Id.Value);
//Update user properties
input.User.MapTo(user);
CheckErrors(await UserManager.UpdateAsync(user));
}
if i removed these lines it work fine
var oldPatient = await _patientRepository.GetAsync(patient.Id);
patient.IsActive = oldPatient.IsActive;
patient.IsCertified = oldPatient.IsCertified;
patient.ParentId = oldPatient.ParentId;
patient.DateEnd = oldPatient.DateEnd;
but i need to do this anyway what's wrong with my code as i faced this error many times ?
Hello everyone
i implement Odata against patient table and add the attribute [AbpApiAuthorize] to secure it to authenticated users , then tried to secure it to users how have the permissions on patient table by add attribute [AbpAuthorize(AppPermissions.Pages_Patient)] but unfortunately it didn't work how can i achieve that because not all authenticated users have the permissions to access such an information like that
PatientsController.cs
[AbpApiAuthorize]
[AbpAuthorize(AppPermissions.Pages_Patient)]
public class PatientsController : AbpODataEntityController<Patient, long>
{
private readonly IRepository<Patient, long> _repository;
public PatientsController(IRepository<Patient, long> repository)
: base(repository)
{
_repository = repository;
}
}
Hello everyone
i have a case that require all changes are saved together if one of them failed then rollback should be executed
the scenario is that i have a patient table that related to User table with a foreign key UserId so when the someone register on the system or from users page i have to create user first then patient the same way when creating a patient from patients pages i have to create user as well everything for now is just fine but i didn't sure if what i'm doing is correct but need to make sure when something happen when saving it should rollback all changes otherwise accept all changes please refer to this post [ <a class="postlink" href="http://stackoverflow.com/questions/815586/entity-framework-using-transactions-or-savechangesfalse-and-acceptallchanges#answer-815660">http://stackoverflow.com/questions/8155 ... wer-815660</a> ])
PatientAppService.cs
private readonly IPatientRepository _patientRepository;
private readonly IUserAppService _iUserAppService;
public PatientAppService(IPatientRepository patientRepository, IUserAppService iUserAppService)
{
_patientRepository = patientRepository;
_iUserAppService = iUserAppService;
}
[AbpAuthorize(AppPermissions.Pages_Patient_Create)]
protected virtual async Task CreateRecordAsync(CreateOrEditPatientDto input)
{
input.User.IsActive = true;
input.User.ShouldChangePasswordOnNextLogin = true;
if (string.IsNullOrEmpty(input.User.EmailAddress))
{
input.User.EmailAddress = string.Format("{0}{1}", input.User.UserName, "@hotmail.com");
}
CreateOrUpdateUserInput userInput = new CreateOrUpdateUserInput
{
AssignedRoleNames = new string[] { "user" },
SendActivationEmail = true,
SetRandomPassword = false,
User = input.User
};
await _iUserAppService.CreateOrUpdateUser(userInput);
var u = await UserManager.FindByNameAsync(input.User.UserName);
input.Patient.UserId = u.Id;
var patient = input.Patient.MapTo<Models.Patient.Patient>();
await _patientRepository.InsertAsync(patient);
}
Hello i noticed that password complexity setting not working in Register page although property
public PasswordComplexitySetting PasswordComplexitySetting { get; set; }
are defined in RegisterViewModel but still not working how can i fix it ?
Hello i tried to find localization file of module zero AbpZero.xml that contains some messages translation like Identity.DuplicateName , Identity.DuplicateEmail etc i checked this link but i can't find this file in my project [https://github.com/aspnetboilerplate/module-zero/blob/dev/src/Abp.Zero/Zero/Localization/Source/AbpZero.xml#L11])
actually i tried also to add these lines in my localization sources but it didn't work
<text name="Identity.DuplicateName" value="UserName already used" />
<text name="Identity.DuplicateEmail" value="Email Address already used" />
Hello i want to know the mechanism used to prevent duplication of username and email address in ABP , i noticed that no unique index was used for them so how does it work , how can i do the same for mobile field in the same way , i don't want to duplicate the same mobile number in the same tenant that's why i don't need to use unique index thank you
Hello Can anyone tell me the easiest way to Change String Max length of Name & Surname in AbpUser<TUser> from 32 to 100 ?
Hello everyone i read on your road map that your are going to provide the system with a basic cms and i wondering which text editor you are planning to use
can you please recommend for me a rich text editor to use in my spa application that support image uploading and has many properties to set to uploaded images also i need a file uploader that support multiple files
Hello Suppose that we are in Users Page, then open the ui-modal to insert new user , i noticed that if you tried to navigate to another page by pressing go back or go forward (browser's buttons) it will take you there ( previous page ) but the modal still showing up. try yourself to get the point clearly so my question is how to terminate $uibModalInstance when new page is loaded ?