protected void FillDataTable() { try { DataTable dtData = new DataTable(); dtData = ManagerDB.GetInstance().DTExecute(Constants.DB_SEL_METRICS, DateTime.Now.AddDays(-1).ToString("yyyy/MM/dd"), DateTime.Now.ToString("yyyy/MM/dd")); dtDetails.ItemsSource = dtData.DefaultView; dtDetails.DataContext = dtData; } catch (Exception ex) { MessageBox.Show(ex.Message); } }
protected void BindData(string fechaIni, string fechaFin) { try { DataTable dtData = new DataTable(); dtData = ManagerDB.GetInstance().DTExecute(Constants.DB_SEL_METRICS, fechaIni, fechaFin); grdMetrics.DataSource = dtData; grdMetrics.DataBind(); } catch (Exception ex) { throw ex; } }
protected void FillReports() { try { ddlReports.DataSource = ManagerDB.GetInstance().GetReports(); ddlReports.DataTextField = "Nam_Reports"; ddlReports.DataValueField = "Id_Reports"; ddlReports.DataBind(); ddlReports.Items.Insert(0, "Seleccione"); } catch (Exception ex) { throw ex; } }
protected void FillReportTableCosts() { try { DataTable dtResult = new DataTable(); dtResult = ManagerDB.GetInstance().SelReportCostos(Convert.ToDateTime(Session["fechaInicio"]).ToString("yyyyMMdd HH:mm:ss"), Convert.ToDateTime(Session["fechaFin"]).ToString("yyyyMMdd HH:mm:ss")); grdCosts.DataSource = dtResult; grdCosts.DataBind(); FillPerdidaChart(ManagerDB.GetInstance().SelReportCostosPerdida(Convert.ToDateTime(Session["fechaInicio"]).ToString("yyyyMMdd HH:mm:ss"), Convert.ToDateTime(Session["fechaFin"]).ToString("yyyyMMdd HH:mm:ss"))); FillPerdProdChart(ManagerDB.GetInstance().SelReportCostosPerdidaPorProduccion(Convert.ToDateTime(Session["fechaInicio"]).ToString("yyyyMMdd HH:mm:ss"), Convert.ToDateTime(Session["fechaFin"]).ToString("yyyyMMdd HH:mm:ss"))); } catch (Exception ex) { throw ex; } }
protected void FillReportTableGraphic(int option) { try { DataTable dtResult = new DataTable(); dtResult = ManagerDB.GetInstance().SelReportOEE(Convert.ToDateTime(Session["fechaInicio"]).ToString("yyyyMMdd HH:mm:ss"), Convert.ToDateTime(Session["fechaFin"]).ToString("yyyyMMdd HH:mm:ss")); ViewState["dtGrid"] = dtResult; if (option == 1) { DataRow[] SortTop10 = dtResult.Select().OrderByDescending(c => c["OEE"]).Take(10).ToArray(); DataTable dtTop10 = SortTop10.CopyToDataTable(); grdTop10.DataSource = dtTop10; grdTop10.DataBind(); DataRow[] SortBot10 = dtResult.Select().OrderBy(c => c["OEE"]).Take(10).ToArray(); DataTable dtBot10 = SortBot10.CopyToDataTable(); grdBottom10.DataSource = dtBot10; grdBottom10.DataBind(); grdEficienciaGlobal.DataSource = dtResult; grdEficienciaGlobal.DataBind(); } else if (option == 2) { grdTableOEE.DataSource = dtResult; grdTableOEE.DataBind(); FillOEEChart(dtResult); FillCalidadChart(dtResult); FillDesempenoChart(dtResult); FillDisponibilidadChart(dtResult); } } catch (Exception ex) { throw ex; } }
private void btnSearch_Click(object sender, RoutedEventArgs e) { try { if ((dpStartdate.Text != "") && (dpEnddate.Text != "")) { string start = DateTime.Parse(dpStartdate.Text).ToString("yyyy/MM/dd"); string end = DateTime.Parse(dpEnddate.Text).ToString("yyyy/MM/dd"); DataTable dtData = new DataTable(); dtData = ManagerDB.GetInstance().DTExecute(Constants.DB_SEL_METRICS, start, end); dtDetails.ItemsSource = dtData.DefaultView; dtDetails.DataContext = dtData; } else { MessageBox.Show("Los campos Fecha Inicio y Fecha Fin deben llevar valor."); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
protected void btnLogin_Click(object sender, EventArgs e) { try { DataTable Result = new DataTable(); Result = ManagerDB.GetInstance().ValidateUser(inputEmail.Value.ToString(), inputPassword.Value.ToString()); if (Result != null) { if (Result.Rows.Count > 0) { Session["Id_User"] = Result.Rows[0][0].ToString(); Response.Redirect("frmReports.aspx"); } else { msgError.Text = "Usuario y/o Contraseña incorrectos"; } } } catch (Exception ex) { throw ex; } }