private void CargarDatos() { E_REPORTE_MAXIMO_MINIMO oDatosReporte = ContextoReportes.oReporteMaximoMinimo.Where(t => t.ID_REPORTE == vIdReporte).FirstOrDefault(); int empleados, stock; ConsultasFYDNegocio neg = new ConsultasFYDNegocio(); vIdPuesto = oDatosReporte.ID_PUESTO_OBJETIVO; oListaReporte = neg.ReporteMaximosMinimos(out empleados, out stock, vIdPuesto); SPE_OBTIENE_M_PUESTO_Result oPuesto = neg.ObtienePuestos(ID_PUESTO: vIdPuesto).FirstOrDefault(); vNoEmpleados = empleados; vNoStock = stock; txtClavePuesto.Text = oPuesto.CL_PUESTO; txtNombrePuesto.Text = oPuesto.NB_PUESTO; txtNoOcupantes.Text = vNoEmpleados.ToString(); txtReorden.Text = oDatosReporte.NO_PUNTO_REORDEN.ToString(); txtStock.Text = vNoStock.ToString(); txtCapacitar.Text = ((oDatosReporte.NO_DIAS_CURSO * oDatosReporte.NO_ROTACION_PROMEDIO) / 30).ToString(); if (vNoStock > oDatosReporte.NO_PUNTO_REORDEN) { lblMensaje.Visible = false; txtStock.ReadOnlyStyle.BackColor = System.Drawing.Color.Green; } else if (vNoStock < oDatosReporte.NO_PUNTO_REORDEN) { txtStock.ReadOnlyStyle.BackColor = System.Drawing.Color.Red; txtStock.ReadOnlyStyle.ForeColor = System.Drawing.Color.White; lblMensaje.InnerText = "Es momento de programar un curso para desarrollar el puesto"; lblMensaje.Visible = true; } else { txtStock.ReadOnlyStyle.BackColor = System.Drawing.Color.Yellow; lblMensaje.InnerText = "Es momento de programar un curso para desarrollar el puesto"; lblMensaje.Visible = true; } }
protected void btnMaximosMinimos_Click(object sender, EventArgs e) { Guid vIdReporte = Guid.NewGuid(); if (ContextoReportes.oReporteMaximoMinimo == null) { ContextoReportes.oReporteMaximoMinimo = new List <E_REPORTE_MAXIMO_MINIMO>(); } E_REPORTE_MAXIMO_MINIMO oReporte = new E_REPORTE_MAXIMO_MINIMO(); oReporte.ID_PUESTO_OBJETIVO = int.Parse(rlbPuesto.Items[0].Value); oReporte.ID_REPORTE = vIdReporte; oReporte.NO_DIAS_CURSO = int.Parse(txtDiasCurso.Text); oReporte.NO_PORCENTAJE_NO_APROBADOS = int.Parse(txtPorcentaje.Text); oReporte.NO_PUNTO_REORDEN = int.Parse(txtReorden.Text); oReporte.NO_ROTACION_PROMEDIO = int.Parse(txtRotacion.Text); ContextoReportes.oReporteMaximoMinimo.Add(oReporte); string script = "OpenMaximosMinimosWindow(\"" + vIdReporte + "\");"; ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", script, true); }