public ActionResult AssignTeamMember(AssistantManagerToMemberViewModel relation)
        {
            try
            {
                var assistangManagerAsssigned = db.AssistantManagerToMemberRelations.Where(x => x.AssistantManagerId == relation.AssistantManagerId && x.TeamMemberId == null).FirstOrDefault();

                bool value = db.AssistantManagerToMemberRelations.Any(x => x.AssistantManagerId == relation.AssistantManagerId && x.TeamMemberId == relation.TeamMemberId);
                AssistantManagerToMemberRelation amr = new AssistantManagerToMemberRelation();

                if (assistangManagerAsssigned != null)
                {
                    assistangManagerAsssigned.TeamMemberId = relation.TeamMemberId;
                }
                else if (value != true)
                {
                    amr.AssistantManagerId = relation.AssistantManagerId;
                    amr.TeamMemberId       = relation.TeamMemberId;
                    db.AssistantManagerToMemberRelations.Add(amr);
                }

                db.SaveChanges();
                return(RedirectToAction("AssistantManagerIndex"));
            }
            catch (Exception e)
            {
                return(View("Error"));
            }
        }
        public ActionResult DeleteTeamMember(AssistantManagerToMemberViewModel relation)
        {
            AssistantManagerToMemberRelation am = db.AssistantManagerToMemberRelations.Where(u => u.AssistantManagerId == relation.AssistantManagerId && u.TeamMemberId == relation.TeamMemberId).FirstOrDefault();

            if (am != null)
            {
                db.AssistantManagerToMemberRelations.Remove(am);
            }
            db.SaveChanges();

            return(RedirectToAction("AssistantManagerIndex"));
        }