Пример #1
0
        public ActionResult AddShul(ShulSetupViewModel model)
        {
            Shul shul = new Shul()
            {
                Name    = model.Name,
                Address = model.Address,
                City    = model.City,
                State   = model.State,
                Zip     = model.Zip,
                IDCity  = db.Cities.Find(model.CityCode),
                Website = model.Website,
                Phone   = model.Phone,
                Rabbi   = model.Rabbi,
                Email   = model.Email
            };

            if (model.OtherNusach == null)
            {
                shul.Nusach = model.Nusach;
            }
            else
            {
                shul.Nusach = model.OtherNusach;
            }
            db.Shuls.Add(shul);
            db.SaveChanges();
            return(RedirectToAction("AllShuls", new { id = model.CityCode }));
        }
Пример #2
0
        public ActionResult AddShul(int id)
        {
            ShulSetupViewModel shul = new ShulSetupViewModel();

            shul.CityCode = db.Cities.Find(id).CityID;
            return(View(shul));
        }