Пример #1
0
        public ActionResult UpdateSimcha(List <UpdatedInfo> person)
        {
            TempData["PopUp"] = "New Contributions made";
            var NewAdd     = new List <UpdatedInfo>();
            var UpdateOnly = new List <UpdatedInfo>();
            var Old        = manager.ContributorList(person[0].SimchaID);

            foreach (UpdatedInfo p in person)
            {
                Contributor c = Old.FirstOrDefault(x => x.ID == p.ContributorID);
                if (c != null && p.DidContribute)
                {
                    UpdateOnly.Add(p);
                }
                else if (c == null && p.DidContribute)
                {
                    NewAdd.Add(p);
                }
            }
            manager.AddContributor(NewAdd);
            manager.UpdateContribution(UpdateOnly);
            return(Redirect("/"));
        }