public ActionResult Pdh(Pdh modelo) { if (ModelState.IsValid) { var vc = new Clases.VisitasDao(); var usuario = Session["Usuario"].ToString(); modelo.StrEmail = usuario; var res = vc.AddPdh(modelo, out _strMensaje); if (res) { ViewBag.mensaje = _strMensaje; return(View()); } else { ViewBag.Error = _strMensaje; return(View()); } } else { ViewBag.Error = "Los datos no estan completos"; return(View()); } }
public static PdhCounter AddCounter(this PdhQuery query, string path) { Pdh .PdhAddEnglishCounter(query, path, IntPtr.Zero, out var counter) .EnsureSuccess(nameof(Pdh.PdhAddEnglishCounter)); return(counter); }
public static unsafe int EstimateFormattedCounterArraySize(this PdhCounter counter) { var size = 0; var status = Pdh.PdhGetFormattedCounterArray(counter, DefaultFmt, ref size, out _, null); if (status != PdhStatus.PDH_CSTATUS_VALID_DATA && status != PdhStatus.PDH_MORE_DATA) { FailWithError(PdhStatus.PDH_MORE_DATA, nameof(Pdh.PdhGetFormattedCounterArray)); } return(size); }
public bool AddPdh(Pdh model, out string strMensaje) { try { var parametros = new List <SqlParameter>() { new SqlParameter("@strEmail", model.StrEmail), new SqlParameter("@idTipoVisita", TpVisitas.Pdh), new SqlParameter("@strNombre", model.StrNombre), new SqlParameter("@strObservacion", model.StrObservacion) }; var mensaje = new SqlParameter("@strMensaje", SqlDbType.VarChar, 100) { Direction = ParameterDirection.Output }; var respuesta = new SqlParameter("@logRespuesta", SqlDbType.Bit) { Direction = ParameterDirection.Output }; var id = new SqlParameter("@numCodigo", SqlDbType.BigInt) { Direction = ParameterDirection.Output }; parametros.Add(mensaje); parametros.Add(respuesta); parametros.Add(id); var res = _datahelper.EjecutarSp <bool>("sp_vtAddVisitasMobil", parametros); if (res) { strMensaje = mensaje.Value.ToString(); return(Convert.ToBoolean(respuesta.Value)); } else { strMensaje = "No hay conexion con el servidor"; return(false); } } catch (Exception ex) { strMensaje = ex.Message; return(false); } }
protected override bool ReleaseHandle() => Pdh.PdhCloseQuery(handle) == PdhStatus.PDH_CSTATUS_VALID_DATA;
public static PdhQuery OpenRealtimeQuery() { Pdh.PdhOpenQuery(null, IntPtr.Zero, out var pdhQuery).EnsureSuccess(nameof(Pdh.PdhOpenQuery)); return(pdhQuery); }
public static unsafe PdhStatus GetFormattedCounterArray(this PdhCounter counter, ref int bufferSize, out int itemCount, PDH_FMT_COUNTERVALUE_ITEM *buffer) => Pdh.PdhGetFormattedCounterArray(counter, DefaultFmt, ref bufferSize, out itemCount, buffer);
public static unsafe PdhStatus GetRawCounterArray(this PdhCounter counter, ref int bufferSize, out int itemCount, PDH_RAW_COUNTER_ITEM *buffer) => Pdh.PdhGetRawCounterArray(counter, ref bufferSize, out itemCount, buffer);
public static PdhStatus GetFormattedValue(this PdhCounter counter, out PDH_FMT_COUNTERVALUE value) => Pdh.PdhGetFormattedCounterValue( counter, DefaultFmt, out _, out value);
public static PdhStatus CollectQueryData(this PdhQuery query) => Pdh.PdhCollectQueryData(query);
private void Init() { Pdh.PdhOpenQuery(null, IntPtr.Zero, out pdhQuery).EnsureSuccess(nameof(Pdh.PdhOpenQuery)); pdhCounter = pdhQuery.AddCounter(path); }