protected void btn_confirmar_Click(object sender, EventArgs e) { if (this.ddl_destinoPos1.SelectedIndex > 0 && this.ddl_destinoPos2.SelectedIndex > 0) { string resultado; UsuarioBC usuario = new UsuarioBC(); usuario = (UsuarioBC)this.Session["Usuario"]; SolicitudBC solicitud = new SolicitudBC(); TrailerUltEstadoBC traiue = new TrailerUltEstadoBC(); int id = int.Parse(this.hf_trailerId.Value); traiue = traiue.CargaTrue(id); string fh = string.Format("{0} {1}", this.txt_buscarFecha.Text, this.txt_buscarHora.Text); solicitud.ID_TIPO = 3; solicitud.ID_USUARIO = usuario.ID; // Variable de sesión solicitud.FECHA_CREACION = DateTime.Now; solicitud.FECHA_PLAN_ANDEN = DateTime.Parse(fh); solicitud.DOCUMENTO = traiue.DOC_INGRESO; solicitud.OBSERVACION = ""; solicitud.ID_TRAILER = id; solicitud.ID_DESTINO = int.Parse(this.ddl_destinoPos1.SelectedValue); solicitud.ID_DESTINO_PALLET = int.Parse(this.ddl_destinoPos2.SelectedValue); solicitud.ID_SITE = int.Parse(this.dropsite.SelectedValue); if (solicitud.pallet(solicitud, out resultado) && resultado == "") { limpia(null, null); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", string.Format("showAlert('{0}');", "Solicitud Creada Correctamente"), true); } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", string.Format("alert('" + resultado + "');", resultado), true); } } }
protected void btn_confirmar_Click(object sender, EventArgs e) { try { if (string.IsNullOrEmpty(hf_idCond.Value)) { ConductorBC c = new ConductorBC(); c.RUT = txt_conductorRut.Text; c.NOMBRE = txt_conductorNombre.Text; c.TRAN_ID = Convert.ToInt32(ddl_transportista.SelectedValue); c.COND_EXTRANJERO = chk_conductorExtranjero.Checked; hf_idCond.Value = c.AgregarIdentity().ToString(); } MovimientoBC mov = new MovimientoBC(); TrailerUltEstadoBC trailerUE = new TrailerUltEstadoBC(); TrailerBC trailer = new TrailerBC(); mov.FECHA_CREACION = DateTime.Now; mov.ID_ESTADO = 10; mov.OBSERVACION = txt_obs.Text; DateTime fh = DateTime.Parse(string.Format("{0} {1}", txt_ingresoFecha.Text, txt_ingresoHora.Text)); mov.FECHA_ORIGEN = fh; mov.ID_DESTINO = Convert.ToInt32(this.ddl_posicion.SelectedValue); mov.FECHA_DESTINO = fh.AddMinutes(30); mov.PATENTE_TRACTO = txt_buscarPatente.Text; mov.MANT_EXTERNO = false; mov.ID_TRAILER = 0; trailer.ID = 0; trailer.PLACA = ""; trailer.TRAN_ID = Convert.ToInt32(ddl_transportista.SelectedValue); trailerUE.SITE_ID = Convert.ToInt32(dropsite.SelectedValue); // 1; // Cambiar después de introducir variables de sesión trailerUE.CHOFER_RUT = utils.formatearRut(txt_conductorRut.Text); trailerUE.CHOFER_NOMBRE = txt_conductorNombre.Text; trailerUE.ACOMP_RUT = txt_acomRut.Text; trailerUE.COND_ID = Convert.ToInt32(hf_idCond.Value); UsuarioBC usuario = (UsuarioBC)Session["USUARIO"]; string resultado; bool ejecucion = mov.ProcesoEntrada(mov, trailerUE, trailer, usuario.ID, out resultado); if (ejecucion && resultado == "") { utils.ShowMessage2(this, "confirmar", "success"); limpiarTodo(); } else { utils.ShowMessage(this, resultado, "error", false); } } catch (Exception ex) { utils.ShowMessage(this, ex.Message, "error", false); } }
protected void btn_confirmar_Click(object sender, EventArgs e) { DataView dw = table.AsDataView(); dw.RowFilter = "POSICION1 = " + ddl_destinoPos.SelectedValue; if (dw.Count != 0) { utils.ShowMessage2(this, "guardar", "warn_destinoBloqueado"); return; } try { string resultado; UsuarioBC usuario = new UsuarioBC(); usuario = (UsuarioBC)Session["Usuario"]; SolicitudBC solicitud = new SolicitudBC(); TrailerUltEstadoBC traiue = new TrailerUltEstadoBC(); int id = Convert.ToInt32(hf_trailerId.Value); traiue = traiue.CargaTrue(id); string fh = txt_buscarFecha.Text + " " + txt_buscarHora.Text; solicitud.ID_TIPO = 2; solicitud.ID_USUARIO = usuario.ID; // Variable de sesión solicitud.FECHA_CREACION = DateTime.Now; solicitud.FECHA_PLAN_ANDEN = DateTime.Parse(fh); solicitud.DOCUMENTO = traiue.DOC_INGRESO; solicitud.OBSERVACION = ""; solicitud.ID_TRAILER = id; solicitud.ID_DESTINO = Convert.ToInt32(ddl_destinoPos.SelectedValue); solicitud.ID_SITE = Convert.ToInt32(this.dropsite.SelectedValue); string bloqueados = ""; for (int i = 0; i < table.Rows.Count; i++) { bloqueados = bloqueados + table.Rows[i]["POSICION1"].ToString(); bloqueados += (i < table.Rows.Count - 1) ? "," : string.Empty; } bool ejecucion = solicitud.Descarga(solicitud, bloqueados, out resultado); if (ejecucion && resultado == "") { limpia(null, null); utils.ShowMessage2(this, "guardar", "success"); } else { utils.ShowMessage(this, resultado, "error", false); } } catch (Exception EX) { utils.ShowMessage(this, EX.Message, "error", false); } }
private void ObtenerReporte(bool forzarBD) { if (this.ViewState["listar"] == null || forzarBD) { TrailerUltEstadoBC t = new TrailerUltEstadoBC(); t.NUMERO = txt_buscarNro.Text; t.PLACA = txt_buscarPlaca.Text; t.SITE_ID = Convert.ToInt32(this.ddl_buscarSite.SelectedValue); t.SITE_IN = !this.chk_sitein.Checked; this.ViewState["listar"] = this.ComparaRegistros(t.CargaUltEstadoQMGPS()); } this.gv_listar.DataSource = this.ViewState["listar"]; this.gv_listar.DataBind(); }
protected void btn_confirmar_Click(object sender, EventArgs e) { try { if (this.ddl_posicion.SelectedValue == "0") { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje2", "alert('Debe seleccionar posicion Destino');", true); } else if (this.hf_idTrailer.Value == "") { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje2", "alert('Debe ingresar Trailer');", true); limpiarTodo(); } else if (this.txt_conductorRut.Text == "") { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje2", "alert('Debe ingresar Conductor');", true); } else { ConductorBC c = new ConductorBC(); if (string.IsNullOrEmpty(hf_idCond.Value)) { if (extranjero.Checked == false) { c.RUT = utils.formatearRut(txt_conductorRut.Text); } else { c.RUT = txt_conductorRut.Text; } c.NOMBRE = txt_conductorNombre.Text; c.TRAN_ID = int.Parse(ddl_transportista.SelectedValue); hf_idCond.Value = c.AgregarIdentity().ToString(); } MovimientoBC mov = new MovimientoBC(); TrailerUltEstadoBC trailerUE = new TrailerUltEstadoBC(); TrailerBC trailer = new TrailerBC(); mov.FECHA_CREACION = DateTime.Now; mov.ID_ESTADO = 10; mov.OBSERVACION = this.txt_obs.Text; DateTime fh = DateTime.Parse(string.Format("{0} {1}", this.txt_ingresoFecha.Text, this.txt_ingresoHora.Text)); mov.FECHA_ORIGEN = fh; mov.ID_DESTINO = int.Parse(this.ddl_posicion.SelectedValue); mov.FECHA_DESTINO = fh.AddMinutes(30); mov.PATENTE_TRACTO = this.txt_traExtPat.Text; trailerUE.COND_ID = int.Parse(hf_idCond.Value); mov.MANT_EXTERNO = false; mov.ID_TRAILER = int.Parse(this.hf_idTrailer.Value); trailer.ID = int.Parse(this.hf_idTrailer.Value); trailer.PLACA = this.txt_buscarPatente.Text; trailer.CODIGO = string.Format("{0}_{1}", this.ddl_transportista.SelectedItem.Text, this.txt_buscarPatente.Text); if (rb_externo.Checked) { trailer.EXTERNO = true; } else { trailer.EXTERNO = false; } trailer.TRAN_ID = int.Parse(this.ddl_transportista.SelectedValue); trailerUE.SITE_ID = Convert.ToInt32(this.dropsite.SelectedValue); // 1; // Cambiar después de introducir variables de sesión if (extranjero.Checked == false) { trailerUE.CHOFER_RUT = utils.formatearRut(this.txt_conductorRut.Text); } else { trailerUE.CHOFER_RUT = this.txt_conductorRut.Text; } trailerUE.CHOFER_NOMBRE = this.txt_conductorNombre.Text; trailerUE.ACOMP_RUT = this.txt_acomRut.Text; trailerUE.PROV_ID = int.Parse(this.ddl_proveedor.SelectedValue); trailerUE.DOC_INGRESO = this.txt_buscarDoc.Text; trailerUE.SELLO_INGRESO = this.txt_idSello.Text; trailerUE.TIPO_INGRESO_CARGA = this.ddl_tipo_carga.SelectedValue; trailerUE.motivo_TIPO_INGRESO_CARGA = this.ddl_motivo.SelectedValue; PreEntradaBC p = new PreEntradaBC(); trailerUE.pring_id = hf_pring_id.Value.ToString(); // p.CargarPreEntrada( //p.CargarPreEntrada(mov.ID_TRAILER, int.Parse(dropsite.SelectedValue)).ID.ToString(); if (this.rb_ingresoCargado.Checked) //Trailer cargado: Entrada a destino { trailerUE.CARGADO = true; } else //Trailer sin carga: Entrada a origen { trailerUE.CARGADO = false; } UsuarioBC usuario = (UsuarioBC)Session["USUARIO"]; if (trailer.ID == 0) { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('Debe ingresar Trailer);", true); limpiarTodo(); } else { string resultado; bool ejecucion = mov.ProcesoEntrada(mov, trailerUE, trailer, usuario.ID, out resultado); if (ejecucion && resultado == "") { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje8", "showAlert('Ingreso correcto.');", true); limpiarTodo(); } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('" + resultado + "');", true); } } } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('Error! No se pudo ingresar los datos.');", true); } }
public bool MOVIMIENTO(MovimientoBC mov, TrailerUltEstadoBC traiUE, TrailerBC trai, int usua_id, out string resultado) { return(tran.Movimiento_Interno(mov, traiUE, trai, usua_id, out resultado)); }
public bool ProcesoEntrada(MovimientoBC mov, TrailerUltEstadoBC traiUE, TrailerBC trai, int usua_id, out string resultado) { return(tran.Movimiento_Entrada(mov, traiUE, trai, usua_id, out resultado)); }
public void btn_confirmar_Click(object sender, EventArgs e) { try { MovimientoBC mov = new MovimientoBC(); //SolicitudBC solicitud = new SolicitudBC(); //TrailerUltEstadoBC traiue = new TrailerUltEstadoBC(); //int id = int.Parse(hf_trailerId.Value); //traiue = traiue.CargaTrue(id); //string fh = DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString(); //solicitud.ID_TIPO = 2; //solicitud.ID_USUARIO = 1; // Variable de sesión //solicitud.FECHA_CREACION = DateTime.Now; //solicitud.FECHA_PLAN_ANDEN = DateTime.Parse(fh); //solicitud.DOCUMENTO = traiue.DOC_INGRESO; //solicitud.OBSERVACION = ""; //solicitud.ID_TRAILER = id; //solicitud.ID_DESTINO = int.Parse(ddl_destinoPos.SelectedValue); //if (solicitud.Descarga(solicitud)) // ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('Solicitud ingresada correctamente');", true); //else // ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('Ocurrió un error!');", true); if (this.hf_trailerId.Value == "" || this.hf_trailerId.Value == null) { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('Debe seleccionar un trailer.');", true); } else { mov.ID_TRAILER = int.Parse(this.hf_trailerId.Value); mov.FECHA_CREACION = DateTime.Now; mov.OBSERVACION = ""; mov.FECHA_ORIGEN = DateTime.Parse(DateTime.Now.ToString()); mov.FECHA_DESTINO = mov.FECHA_ORIGEN.AddMinutes(15); mov.ID_DESTINO = int.Parse(this.ddl_destinoPos.SelectedValue); mov.ID_ESTADO = 10; mov.OBSERVACION = ""; TrailerUltEstadoBC trailerUE = new TrailerUltEstadoBC(); trailerUE.ID = int.Parse(this.hf_trailerId.Value); trailerUE.SITE_ID = 1; // Cambiar después de introducir variables de sesión trailerUE.SITE_IN = true; trailerUE.LUGAR_ID = int.Parse(this.ddl_destinoPos.SelectedValue); TrailerBC trailer = new TrailerBC(); mov.MANT_EXTERNO = false; mov.ID_TRAILER = int.Parse(this.hf_trailerId.Value); // trailer.PLACA = this.txt_buscarPatente.Text; // trailer.CODIGO = "S/ CODIGO"; // trailer.NUMERO = this.txt_buscarNro.Text; trailer.ID = mov.ID_TRAILER; UsuarioBC usuario = (UsuarioBC)Session["USUARIO"]; string resultado; bool ejecucion = mov.MOVIMIENTO(mov, trailerUE, trailer, usuario.ID, out resultado); if (ejecucion && resultado == "") { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('Se ingresaron correctamente los datos.');", true); ddl_destinoZona.SelectedValue = "0"; ddl_destinoZona_SelectedIndexChanged(null, null); this.pnl_detalleLugar.Attributes.Remove("style"); this.pnl_detalleTrailer.CssClass = ""; this.pnl_detalleTrailer.Attributes.Remove("style"); this.img_reloj.ImageUrl = ""; this.img_trailer.ImageUrl = ""; this.lbl_lugar.Text = ""; this.lbl_origenZona.Text = ""; this.lbl_origenPlaya.Text = ""; } } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('Ocurrió un error!');", true); } }
protected void btn_confirmar_Click(object sender, EventArgs e) { try { ConductorBC c = new ConductorBC(); MovimientoBC mov = new MovimientoBC(); TrailerUltEstadoBC trailerUE = new TrailerUltEstadoBC(); TrailerBC trailer = new TrailerBC(); if (string.IsNullOrEmpty(hf_idCond.Value)) { c.RUT = utils.formatearRut(txt_conductorRut.Text); c.NOMBRE = txt_conductorNombre.Text; c.TRAN_ID = Convert.ToInt32(ddl_transportista.SelectedValue); c.COND_EXTRANJERO = chk_conductorExtranjero.Checked; hf_idCond.Value = c.AgregarIdentity().ToString(); } mov.FECHA_CREACION = DateTime.Now; mov.ID_ESTADO = 10; mov.OBSERVACION = txt_obs.Text; mov.FECHA_ORIGEN = Convert.ToDateTime(string.Format("{0} {1}", txt_ingresoFecha.Text, txt_ingresoHora.Text)); mov.ID_DESTINO = Convert.ToInt32(ddl_posicion.SelectedValue); mov.FECHA_DESTINO = mov.FECHA_ORIGEN.AddMinutes(30); if (utils.patentevalida(txt_traExtPat.Text) == true) { mov.PATENTE_TRACTO = txt_traExtPat.Text; if (rb_mantExterno.Checked) { mov.MANT_EXTERNO = true; } else { trailerUE.COND_ID = Convert.ToInt32(hf_idCond.Value); mov.MANT_EXTERNO = false; mov.ID_TRAILER = Convert.ToInt32(hf_idTrailer.Value); trailer.ID = Convert.ToInt32(hf_idTrailer.Value); trailer.PLACA = txt_buscarPatente.Text; trailer.CODIGO = string.Format("{0}_{1}", ddl_transportista.SelectedItem.Text, txt_buscarPatente.Text); trailer.EXTERNO = (rb_externo.Checked || rb_proveedor.Checked || rb_mantExterno.Checked); trailer.TRAN_ID = Convert.ToInt32(ddl_transportista.SelectedValue); trailerUE.SITE_ID = Convert.ToInt32(dropsite.SelectedValue); // 1; // Cambiar después de introducir variables de sesión trailerUE.CHOFER_RUT = utils.formatearRut(txt_conductorRut.Text); trailerUE.CHOFER_NOMBRE = txt_conductorNombre.Text; trailerUE.ACOMP_RUT = txt_acomRut.Text; trailerUE.PROV_ID = Convert.ToInt32(ddl_proveedor.SelectedValue); trailerUE.DOC_INGRESO = txt_buscarDoc.Text; trailerUE.SELLO_INGRESO = txt_idSello.Text; trailerUE.TIPO_INGRESO_CARGA = ddl_tipo_carga.SelectedValue; trailerUE.motivo_TIPO_INGRESO_CARGA = ddl_motivo.SelectedValue; trailerUE.pring_id = hf_pring_id.Value.ToString(); // p.CargarPreEntrada( //p.CargarPreEntrada(mov.ID_TRAILER, Convert.ToInt32(dropsite.SelectedValue)).ID.ToString(); trailerUE.CARGADO = rb_ingresoCargado.Checked; } UsuarioBC usuario = (UsuarioBC)this.Session["USUARIO"]; if (trailer.ID == 0) { utils.ShowMessage(this, "Debe ingresar Trailer", "warn", true); limpiarTodo(); } else { string resultado; bool ejecucion = mov.ProcesoEntrada(mov, trailerUE, trailer, usuario.ID, out resultado); if (ejecucion && resultado == "") { utils.ShowMessage(this, "Ingreso correcto", "success", true); limpiarTodo(); } else { utils.ShowMessage(this, resultado, "error", false); } } } else { utils.ShowMessage(this, "Patente de Tracto Invalida", "warn", false); } } catch (Exception ex) { utils.ShowMessage(this, ex.Message, "error", false); } }
protected void btn_confirmar_Click(object sender, EventArgs e) { MovimientoBC mov = new MovimientoBC(); if (this.hf_idTrailer.Value == "" || this.hf_idTrailer.Value == null) { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('Debe seleccionar un trailer.');", true); } else { mov.ID_TRAILER = int.Parse(this.hf_idTrailer.Value); mov.FECHA_CREACION = DateTime.Now; mov.OBSERVACION = ""; mov.FECHA_ORIGEN = DateTime.Parse(this.txt_fechaMovimiento.Text); mov.FECHA_DESTINO = mov.FECHA_ORIGEN.AddMinutes(15); mov.ID_DESTINO = int.Parse(this.ddl_destinoPos.SelectedValue); mov.ID_ESTADO = 10; mov.OBSERVACION = this.txt_refOp.Text; mov.petroleo = petroleo.Checked.ToString(); TrailerUltEstadoBC trailerUE = new TrailerUltEstadoBC(); trailerUE.ID = int.Parse(this.hf_idTrailer.Value); trailerUE.SITE_ID = int.Parse(this.dropsite.SelectedValue); // 1; // Cambiar después de introducir variables de sesión trailerUE.SITE_IN = true; trailerUE.LUGAR_ID = int.Parse(this.ddl_destinoPos.SelectedValue); TrailerBC trailer = new TrailerBC(); mov.MANT_EXTERNO = false; mov.ID_TRAILER = int.Parse(this.hf_idTrailer.Value); // trailer = trailer.obtenerXID(int.Parse(this.hf_idTrailer.Value)); trailer.PLACA = this.txt_buscarPatente.Text; trailer.CODIGO = "S/ CODIGO"; if (this.rb_trailerExterno.Checked) { trailer.EXTERNO = true; } else { trailer.EXTERNO = false; } trailer.NUMERO = this.txt_buscarNro.Text; trailer.ID = int.Parse(this.ddl_transportista.SelectedValue); UsuarioBC usuario = (UsuarioBC)Session["USUARIO"]; string resultado; bool ejecucion = mov.MOVIMIENTO(mov, trailerUE, trailer, usuario.ID, out resultado); if (resultado == "" && ejecucion) { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "showAlert('Se ingresaron correctamente los datos.');", true); limpiar(); ddl_destinoZona.SelectedValue = "0"; ddl_destinoZona_SelectedIndexChanged(null, null); this.pnl_detalleLugar.Attributes.Remove("style"); this.pnl_detalleTrailer.CssClass = ""; this.pnl_detalleTrailer.Attributes.Remove("style"); //this.img_reloj.ImageUrl = ""; this.img_trailer.ImageUrl = ""; this.lbl_lugar.Text = ""; this.lbl_origenZona.Text = ""; this.lbl_origenPlaya.Text = ""; } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('" + resultado + "');", true); } } }
public DataSet CargaUltEstadoQMGPS(TrailerUltEstadoBC t) { return(tran.TrailerUltEstado_CargaQMGPS(t)); }