private void Form_Load(object sender, EventArgs e) { try { this.lbOperador.Text = lu.NomEmpleado; this.lbPuesto.Text = lu.DesPuesto; this.lbPlanta.Text = lu.DesPlanta; this.lbProceso.Text = "Vaciado - Captura Inicial"; DataSet ods = null; DataRow dr = null; ComboBox cbxObj = null; clsVaciado oConfigInicial = new clsVaciado(); ods = oConfigInicial.getCentroTrabajo(lu.CodPlanta.ToString()); //dtObj = da.ObtenerPantallasProceso(iCodProceso); dr = ods.Tables[0].NewRow(); dr["centrotrabajo"] = -1; dr["descentrotrabajo"] = "Seleccionar..."; ods.Tables[0].Rows.InsertAt(dr, 0); cbxObj = this.cbxCentroTrabajos; cbxObj.ValueMember = "centrotrabajo"; cbxObj.DisplayMember = "descentrotrabajo"; cbxObj.DataSource = ods.Tables[0]; cbxObj.SelectedValue = -1; this.txOperador.Focus(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } }
private void txSupervisor_LostFocus(object sender, EventArgs e) { try { clsVaciado ovaciado = new clsVaciado(); DataSet ods = ovaciado.getNumSupervisor(txOperador.Text, txSupervisor.Text); if (ods.Tables.Count == 0 || ods.Tables[0].Rows.Count == 0 || Convert.ToInt32(ods.Tables[0].Rows[0][0]) == 0) { this.lbMensaje.Text = "Supervisor No Encotrado!"; return; } valOperador = txOperador.Text; this.lbMensaje.Text = ""; } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } }
private void cbxCentroTrabajos_SelectedIndexChanged(object sender, EventArgs e) { try { DataTable dtObj = null; DataRow dr = null; ComboBox cbxObj = null; ComboBox cbxProceso = (ComboBox)sender; int iCodProceso = Convert.ToInt32(cbxProceso.SelectedValue); clsVaciado oConfigInicial = new clsVaciado(); dtObj = oConfigInicial.getBanco(lu.CodPlanta.ToString(), iCodProceso.ToString()).Tables[0]; //dtObj = da.ObtenerPantallasProceso(iCodProceso); dr = dtObj.NewRow(); dr["clavemaquina"] = "-1"; dr["desmaquina"] = "Seleccionar..."; dtObj.Rows.InsertAt(dr, 0); cbxObj = this.cbxBancos; cbxObj.DataSource = dtObj; cbxObj.ValueMember = "clavemaquina"; cbxObj.DisplayMember = "desmaquina"; cbxObj.SelectedValue = -1; if (iCodProceso != -1) { this.txSupervisor.Focus(); } else { this.txPosicionInicial.Focus(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } }
private void btContinuar_Click(object sender, EventArgs e) { try { if (lbMensaje.Text != "") { return; } if (string.IsNullOrEmpty(this.txOperador.Text)) { this.lbMensaje.Text = "Ingrese el Operador"; this.txOperador.Focus(); } else if (string.IsNullOrEmpty(this.txSupervisor.Text)) { this.lbMensaje.Text = "Ingrese el Supervisor"; this.txSupervisor.Focus(); } else if (Convert.ToInt32(this.cbxCentroTrabajos.SelectedValue) == -1) { this.lbMensaje.Text = "Seleccione un Centro trab."; this.cbxCentroTrabajos.Focus(); } else if (this.cbxBancos.SelectedValue.ToString() == "-1") { this.lbMensaje.Text = "Seleccione un Banco"; this.cbxBancos.Focus(); } else if (string.IsNullOrEmpty(this.txPosicionInicial.Text)) { this.lbMensaje.Text = "Ingrese una Pos. Inicial"; this.txPosicionInicial.Focus(); } else { clsVaciado ovaciado = new clsVaciado(); ovaciado.Operador = this.txOperador.Text; ovaciado.Supervisor = this.txSupervisor.Text; ovaciado.CentroTrabajo = Convert.ToInt32(this.cbxCentroTrabajos.SelectedValue); ovaciado.Banco = this.cbxBancos.SelectedValue.ToString(); ovaciado.Posicion = Convert.ToInt32(this.txPosicionInicial.Text); if (this.rbAscendente.Checked == true) { ovaciado.Asc = true; } else { ovaciado.Asc = false; } a04_Vaciado02 frmObj = new a04_Vaciado02(this.lu, ovaciado); frmObj.Show(); this.Close(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } }