public ActionResult Insert(VMParametroGeneral model) { var result = new Resultado(); try { if (string.IsNullOrEmpty(model.ParametroGeneral.S_Descripcion)) { return(View(model)); } model.ParametroGeneral.N_IDUnidad = VMDatosUsuario.GetUUserIdUnidad(); model.ParametroGeneral.S_Tipo = "U"; model.ParametroGeneral.S_UsuarioCreacion = VMDatosUsuario.GetUserAlias(); model.ParametroGeneral.S_Estado = "A"; var Resultado = _ParametroGeneralService.Insert(model.ParametroGeneral); result.Codigo = Resultado.N_IDParametroGeneral; } catch (System.Exception ex) { result.EsExito = false; result.Mensaje = ex.Message; return(View()); } return(Json(result)); }
public ActionResult Update(VMParametroGeneral model) { var result = new Resultado(); try { if (string.IsNullOrEmpty(model.ParametroGeneral.S_Descripcion)) { return(View(model)); } model.ParametroGeneral.S_UsuarioModificacion = VMDatosUsuario.GetUserAlias(); model.ParametroGeneral.S_Estado = model.ParametroGeneral.S_Estado.Equals("True") ? "A" : "I"; var Resultado = _ParametroGeneralService.Update(model.ParametroGeneral); result.Codigo = Resultado.N_IDParametroGeneral; } catch (System.Exception ex) { result.EsExito = false; result.Mensaje = ex.Message; return(View()); } return(Json(result)); }