public ActionResult ChooseForm()
        {
            if (!Authorize())
            {
                return(RedirectToAction("RedirectByUser", "Home"));
            }
            User          usr    = (User)Session["CurrentUser"];
            GroupsDal     grpdal = new GroupsDal();
            List <string> a      = (from Groups g in grpdal.groups
                                    where usr.UserName == g.Client
                                    select g.Developer1).ToList <string>();

            a.AddRange((from Groups g in grpdal.groups
                        where usr.UserName == g.Client
                        select g.Developer2).ToList <string>());
            a.AddRange((from Groups g in grpdal.groups
                        where usr.UserName == g.Client
                        select g.Developer2).ToList <string>());
            HashSet <string> b = new HashSet <string>();

            foreach (string c in a)
            {
                b.Add(c);
            }
            FormDal     frmdal = new FormDal();
            List <Form> formss = (from Form f in frmdal.Forms
                                  where b.Contains(f.NameOfUser)
                                  select f).ToList <Form>();
            VMForms fff = new VMForms {
                forms = formss
            };

            return(View(fff));
        }
Exemple #2
0
 public GroupsLogic()
 {
     this.dal = new GroupsDal();
 }