private void llenarForm() { int soli_id = Convert.ToInt32(Request.Params["soli_id"].ToString()); hf_soliId.Value = soli_id.ToString(); SolicitudBC solicitud = new SolicitudBC(); SolicitudAndenesBC sa = new SolicitudAndenesBC(); LugarBC l = new LugarBC(); TrailerBC t = new TrailerBC(); solicitud = solicitud.ObtenerXId(soli_id); sa = sa.ObtenerXId(soli_id, 1); txt_buscarFecha.Text = solicitud.FECHA_CREACION.ToString("dd/MM/yyyy"); txt_buscarHora.Text = solicitud.FECHA_CREACION.ToString("hh:mm"); hf_trailerId.Value = solicitud.ID_TRAILER.ToString(); t = t.obtenerXID(solicitud.ID_TRAILER); txt_buscarPatente.Text = t.PLACA; btnBuscar_Click(null, null); l = l.obtenerXID(sa.LUGA_ID); dropsite.SelectedValue = l.ID_SITE.ToString(); drop_SelectedIndexChanged(null, null); ddl_destinoZona.SelectedValue = l.ID_ZONA.ToString(); ddl_destinoZona_SelectedIndexChanged(null, null); ddl_destinoPlaya.SelectedValue = l.ID_PLAYA.ToString(); ddl_destinoPlaya_SelectedIndexChanged(null, null); ddl_destinoPos.SelectedValue = l.ID.ToString(); }
protected void btn_mover_Click(object sender, EventArgs e) { MovimientoBC m = new MovimientoBC(); SolicitudBC s = new SolicitudBC(); s = s.ObtenerXId(int.Parse(this.hf_idSolicitud.Value)); string resultado; m.ID_DESTINO = int.Parse(this.ddl_editPos.SelectedValue); m.ID_TRAILER = s.ID_TRAILER; m.ID_SOLICITUD = s.SOLI_ID; m.OBSERVACION = ""; bool ejecucion = s.DescargaMovimiento(m, s.ID_SITE, this.u.ID, out resultado); if (resultado == "" && ejecucion) { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "showAlert('Se generĂ³ movimiento correctamente.');", true); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "cerrarModal", "$('#modalPosicion').modal('hide');", true); this.ObtenerSolicitudes(true); } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", string.Format("alert('{0}');", resultado), true); } }
private void llenarForm() { SolicitudBC s = new SolicitudBC(); TrailerBC t = new TrailerBC(); LugarBC l = new LugarBC(); ZonaBC z = new ZonaBC(); s = s.ObtenerXId(int.Parse(hf_idSolicitud.Value)); hf_timestamp.Value = s.TIMESTAMP.ToString(); t = t.obtenerXID(s.ID_TRAILER); l = l.obtenerXID(t.LUGAR_ID); utils.CargaDropTodos(ddl_editZona, "ID", "DESCRIPCION", z.ObtenerXSite(s.ID_SITE, false)); ddl_editZona.SelectedValue = l.ID_ZONA.ToString(); ddl_editZona_IndexChanged(null, null); ddl_editPlaya.SelectedValue = l.ID_PLAYA.ToString(); ddl_editPlaya_IndexChanged(null, null); try { ddl_editPos.SelectedValue = l.ID.ToString(); } catch (Exception e) {} ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "asdf", "modalPosicion();", true); }
protected void gv_listar_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName != "Page") { // int index = int.Parse(e.CommandArgument.ToString()); string[] arg = new string[3]; arg = e.CommandArgument.ToString().Split(';'); this.hf_idSolicitud.Value = arg[0]; // index.ToString();// gv_listar.DataKeys[index].Values[0].ToString(); this.hf_idLugar.Value = arg[1]; // gv_listar.DataKeys[index].Values[1].ToString(); this.hf_orden.Value = arg[2]; // gv_listar.DataKeys[index].Values[2].ToString(); this.txt_fechaCarga.Text = DateTime.Now.ToString("dd/MM/yyyy"); this.txt_horaCarga.Text = DateTime.Now.ToShortTimeString(); this.hf_idEstado.Value = e.CommandName; switch (e.CommandName) { case "Cargado": this.dv_pallets.Visible = false; ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "modalCarga();", true); break; case "Parcial": this.dv_pallets.Visible = true; ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "modalCarga();", true); break; case "Continuar": SolicitudBC s = new SolicitudBC(); LugarBC l = new LugarBC(); s = s.ObtenerXId(int.Parse(this.hf_idSolicitud.Value)); this.drops.Lugar1(this.ddl_origenAnden, 0, s.PLAY_ID, 0, 1); this.hf_caractSolicitud.Value = s.CARACTERISTICAS; this.hf_localesSeleccionados.Value = s.LOCALES; this.hf_timeStamp.Value = s.TIMESTAMP.ToString(); DataTable dsol = s.ObtenerAndenesXSolicitudId(s.SOLI_ID); this.ViewState["datosA"] = dsol; this.gv_solLocales.DataSource = dsol; this.gv_solLocales.DataBind(); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "modalReanudar();", true); break; case "Edit": string id = this.hf_idSolicitud.Value; string url = string.Format("Solicitud_Carga.aspx?id={0}&type=edit", id); this.Response.Redirect(url); // ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('" + hf_idSolicitud.Value + "');", true); break; case "colocar_sello": this.validar_sello(); break; case "validar_sello": this.validado_sello(); break; } } }
private bool comprobarTrailerEx() { SolicitudBC s = new SolicitudBC(); s = s.ObtenerXId(int.Parse(this.hf_idSolicitud.Value)); TrailerBC t = new TrailerBC(); t = t.obtenerXID(s.ID_TRAILER); return(t.EXTERNO); }
protected void Page_Load(object sender, EventArgs e) { if (Session["usuario"] == null) { Response.Redirect("~/InicioQYMS2.aspx"); } usuario = (UsuarioBC)Session["usuario"]; if (!this.IsPostBack) { SolicitudBC sol = new SolicitudBC(); CargaDrops(); volver.Visible = false; sol.ID_TIPO = 1; sol.FECHA_CREACION = DateTime.Now; txt_solHora.Text = DateTime.Now.AddMinutes(63).ToShortTimeString(); txt_solFecha.Text = DateTime.Now.AddMinutes(63).ToShortDateString(); ddl_solTemp.ClearSelection(); ddl_largoMax.ClearSelection(); LimpiarLocales(); ddl_idShortek.Enabled = true; string request = Request.Params["type"]; if (request != null && request == "edit") { CaractCargaBC cc = new CaractCargaBC(); SolicitudAndenesBC sa = new SolicitudAndenesBC(); TrailerBC trailer; DataTable dsol; ddl_idShortek.Enabled = false; hf_soliId.Value = Request.Params["id"].ToString(); btn_limpiarDatos.Visible = false; txt_solNumero.Text = this.hf_soliId.Value; sol = sol.ObtenerXId(Convert.ToInt32(hf_soliId.Value)); dropsite.SelectedValue = sol.ID_SITE.ToString(); drop_SelectedIndexChanged(null, null); hf_localesSeleccionados.Value = sol.LOCALES; txt_totalPallets.Text = sol.Pallets.ToString(); txt_ruta.Text = sol.RUTA; ddl_idShortek.SelectedValue = sol.ID_SHORTECK; hf_timeStamp.Value = sol.TIMESTAMP.ToString(); volver.Visible = true; volver2.Visible = false; string[] caract = sol.CARACTERISTICAS.Split(",".ToCharArray()); foreach (string c in caract) { if (c != "") { cc = cc.obtenerSeleccionado(Convert.ToInt32(c)); switch (cc.CODIGO) { case "CCF": chk_solFrio.Checked = true; break; case "CCS": chk_solSeco.Checked = true; break; case "CCC": chk_solCongelado.Checked = true; break; case "CCMF": chk_solMultifrio.Checked = true; break; case "CCCP": chk_plancha.Checked = true; break; case "CCWAY": chk_solWays.Checked = true; break; } } } chk_frio_CheckedChanged(null, null); chk_solMultifrio.Enabled = false; chk_solCongelado.Enabled = false; chk_solSeco.Enabled = false; chk_solFrio.Enabled = false; chk_solWays.Enabled = false; dropsite.Enabled = false; txt_solFecha.Enabled = false; txt_solHora.Enabled = false; ObtenerLocalesSolicitud(true); dsol = (DataTable)ViewState["locales"]; carga_playas(); ddl_solPlaya.SelectedValue = new LugarBC().obtenerXID(Convert.ToInt32(dsol.Rows[0]["LUGA_ID"])).ID_PLAYA.ToString(); // dsol.Rows[0]["id_playa"].ToString() ; ddl_solPlaya_SelectedIndexChanged(null, null); if (sol.TETR_ID != 0) { DDL_TEMP.SelectedValue = sol.TETR_ID.ToString(); } if (sol.ID_TRAILER != 0) { trailer = new TrailerBC().obtenerXID(sol.ID_TRAILER); hf_traiId.Value = trailer.ID.ToString(); txt_trailerPatente.Text = trailer.PLACA; txt_trailerNro.Text = trailer.NUMERO; txt_trailerShortek.Text = trailer.ID_SHORTEK; txt_trailerTransporte.Text = trailer.TRANSPORTISTA; } calcula_solicitud(null, null); if (hf_traiId.Value != "" && sol.SOES_ID > 101) { visiblasignamanual.Enabled = false; } } if (request != null && request == "new") { TrailerBC trailer = new TrailerBC(); CaractCargaBC cc = new CaractCargaBC(); string trai_id = this.Request.Params["trai_id"]; ddl_idShortek.Enabled = false; btn_limpiarDatos.Visible = false; txt_solNumero.Text = ""; hf_localesSeleccionados.Value = sol.LOCALES; txt_totalPallets.Text = "0"; txt_ruta.Text = "Ways"; ddl_idShortek.SelectedValue = "0"; hf_timeStamp.Value = DateTime.Now.ToString(); volver.Visible = false; volver2.Visible = true; chk_solWays.Checked = true; chk_solMultifrio.Enabled = false; chk_solCongelado.Enabled = false; chk_solSeco.Enabled = false; chk_solFrio.Enabled = false; dropsite.Enabled = false; string resultado = ""; DataTable dsol = sol.ObtenerAndenesXNewWays(trai_id, out resultado); ViewState["datosA"] = dsol; gv_solLocales.DataSource = dsol; gv_solLocales.DataBind(); stringCaractSolicitud(); carga_playas(); LugarBC lugar = new LugarBC(); lugar = lugar.obtenerXID(Convert.ToInt32(dsol.Rows[0]["luga_id"].ToString())); ddl_solPlaya.SelectedValue = lugar.ID_PLAYA.ToString(); // dsol.Rows[0]["id_playa"].ToString() ; ddl_solPlaya_SelectedIndexChanged(null, null); trailer = trailer.obtenerXID(Convert.ToInt32(trai_id)); txt_trailerPatente.Text = trailer.PLACA; calcula_solicitud(null, null); ddl_trailers.Enabled = false; txt_trailerNro.Enabled = false; txt_trailerPatente.Enabled = false; btn_buscarTrailer.Enabled = false; btn_buscarTrailer_Click(null, null); } } visibleasignamovilmanual(); }
protected void btn_buscarTrailer_Click(object sender, EventArgs e) { TrailerBC trailer = new TrailerBC(); if (this.txt_buscarNro.Text != "" || this.txt_buscarPatente.Text != "") { if (this.txt_buscarNro.Text != "") { trailer = trailer.obtenerXNro(txt_buscarNro.Text); } else if (utils.patentevalida(txt_buscarPatente.Text)) { trailer = trailer.obtenerXPlaca(txt_buscarPatente.Text); } else { limpiar(); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('Patente Invalida.');", true); } SolicitudBC soli = new SolicitudBC(); if (trailer.SOLI_ID != 0 && trailer.SOLI_ID != null) { soli = soli.ObtenerXId(trailer.SOLI_ID); } if (trailer.ID == 0 || trailer.ID == null) //Trailer no existe { limpiar(); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('Trailer no existe en la base de datos.');", true); } else //Trailer existente, trae datos { if (trailer.SITE_ID == null || trailer.SITE_ID == 0 || !trailer.SITE_IN) { limpiar(); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('Trailer en ruta.');", true); } else if (trailer.SITE_ID != int.Parse(this.dropsite.SelectedValue)) { limpiar(); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('Trailer no se encuentra en el site.');", true); } else if (trailer.SOLI_ID != null && trailer.SOLI_ID != 0 && soli.SOES_ID != 150) { limpiar(); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('Trailer tiene solicitud pendiente.');", true); } else if (trailer.MOVI_ID != null && trailer.MOVI_ID != 0) { limpiar(); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('Trailer tiene movimiento pendiente.');", true); } else if (trailer.BLOQUEADO == "True") { limpiar(); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('Trailer bloqueado.');", true); } else { drop_SelectedIndexChanged(null, null); this.hf_idTrailer.Value = trailer.ID.ToString(); dibujo(trailer.LUGAR_ID); this.txt_buscarPatente.Text = trailer.PLACA; this.txt_buscarNro.Text = trailer.NUMERO; this.ddl_transportista.SelectedValue = trailer.TRAN_ID.ToString(); if (trailer.EXTERNO) { this.rb_trailerPropio.Checked = false; this.rb_trailerExterno.Checked = true; } else { this.rb_trailerPropio.Checked = true; this.rb_trailerExterno.Checked = false; } this.ddl_destinoZona.Enabled = true; ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "showAlert('Se cargaron los datos del trailer seleccionado.');", true); petroleo_checked(null, null); } } } else { limpiar(); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('Debe ingresar un numero de flota o patente');", true); ddl_destinoZona.Enabled = false; this.hf_idTrailer.Value = ""; } }
protected void Page_Load(object sender, EventArgs e) { if (this.Session["usuario"] == null) { this.Response.Redirect("~/InicioQYMS2.aspx"); } this.usuario = (UsuarioBC)this.Session["usuario"]; SolicitudBC sol = new SolicitudBC(); CaractCargaBC car = new CaractCargaBC(); ShorteckBC sh = new ShorteckBC(); if (!this.IsPostBack) { this.volver.Visible = false; sol.ID_TIPO = 1; sol.FECHA_CREACION = DateTime.Now; this.txt_solHora.Text = DateTime.Now.AddMinutes(63).ToShortTimeString(); YMS_ZONA_BC yms = new YMS_ZONA_BC(); utils.CargaDropNormal(this.dropsite, "ID", "NOMBRE", yms.ObteneSites(this.usuario.ID)); utils.CargaDrop(this.ddl_solTemp, "ID", "DESCRIPCION", car.obtenerXTipo(30)); utils.CargaDrop(this.ddl_largoMax, "ID", "DESCRIPCION", car.obtenerXTipo(0)); // utils.CargaDropTodos(this.ddl_idShortek, "SHOR_ID", "SHOR_DESC", sh.ObtenerTodos()); ddl_idShortek.DataSource = sh.ObtenerTodos(); ddl_idShortek.DataTextField = "SHOR_DESC"; ddl_idShortek.DataValueField = "SHOR_ID"; ddl_idShortek.DataBind(); ddl_idShortek.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Seleccione", "0")); ddl_idShortek.SelectedValue = "0"; ddl_id_shortrec2.DataSource = sh.ObtenerTodos(); ddl_id_shortrec2.DataTextField = "SHOR_DESC"; ddl_id_shortrec2.DataValueField = "SHOR_ID"; ddl_id_shortrec2.DataBind(); ddl_id_shortrec2.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Seleccione", "0")); ddl_id_shortrec2.SelectedValue = "0"; this.txt_solFecha.Text = DateTime.Now.AddMinutes(63).ToShortDateString(); this.ddl_solTemp.ClearSelection(); this.ddl_largoMax.ClearSelection(); this.LimpiarLocales(); if (this.Request.Params["type"] != null) { TrailerBC trailer = new TrailerBC(); CaractCargaBC cc = new CaractCargaBC(); this.hf_soliId.Value = this.Request.Params["id"].ToString(); this.btn_limpiarDatos.Visible = false; this.txt_solNumero.Text = this.hf_soliId.Value; sol = sol.ObtenerXId(int.Parse(this.hf_soliId.Value)); this.hf_localesSeleccionados.Value = sol.LOCALES; this.txt_totalPallets.Text = sol.Pallets.ToString(); this.txt_ruta.Text = sol.RUTA; this.ddl_idShortek.SelectedValue = sol.ID_SHORTECK; this.hf_timeStamp.Value = sol.TIMESTAMP.ToString(); this.volver.Visible = true; string[] caract = sol.CARACTERISTICAS.Split(",".ToCharArray()); foreach (string c in caract) { if (c != "") { cc = cc.obtenerSeleccionado(int.Parse(c)); switch (cc.CODIGO) { case "CCF": this.chk_solFrio.Checked = true; break; case "CCS": this.chk_solSeco.Checked = true; break; case "CCC": this.chk_solCongelado.Checked = true; break; case "CCMF": this.chk_solMultifrio.Checked = true; break; case "CCCP": this.chk_plancha.Checked = true; break; case "CCWAY": this.chk_solWays.Checked = true; break; } } } this.chk_solMultifrio.Enabled = false; this.chk_solCongelado.Enabled = false; this.chk_solSeco.Enabled = false; this.chk_solFrio.Enabled = false; this.dropsite.Enabled = false; this.txt_solFecha.Enabled = false; this.txt_solHora.Enabled = false; SolicitudAndenesBC sa = new SolicitudAndenesBC(); sa.ObtenerTodo(sol.SOLI_ID); this.ObtenerLocalesSolicitud(true); this.stringCaractSolicitud(); this.carga_playas(); if (sol.TETR_ID != 0) { this.DDL_TEMP.SelectedValue = sol.TETR_ID.ToString(); } trailer = trailer.obtenerXID(sol.ID_TRAILER); this.txt_trailerPatente.Text = trailer.PLACA; this.calcula_solicitud(null, null); this.btn_buscarTrailer_Click(null, null); if (this.hf_traiId.Value != "0" && sol.SOES_ID > 101) { this.visiblasignamanual.Enabled = false; } } } this.visiblasignamanual.Visible = false; }