#91 updating user new fields

This commit is contained in:
Hamid Reza Mohammadi 2021-03-19 11:12:20 +03:30
parent bcbed7a68a
commit 5cc7a14bee

View File

@ -845,6 +845,13 @@ namespace RSecurityBackend.Services.Implementation
}
}
if(isAdmin.Result != updateUserInfo.IsAdmin)
{
return new RServiceResult<bool>(false, "امکان تغییر وضعیت مدیر کاربر از طریق این تابع وجود ندارد.");
}
if (existingInfo.UserName != updateUserInfo.Username)
{
@ -853,18 +860,28 @@ namespace RSecurityBackend.Services.Implementation
if(anotheruserWithUserName != null)
{
return new RServiceResult<bool>(false, "کلمه عبور تکراری می باشد");
return new RServiceResult<bool>(false, "کلمهٔ عبور تکراری می باشد");
}
existingInfo.UserName = updateUserInfo.Username;
}
if(updateUserInfo.RImageId != null && updateUserInfo.RImageId != Guid.Empty && updateUserInfo.RImageId != existingInfo.RImageId)
{
return new RServiceResult<bool>(false, "برای تغییر تصویر کاربر از تابع اختصاصی این کار استفاده کنید");
}
existingInfo.FirstName = updateUserInfo.FirstName;
existingInfo.SureName = updateUserInfo.SureName;
existingInfo.Email = updateUserInfo.Email;
existingInfo.PhoneNumber = updateUserInfo.PhoneNumber;
existingInfo.Status = updateUserInfo.Status;
existingInfo.Bio = updateUserInfo.Bio;
existingInfo.NickName = updateUserInfo.NickName;
existingInfo.Website = updateUserInfo.Website;
if (!string.IsNullOrEmpty(updateUserInfo.Password))
{