Exemplo n.º 1
0
        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));
        }
Exemplo 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));
        }