protected void btn_guardar_Click(object sender, EventArgs e) { if (utils.validarRut(txt_conductorRut.Text) == false) { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "msj", "alert('Rut del Conductor invalido');", true); txt_conductorRut.Text = ""; } else { ServiciosExternosVehiculosBC se = new ServiciosExternosVehiculosBC(); se.SEVE_ID = Convert.ToInt32(hf_id.Value); se.FH_SALIDA = Convert.ToDateTime(txt_fecha.Text + " " + txt_hora.Text); se.COSE_RUT = txt_conductorRut.Text; se.COSE_NOMBRE = txt_conductorNombre.Text; se.OBSERVACION = ""; se.USUA_ID = usuario.ID; se.SEEX_ID = 0; if (se.Salida()) { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "msj", "alert('Salida correcta');", true); Limpiar(); } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "msj", "alert('Error');", true); } } }
protected void txt_conductorRut_TextChanged(object sender, EventArgs e) { if (!utils.validarRut(txt_conductorRut.Text) && !chk_conductorExtranjero.Checked) { txt_conductorNombre.Enabled = false; hf_idCond.Value = ""; txt_conductorRut.Text = ""; txt_conductorNombre.Text = ""; utils.ShowMessage2(this, "buscarConductor", "warn_rutNovalido"); return; } ConductorBC c = new ConductorBC().ObtenerXRut(this.txt_conductorRut.Text); if (c.ID == 0 || !c.ACTIVO) { txt_conductorNombre.Enabled = true; hf_idCond.Value = ""; utils.ShowMessage2(this, "conductor", "warn_conductorNoexiste"); return; } if (c.BLOQUEADO) { txt_conductorNombre.Enabled = false; hf_idCond.Value = ""; txt_conductorRut.Text = ""; txt_conductorNombre.Text = ""; utils.ShowMessage2(this, "conductor", "warn_conductorBloqueado"); return; } hf_idCond.Value = c.ID.ToString(); txt_conductorNombre.Text = c.NOMBRE; txt_conductorNombre.Enabled = false; utils.ShowMessage2(this, "conductor", "success"); }
protected void txt_rutConductor_TextChanged(object sender, EventArgs e) { if (!chk_conductorExtranjero.Checked && !utils.validarRut(txt_conductorRut.Text)) { hf_idCond.Value = ""; txt_conductorRut.Text = ""; lbl_nombreConductor.Text = ""; utils.ShowMessage2(this, "conductor", "warn_rutNovalido"); return; } ConductorBC c = new ConductorBC(); c = c.ObtenerXRut(txt_conductorRut.Text); if (c.ID == 0) { hf_idCond.Value = ""; txt_conductorRut.Text = ""; lbl_nombreConductor.Text = ""; utils.ShowMessage2(this, "conductor", "success_conductorNoexiste"); return; } if (c.BLOQUEADO) { hf_idCond.Value = ""; txt_conductorRut.Text = ""; lbl_nombreConductor.Text = ""; utils.ShowMessage2(this, "conductor", "warn_conductorBloqueado"); return; } lbl_nombreConductor.Text = c.NOMBRE; hf_idCond.Value = c.ID.ToString(); utils.ShowMessage2(this, "conductor", "success"); }
protected void txt_rutCond_TextChanged(object sender, EventArgs e) { if (!chk_conductorExtranjero.Checked && !utils.validarRut(txt_conductorRut.Text)) { txt_conductorRut.Text = ""; txt_conductorNombre.Text = ""; utils.ShowMessage2(this, "conductor", "warn_rutNovalido"); return; } ServiciosExternosConductorBC c = new ServiciosExternosConductorBC(); c = c.ObtenerXRut(utils.formatearRut(txt_conductorRut.Text)); if (c.ID == 0) { utils.ShowMessage2(this, "conductor", "warn_conductorNoexiste"); return; } if (c.BLOQUEADO) { txt_conductorRut.Text = ""; txt_conductorNombre.Text = ""; utils.ShowMessage2(this, "conductor", "warn_conductorBloqueado"); return; } txt_conductorNombre.Text = c.NOMBRE; utils.ShowMessage2(this, "conductor", "success"); }
protected void txt_editRutTran_TextChanged(object sender, EventArgs e) { if (!utils.validarRut(txt_editRutTran.Text)) { utils.ShowMessage2(this, "crearTransportista", "warn_rutInvalido"); txt_editRutTran.Text = ""; txt_editRutTran.Focus(); } else { txt_editNombre.Focus(); } }
protected void txt_conductorRut_TextChanged(object sender, EventArgs e) { if (txt_conductorRut.Text == "") { txt_conductorNombre.Enabled = true; return; } if (utils.validarRut(txt_conductorRut.Text)) { ConductorBC c = new ConductorBC(); c = c.ObtenerXRut(utils.formatearRut(txt_conductorRut.Text)); if (c.ID != 0) { if (c.BLOQUEADO) { txt_conductorNombre.Enabled = false; hf_idCond.Value = ""; txt_conductorRut.Text = ""; txt_conductorNombre.Text = ""; txt_conductorRut.Focus(); utils.ShowMessage2(this, "buscarConductor", "warn_conductorBloqueado"); return; } txt_conductorNombre.Text = c.NOMBRE; txt_conductorNombre.Enabled = false; hf_idCond.Value = c.ID.ToString(); txt_acomRut.Focus(); utils.ShowMessage2(this, "buscarConductor", "success"); } else { txt_conductorNombre.Enabled = true; hf_idCond.Value = ""; txt_conductorNombre.Focus(); utils.ShowMessage2(this, "buscarConductor", "warn_conductorNoexiste"); } } else { txt_conductorNombre.Enabled = false; hf_idCond.Value = ""; txt_conductorRut.Text = ""; txt_conductorNombre.Text = ""; txt_conductorRut.Focus(); utils.ShowMessage2(this, "buscarConductor", "warn_rutNovalido"); } }
protected void txt_rutChofer_TextChanged(object sender, EventArgs e) { if (!chk_conductorExtranjero.Checked && !utils.validarRut(this.txt_conductorRut.Text)) { hf_idCond.Value = ""; txt_conductorRut.Text = ""; txt_conductorNombre.Text = ""; txt_conductorNombre.Enabled = false; utils.ShowMessage2(this, "conductor", "warn_rutNovalido"); return; } ConductorBC c = new ConductorBC(); c = c.ObtenerXRut(utils.formatearRut(this.txt_conductorRut.Text)); if (c.ID == 0) { hf_idCond.Value = ""; txt_conductorNombre.Enabled = true; utils.ShowMessage2(this, "conductor", "warn_conductorNoexiste"); return; } if (c.BLOQUEADO) { hf_idCond.Value = ""; txt_conductorRut.Text = ""; txt_conductorNombre.Text = ""; txt_conductorNombre.Enabled = false; utils.ShowMessage2(this, "conductor", "warn_conductorBloqueado"); return; } txt_conductorNombre.Text = c.NOMBRE; txt_conductorNombre.Enabled = false; hf_idCond.Value = c.ID.ToString(); chk_conductorExtranjero.Checked = c.COND_EXTRANJERO; utils.ShowMessage2(this, "conductor", "success"); }