// GET: AUsers
        public ActionResult Index(string Email, string PhoneNumber, string Admin)
        {
            var list = userAppManager.FindAllUser();

            foreach (var item in list)
            {
                item.AspNetUserRole.RoleId = role.Get(item.AspNetUserRole.RoleId, null);
            }

            if (Email != null && Email != "")
            {
                ViewData["Email"] = Email;
                var listByEmail = list.Where(a => a.Email.Contains(Email));
                return(View(listByEmail));
            }
            else if (PhoneNumber != null && PhoneNumber != "")
            {
                ViewData["PhoneNumber"] = PhoneNumber;
                var listByPhoneNumber = list.Where(a => a.PhoneNumber == PhoneNumber);
                return(View(listByPhoneNumber));
            }
            else if (Admin != null && Admin != "")
            {
                var listByAdmin = list.Where(a => a.AspNetUserRole.RoleId == "Admin");
                return(View(listByAdmin));
            }

            return(View(list));
        }
示例#2
0
        protected override void Execute(CodeActivityContext context)
        {
            Template template = Template.Get(context);
            string   roleName = RoleName.Get(context);
            string   email    = Email.Get(context);
            string   name     = Name.Get(context);

            template.AddRole(new Role(roleName, name, email));
        }