protected void ddlSucursal_SelectedIndexChanged(object sender, EventArgs e) { if (ddlSucursal.SelectedValue != string.Empty) { ViewState["sucursal"] = ddlSucursal.SelectedValue; epps = Mgr_Epp.Get_Epp(0, Convert.ToInt32(ddlSucursal.SelectedValue)); cantiEpp = epps.Count; if (cantiEpp > 0) { agregar_ingresos(epps); agregar_egresos(epps); agregar_existencia(epps); btnCalcular.Enabled = true; phInformacion.Visible = true; phNoRegistros.Visible = false; } else { phInformacion.Visible = false; phNoRegistros.Visible = true; } } else { ViewState["sucursal"] = "0"; } }
private void agregar_fila() { int intContInspecciones = 0; intContInspecciones = Convert.ToInt32(cantInspecciones.Value); eppTrab = Mgr_Epp.Get_Epp(Convert.ToInt32(ddlPuesto.SelectedValue)); ControlesDinamicos.Add_Fila_InspeccionUsoEpp(pnDatos, intContInspecciones, eppTrab); }
private void agregar_fila() { TableCell _cell; TableRow _row; Label _label; TextBox _textbox; int id_puesto_trabajo = Mgr_PuestoTrabajo.GetId_PuestoTrabajador(Convert.ToInt32(ddlTrabajador.SelectedValue)); List <Model_CEPP> epps = Mgr_Epp.Get_Epp(id_puesto_trabajo); int cont = 0; foreach (var epp in epps) { _row = new TableRow(); _cell = new TableCell(); _label = new Label(); _label.ID = "lbl" + cont; _label.Text = epp.nombre; _cell.Controls.Add(_label); _row.Controls.Add(_cell); _cell = new TableCell(); _textbox = new TextBox(); _textbox.ID = "txtDet" + cont; _textbox.CssClass = "form-control"; _textbox.TextMode = TextBoxMode.MultiLine; _textbox.Rows = 2; _cell.Controls.Add(_textbox); _row.Controls.Add(_cell); _cell = new TableCell(); _textbox = new TextBox(); _textbox.ID = "txtCant" + cont; _textbox.CssClass = "form-control"; _textbox.TextMode = TextBoxMode.Number; _cell.Controls.Add(_textbox); _row.Controls.Add(_cell); _cell = new TableCell(); _textbox = new TextBox(); _textbox.ID = "txtFech" + cont; _textbox.CssClass = "form-control"; _textbox.Text = DateTime.Now.ToString("yyyy-MM-dd"); _textbox.TextMode = TextBoxMode.Date; _cell.Controls.Add(_textbox); _row.Controls.Add(_cell); tb_datos.Controls.Add(_row); cont++; } }
protected void Page_Load(object sender, EventArgs e) { Page.Form.Attributes.Add("enctype", "multipart/form-data"); ObjUsuario = Utilidades.ValidarSesion(HttpContext.Current.User.Identity as FormsIdentity, this); phAlerta.Visible = false; BoolEmpSuc = Mgr_Empresa.Get_Empresa_Sucursal(ObjUsuario); phEmpresa.Visible = BoolEmpSuc.Item1; phSucursal.Visible = BoolEmpSuc.Item2; if (!IsPostBack) { CargarListas(); } else { foreach (var ctlID in Page.Request.Form.AllKeys) { if (ctlID != null) { Control c = Page.FindControl(ctlID) as Control; if (c is Button) { if (c.ClientID.Contains("btnDocumento")) { epps = Mgr_Epp.Get_Epp(0, Convert.ToInt32(ddlSucursal.SelectedValue)); cantiEpp = epps.Count; agregar_ingresos(epps); agregar_egresos(epps); agregar_existencia(epps); } else if (c.ClientID.Contains("btnCalcular")) { epps = Mgr_Epp.Get_Epp(0, Convert.ToInt32(ddlSucursal.SelectedValue)); cantiEpp = epps.Count; agregar_ingresos(epps); agregar_egresos(epps); agregar_existencia(epps); } } } } } }
protected void ddlPuesto_SelectedIndexChanged(object sender, EventArgs e) { if (ddlPuesto.SelectedValue != string.Empty) { ViewState["puesto"] = ddlPuesto.SelectedValue; List <Model_CEPP> epp = Mgr_Epp.Get_Epp(Convert.ToInt32(ddlPuesto.SelectedValue)); if (epp.Count > 0) { phInformacion.Visible = true; } else { phNoRegistros.Visible = true; } } else { ViewState["puesto"] = "0"; } }
protected void btnBuscar_OnClick(object sender, EventArgs e) { if (ddlTrabajador.SelectedValue != string.Empty) { ViewState["trabajador"] = ddlTrabajador.SelectedValue; eppTrab = Mgr_Epp.Get_Epp(Convert.ToInt32(ddlPuesto.SelectedValue)); if (eppTrab.Count > 0) { phInformacion.Visible = true; cantInspecciones.Value = eppTrab.Count.ToString(); agregar_fila(); } else { phNoRegistros.Visible = true; } } else { ViewState["trabajador"] = string.Empty; } }
protected void btnGenerar_Click(object sender, EventArgs e) { RadioButton _radio; Table _table; int contFal = 0; TableRow row = new TableRow(); row = (TableHeaderRow)pnEpp.FindControl("EPPFaltante"); row.Visible = false; row = (TableHeaderRow)pnEpp.FindControl("SenalFaltante"); row.Visible = false; int i = 0; _table = (Table)pnEpp.FindControl("tblEPP"); List <Model_CEPP> epp_datos = Mgr_Epp.Get_Epp(Convert.ToInt32(ddlPuesto.SelectedValue)); foreach (var dato in epp_datos) { _radio = (RadioButton)pnEpp.FindControl("eppNo" + i); if (_radio.Checked) { row = new TableRow(); TableCell cell = new TableCell(); cell.Text = " " + dato.nombre; row.Controls.Add(cell); _table.Controls.Add(row); row = (TableHeaderRow)pnEpp.FindControl("EPPFaltante"); row.Visible = true; contFal++; } i++; } ViewState["EppFalt"] = contFal; contFal = 0; List <Model_CEPP> tipo_epp_datos = Mgr_Epp.Get_TipoEpp(Convert.ToInt32(ddlPuesto.SelectedValue)); i = 0; Table _table2 = new Table(); _table2 = (Table)pnEpp.FindControl("tblSenal"); foreach (var dato in tipo_epp_datos) { _radio = (RadioButton)pnEpp.FindControl("tpoNo" + i); if (_radio.Checked) { row = new TableRow(); TableCell cell = new TableCell(); cell.Text = " " + dato.nombre; row.Controls.Add(cell); _table2.Controls.Add(row); row = (TableHeaderRow)pnEpp.FindControl("SenalFaltante"); row.Visible = true; contFal++; } i++; } ViewState["SenalFalt"] = contFal; contFal = 0; phinicial.Visible = false; phGenerarDocumento.Visible = true; }