public static ResultadoLaboratorio guardarResultadoLab(ResultadoLaboratorio resultadoLab) { try { using (SqlCommand sentencia = new SqlCommand()) { sentencia.Connection = PrincipalUI.Cnxion; sentencia.CommandType = System.Data.CommandType.StoredProcedure; sentencia.CommandText = Sentencias.CREAR_RESULTADO_LAB; sentencia.Parameters.Add(new SqlParameter("@pIdResultado", SqlDbType.Int)).Value = resultadoLab.codigoResultado; sentencia.Parameters.Add(new SqlParameter("@pIdSolicitud", SqlDbType.Int)).Value = resultadoLab.idSolicitud; sentencia.Parameters.Add(new SqlParameter("@pFechaMuestra", SqlDbType.DateTime)).Value = resultadoLab.fechaMuestra; sentencia.Parameters.Add(new SqlParameter("@pFechaResultado", SqlDbType.DateTime)).Value = resultadoLab.fechaResultado; sentencia.Parameters.Add(new SqlParameter("@pObervacion", SqlDbType.NVarChar)).Value = resultadoLab.observacion; sentencia.Parameters.Add(new SqlParameter("@pIdUsuarioOrigen", SqlDbType.Int)).Value = Sesion.IdUsuario; sentencia.Parameters.Add(new SqlParameter("@pAuditoria", SqlDbType.Int)).Value = resultadoLab.auditoria; sentencia.Parameters.Add(new SqlParameter("@pTblExamen", SqlDbType.Structured)).Value = resultadoLab.dtResultado; resultadoLab.codigoResultado = (int)sentencia.ExecuteScalar(); } } catch (Exception ex) { throw ex; } return(resultadoLab); }
public ResultadoLaboratorio AgregarResultadoLaboratorio(ResultadoLaboratorio resultadoLaboratorio) { using (var cnx = Conexion.Open) { cnx.ResultadoLaboratorio.InsertOnSubmit(resultadoLaboratorio); cnx.SubmitChanges(); } return(resultadoLaboratorio); }
public JsonResult GetResultadoLaboratorio(long codigo) { ResultadoLaboratorio resultadoLaboratorio = resultadosLaboratorio.ObtenerResultadoLaboratorio(codigo); return(Json(new { Nombre = resultadoLaboratorio.Nombre, Marca = resultadoLaboratorio.Marca, Valor = resultadoLaboratorio.Valor, Unidad = resultadoLaboratorio.Unidad, }, JsonRequestBehavior.AllowGet)); }
public Boolean EditarResultadoLaboratorio(ResultadoLaboratorio resultadoLaboratorio) { using (var cnx = Conexion.Open) { var ResultadolaboratorioAux = cnx.ResultadoLaboratorio.FirstOrDefault(x => x.Codigo == resultadoLaboratorio.Codigo); ResultadolaboratorioAux.Nombre = resultadoLaboratorio.Nombre; ResultadolaboratorioAux.Marca = resultadoLaboratorio.Marca; ResultadolaboratorioAux.Valor = resultadoLaboratorio.Valor; ResultadolaboratorioAux.Unidad = resultadoLaboratorio.Unidad; cnx.SubmitChanges(); } return(true); }
public JsonResult EditarResultadoLaboratorio(FormCollection form) { int Marca = (int)form.GetValue("ResultadoLaboratorioRegistro.Marca").ConvertTo(typeof(int)); long Codigo = (long)form.GetValue("CodigoResultadoLaboratorio").ConvertTo(typeof(long)); String Nombre = (String)form.GetValue("ResultadoLaboratorioRegistro.Nombre").ConvertTo(typeof(String)); String Valor = (String)form.GetValue("ResultadoLaboratorioRegistro.Valor").ConvertTo(typeof(String)); String Unidad = (String)form.GetValue("ResultadoLaboratorioRegistro.Unidad").ConvertTo(typeof(String)); ResultadoLaboratorio resultadoLaboratorio = new ResultadoLaboratorio(); resultadoLaboratorio.Nombre = Nombre; resultadoLaboratorio.Marca = Marca; resultadoLaboratorio.Valor = Valor; resultadoLaboratorio.Unidad = Unidad; resultadoLaboratorio.Codigo = Codigo; Boolean resultado = resultadosLaboratorio.EditarResultadoLaboratorio(resultadoLaboratorio); return(Json(true)); }
public JsonResult GuardarResultadoLaboratorio(FormCollection form) { ValueProviderResult a = form.GetValue("ResultadoLaboratorioRegistro.Laboratorio"); long Laboratorio = (long)form.GetValue("ResultadoLaboratorioRegistro.Laboratorio").ConvertTo(typeof(long)); int Marca = (int)form.GetValue("ResultadoLaboratorioRegistro.Marca").ConvertTo(typeof(int)); String Nombre = (String)form.GetValue("ResultadoLaboratorioRegistro.Nombre").ConvertTo(typeof(String)); String Valor = (String)form.GetValue("ResultadoLaboratorioRegistro.Valor").ConvertTo(typeof(String)); String Unidad = (String)form.GetValue("ResultadoLaboratorioRegistro.Unidad").ConvertTo(typeof(String)); ResultadoLaboratorio resultadoLaboratorio = new ResultadoLaboratorio(); resultadoLaboratorio.Nombre = Nombre; resultadoLaboratorio.Marca = Marca; resultadoLaboratorio.Valor = Valor; resultadoLaboratorio.Unidad = Unidad; resultadoLaboratorio.Laboratorio = Laboratorio; resultadosLaboratorio.AgregarResultadoLaboratorio(resultadoLaboratorio); return(Json(true)); }