private async Task <bool> AddUserExtraInfoIntoTable(string userid)
        {
            var userextarinfo = new UserExtraInfoModel
            {
                UserId    = userid,
                Activated = false,
                Suspended = false
            };

            _context.UserExtraInfo.Add(userextarinfo);

            var result = await _context.SaveChangesAsync();

            return(result > 0 ? true : false);
        }
Beispiel #2
0
 public ActionResult AssignOutlet(long outletId, string userId)
 {
     if (outletId > 0)
     {
         UserExtraInfoModel user = _context.UserExtraInfo.Find(userId);
         var outlet = GetOneOutlet(outletId);
         if (outlet.Managers == null)
         {
             List <UserExtraInfoModel> managers = new List <UserExtraInfoModel>();
             outlet.Managers = managers;
         }
         outlet.Managers.Add(user);
         _context.Entry(outlet).State = System.Data.Entity.EntityState.Modified;
         _context.SaveChanges();
         return(RedirectToAction("Index", "Company"));
     }
     return(View());
 }