Exemplo n.º 1
0
        public ActionResult ShulView(int ShulID)
        {
            ShulViewModel model = new ShulViewModel();

            model.ZVM = new ZmanimViewModel()
            {
                ShulID = ShulID
            };
            model.Shul = db.Shuls.Find(ShulID);
            //model.Zmanim = model.Shul.Zmanim.ToList() ?? null;
            return(View(model));
        }
Exemplo n.º 2
0
        public ActionResult AddZman(ShulViewModel model)
        {
            Shul shul = db.Shuls.Find(model.ZVM.ShulID);
            Zman zman = new Zman();

            zman.Days = model.ZVM.Days;
            if (model.ZVM.Time != null)
            {
                zman.Time = model.ZVM.Time;
            }
            else
            {
                zman.OtherTime = model.ZVM.OtherTime;
            }
            zman.Prayer = model.ZVM.Prayer;

            shul.Zmanim.Add(zman);
            db.SaveChanges();
            return(RedirectToAction("ShulView", new { model.ZVM.ShulID }));
        }