Exemple #1
0
        public JsonResult SaveTipo(TipoLocalFormModel tipo)
        {
            TipoLocal tipoLocal = null;

            tipoLocal = tipo.Id == Guid.Empty
                ? new TipoLocal()
                : _localService.GetTipo(tipo.Id);

            tipoLocal.Detalle = tipo.Detalle;
            tipoLocal.Estado  = _statusService.Get(tipo.EstadoId);
            if (tipoLocal.Id == Guid.Empty)
            {
                tipoLocal.CreadoEn  = DateTime.Now;
                tipoLocal.CreadoPor = User.Identity.Name;
            }

            tipoLocal.ActualizadoEn  = DateTime.Now;
            tipoLocal.ActualizadoPor = User.Identity.Name;

            var confirmation = _localService.SaveOrUpdateTipo(tipoLocal);

            return(Json(confirmation.WasSuccessful));
        }