예제 #1
0
        public ActionResult Create(string editAction, string personalId)
        {
            PersonalDTO personalDTO = new PersonalDTO();

            try
            {
                switch (editAction)
                {
                case EditActionConstant.NEW:
                    ViewBag.Title = "Nuevo Usuario";
                    personalDTO.FechaNacimiento = DateTime.Now;
                    personalDTO.EditAction      = editAction;
                    break;

                case EditActionConstant.EDIT:
                    ViewBag.Title          = "Editar Usuario";
                    personalDTO            = personalService.GetPersonalId(Convert.ToInt32(personalId));
                    personalDTO.EditAction = editAction;
                    ListarPersonal(personalDTO.PersonalId);
                    break;
                }

                ListDropList();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(PartialView(personalDTO));
        }