public ActionResult CreateOrEdit(int?id = null, string formView = null, string funcRefresh = null)
        {
            Person dto;

            if (id == null)
            {
                dto = Repository_person.New(formView, funcRefresh);
            }
            else
            {
                dto             = Repository_person.Find(id.GetValueOrDefault());
                dto.formView    = formView;
                dto.funcRefresh = funcRefresh;
            }

            return(PartialView(dto));
        }
Esempio n. 2
0
        public IActionResult CreateOrEdit(int?id = null, string formView = null, string funcRefresh = null)
        {
            Person dto;

            if (id.HasValue)
            {
                dto = _db.Find(id.GetValueOrDefault());
                if (dto == null)
                {
                    return(HttpNotFound());
                }
                dto.formView    = formView;
                dto.funcRefresh = funcRefresh;
            }
            else
            {
                dto = _db.New(formView, funcRefresh);
            }

            return(PartialView(dto));
        }