private AdminUpdateSupplierRoleViewModel AssignSupplierDetailsForUpdate(SupplierViewModel record) { if (record == null || String.IsNullOrWhiteSpace(record.Id)) return null; var itemToUpdate = new AdminUpdateSupplierRoleViewModel() { UserId = record.Id, Email = record.Email, Status = record.Status, UserRoles = db.Roles.OrderBy(x => x.Name).ToList() }; if (itemToUpdate == null || String.IsNullOrWhiteSpace(itemToUpdate.UserId)) return null; return itemToUpdate; }
public ApplicationUser AdminUpdateSupplierStatus(AdminUpdateSupplierRoleViewModel item, string status) { var record = db.Users.Where(x => x.Id == item.UserId).FirstOrDefault(); if (record == null || String.IsNullOrWhiteSpace(record.Id)) return null; var itemToUpdate = AssignUserStatusForUpdate(record, status); if (itemToUpdate == null || String.IsNullOrWhiteSpace(itemToUpdate.Id)) return null; return itemToUpdate; }