Beispiel #1
0
        public ActionResult CreateCenter(Center center)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    _centerManager.Add(center);
                    ViewBag.message = "Center Created Sucessfully";
                }
            }
            catch (Exception ex)
            {
                ViewBag.message = ex.Message;
            }
            SelectList alist = new SelectList(_centerManager.GetAllDistricts(), "Id", "Name");

            ViewBag.allDistricts = alist;
            return(RedirectToAction("CreateCenterLogin", new { centerId = center.Id }));
        }
        public async Task <ActionResult> Create(Center center)
        {
            await Manager.Add(center);

            return(RedirectToAction(nameof(ShowCenter)));
        }