protected void ddl_destinoPlaya_SelectedIndexChanged(object sender, EventArgs e) { if (this.ddl_destinoPlaya.SelectedIndex > 0) { int id_playa = int.Parse(this.ddl_destinoPlaya.SelectedValue); drops.Lugar1(ddl_destinoPos, 0, id_playa, 0, 1); //LugarBC lugar = new LugarBC(); //YMS_ZONA_BC yms = new YMS_ZONA_BC(); //DataTable ds1 = yms.Obtenerlugares_playa(id_playa, null, "0"); //utils.CargaDrop(this.ddl_destinoPos, "ID", "DESCRIPCION", ds1); if (this.ddl_destinoPos.Items.Count > 1) { this.ddl_destinoPos.Enabled = true; } else { this.ddl_destinoPos.Enabled = false; } } else { this.ddl_destinoPos.ClearSelection(); this.ddl_destinoPos.Enabled = false; } }
protected void ddl_playa_onChange(object sender, EventArgs e) { int playa_id = Convert.ToInt32(this.ddl_playa.SelectedValue); CargaDrops drops = new CargaDrops(); drops.Lugar1(this.ddl_lugar, 0, playa_id, -1, 1); }
protected void ddl_playainventario_onChange(object sender, EventArgs e) { int playa_id = int.Parse(ddl_playainventario.SelectedValue); CargaDrops drops = new CargaDrops(); drops.Lugar1(ddl_lugarinventario, 0, playa_id, -1, 1); //utils.CargaDrop(ddl_lugar, "ID", "DESCRIPCION", l.ObtenerXPlaya(playa_id)); }
protected void rb_pos_CheckedChanged(object sender, EventArgs e) { if (hf_idTrailer.Value != "") { if (rb_posAuto.Checked) { CargaTipoBC ct = new CargaTipoBC(); if (ct.CargaDestinos(int.Parse(this.ddl_tipo_carga.SelectedValue)).Rows.Count == 0) { LugarBC l = new LugarBC(); ddl_zona.Enabled = false; ddl_playa.Enabled = false; ddl_posicion.Enabled = false; l = l.obtenerLugarAuto(int.Parse(dropsite.SelectedValue), usuario.ID, null); if (l.ID == 0 || l.ID == null) { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "msj", "alert('Error. Intente designar un lugar manualmente.');", true); } else { PlayaBC p = new PlayaBC(); ZonaBC zona = new ZonaBC(); try { ddl_zona.SelectedValue = l.ID_ZONA.ToString(); } catch (Exception ex) { zona = zona.ObtenerXId(l.ID_ZONA); ddl_zona.Items.Add(new System.Web.UI.WebControls.ListItem(zona.DESCRIPCION, zona.ID.ToString())); ddl_zona.SelectedValue = zona.ID.ToString(); } utils.CargaDrop(this.ddl_playa, "ID", "DESCRIPCION", p.ObtenerXZona(l.ID_ZONA)); ddl_playa.SelectedValue = l.ID_PLAYA.ToString(); LugarBC lugar = new LugarBC(); CargaDrops drops = new CargaDrops(); drops.Lugar1(ddl_posicion, 0, l.ID_PLAYA, 0, 1); //utils.CargaDrop(this.ddl_posicion, "ID", "DESCRIPCION", lugar.ObtenerXPlaya(l.ID_PLAYA)); ddl_posicion.SelectedValue = l.ID.ToString(); } } } else { ddl_zona.Enabled = true; if (ddl_playa.SelectedIndex > 0) { ddl_playa.Enabled = true; } if (ddl_posicion.SelectedIndex > 0) { ddl_posicion.Enabled = true; } } } }
protected void gv_listar_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName != "Sort") { // int index = int.Parse(e.CommandArgument.ToString()); string[] arg = new string[3]; arg = e.CommandArgument.ToString().Split(';'); hf_idSolicitud.Value = arg[0]; // index.ToString();// gv_Carga.DataKeys[index].Values[0].ToString(); hf_idLugar.Value = arg[1]; // gv_Carga.DataKeys[index].Values[1].ToString(); hf_orden.Value = arg[2]; // gv_Carga.DataKeys[index].Values[2].ToString(); txt_fechaCarga.Text = DateTime.Now.ToShortDateString(); txt_horaCarga.Text = DateTime.Now.ToShortTimeString(); hf_idEstado.Value = e.CommandName; switch (e.CommandName) { case "Cargado": dv_pallets.Visible = false; ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "modalCarga();", true); break; case "Parcial": dv_pallets.Visible = true; ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "modalCarga();", true); break; case "Continuar": SolicitudBC s = new SolicitudBC(); s = s.ObtenerXId(int.Parse(hf_idSolicitud.Value)); drops.Lugar1(ddl_origenAnden, 0, s.PLAY_ID, 0, 1); hf_caractSolicitud.Value = s.CARACTERISTICAS; hf_localesSeleccionados.Value = s.LOCALES; hf_timeStamp.Value = s.TIMESTAMP.ToString(); DataTable dsol = s.ObtenerAndenesXSolicitudId(s.SOLI_ID); Ordenar(dsol, true); gv_solLocales.DataSource = ViewState["datosA"]; gv_solLocales.DataBind(); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "modalReanudar();", true); break; case "Edit": string id = hf_idSolicitud.Value; string url = "Solicitud_Carga.aspx?id=" + id + "&type=edit"; Response.Redirect(url); break; case "colocar_sello": validar_sello(); break; case "validar_sello": validado_sello(); break; } } }
protected void ddl_editPlaya_IndexChanged(object sender, EventArgs e) { if (ddl_editPlaya.SelectedIndex > 0) { drops.Lugar1(ddl_editPos, 0, int.Parse(ddl_editPlaya.SelectedValue), 0, 1); if (ddl_editPos.Items.Count > 1) { ddl_editPos.Enabled = true; } else { ddl_editPos.Enabled = false; } } else { ddl_editPos.ClearSelection(); ddl_editPos.Enabled = false; } }
protected void ddl_solPlaya_SelectedIndexChanged(object sender, EventArgs e) { if (this.ddl_solPlaya.SelectedIndex != 0) { CargaDrops drops = new CargaDrops(); drops.Lugar1(ddl_origenAnden, 0, Convert.ToInt32(ddl_solPlaya.SelectedValue), -1, 1); ddl_origenAnden.Enabled = (this.ddl_origenAnden.Items.Count > 1); } else { ddl_origenAnden.Enabled = false; } }
protected void ddl_playa_SelectedIndexChanged(object sender, EventArgs e) { if ((this.ddl_playa.SelectedIndex != 0) && (this.ddl_zona.SelectedIndex != 0)) { int id_playa = Convert.ToInt32(this.ddl_playa.SelectedValue); d.Lugar1(this.ddl_posicion, 0, id_playa, 0, 1); ddl_posicion.Enabled = true; } else { ddl_posicion.ClearSelection(); ddl_posicion.Enabled = false; } }
protected void ddl_bloqPlaya_onChange(object sender, EventArgs e) { PlayaBC playa = new PlayaBC(); int playa_id = int.Parse(ddl_bloqPlaya.SelectedValue); LugarBC lugar = new LugarBC(); CargaDrops drops = new CargaDrops(); drops.Lugar1(ddl_bloqLugar, 0, playa_id, -1, 1); //utils.CargaDrop(ddl_bloqLugar, "ID", "DESCRIPCION", lugar.ObtenerXPlaya(playa_id)); if (ddl_bloqLugar.Items.Count <= 1) { ddl_bloqLugar.Enabled = false; } else { ddl_bloqLugar.Enabled = true; } }
protected void ddl_solPlaya_SelectedIndexChanged(object sender, EventArgs e) { if (this.ddl_solPlaya.SelectedIndex != 0) { CargaDrops drops = new CargaDrops(); drops.Lugar1(this.ddl_origenAnden, 0, int.Parse(this.ddl_solPlaya.SelectedValue), -1, 1); if (this.ddl_origenAnden.Items.Count > 1) { this.ddl_origenAnden.Enabled = true; } else { this.ddl_origenAnden.Enabled = false; } } else { this.ddl_origenAnden.Enabled = false; } }
protected void gv_listar_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "DEF_DESCARGA_LI" || e.CommandName == "DEF_PALLETS" || e.CommandName == "DEF_MOVER" || e.CommandName == "DEF_DESECHOS" || e.CommandName == "DESCARGA_EDITA" || e.CommandName == "DESCARGA_BLOQUEAR" || e.CommandName == "DESCARGA_COMPLETA_LI" || e.CommandName == "DESCARGA_POSICION_LI" || e.CommandName == "DESECHOS_COMPLETAR" || e.CommandName == "PALLETS_COMPLETAR" || e.CommandName == "PALLETS_TRASLADO_ANDEN" || e.CommandName == "PALLETS_TRASLADO_EST" || e.CommandName == "PALLETS_REINICIAR" || e.CommandName == "DEF_DESCARGA" || e.CommandName == "DESCARGA_COMPLETA" || e.CommandName == "DESCARGA_POSICION" || e.CommandName == "DESCARGA_MOVER") { int index = Convert.ToInt32(e.CommandArgument); hf_idTrailer.Value = gv_listar.DataKeys[index].Values[0].ToString(); hf_idSolicitud.Value = gv_listar.DataKeys[index].Values[1].ToString(); hf_lugaid.Value = gv_listar.DataKeys[index].Values[2].ToString(); hf_soanorden.Value = gv_listar.DataKeys[index].Values[3].ToString(); hf_timestamp.Value = gv_listar.DataKeys[index].Values[4].ToString(); Limpiar(); hf_accion.Value = e.CommandName; TituloModal(e.CommandName); hf_soli_tipo.Value = "0"; rb_descargar.Checked = false; rb_Desechos.Checked = false; rb_estacionamiento.Checked = false; rb_estacionamientoMan.Checked = false; rb_Pallets.Checked = false; rb_Nada.Checked = false; switch (hf_accion.Value) { case "DEF_PALLETS": rb_Pallets.Checked = true; hf_soli_tipo.Value = "3"; Modal(false, true, true); int luga_trailer = Convert.ToInt32(hf_lugaid.Value); LugarBC luga = new LugarBC(); luga = luga.obtenerXID(luga_trailer); try { ddl_zona.SelectedValue = luga.ID_ZONA.ToString(); ddl_zona_SelectedIndexChanged(null, null); ddl_playa.SelectedValue = luga.ID_PLAYA.ToString(); ddl_playa_SelectedIndexChanged(null, null); ddl_posicion.SelectedValue = luga.ID.ToString(); } catch (Exception) { ddl_zona_SelectedIndexChanged(null, null); } break; case "DEF_DESECHOS": rb_Desechos.Checked = true; hf_soli_tipo.Value = "4"; Modal(false, true, true); luga_trailer = Convert.ToInt32(hf_lugaid.Value); luga = new LugarBC(); luga = luga.obtenerXID(luga_trailer); try { ddl_zona.SelectedValue = luga.ID_ZONA.ToString(); ddl_zona_SelectedIndexChanged(null, null); ddl_playa.SelectedValue = luga.ID_PLAYA.ToString(); ddl_playa_SelectedIndexChanged(null, null); ddl_posicion.SelectedValue = luga.ID.ToString(); } catch (Exception) { ddl_zona_SelectedIndexChanged(null, null); } break; case "DESCARGA_COMPLETA_LI": case "PALLETS_COMPLETAR": Modal(true, false, false); break; case "DESECHOS_COMPLETAR": Modal(true, false, false); break; case "DEF_MOVER": Modal(false, true, true); break; case "DEF_DESCARGA_LI": hf_soli_tipo.Value = "5"; Modal(false, true, false); break; case "DESCARGA_POSICION_LI": case "DESECHOS_TRASLADO_ANDEN": case "DESECHOS_TRASLADO_EST": case "DESECHOS_REINICIAR": case "PALLETS_TRASLADO_ANDEN": case "PALLETS_TRASLADO_EST": case "PALLETS_REINICIAR": case "DEF_DESCARGA": case "DESCARGA_POSICION": case "DESCARGA_MOVER": Modal(false, true, false); break; case "DESCARGA_COMPLETA": // bool ext = Convert.ToBoolean(gv_listar.DataKeys[index].Values[5]); //if (ext) //{ // Modal(false, true, false); //} //else //{ string mensaje; SolicitudBC s = new SolicitudBC(); bool error = s.DescargaCompleta(Convert.ToInt32(hf_idSolicitud.Value), out mensaje, usuario.ID); if (error) { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "msj", "showAlert('Se ha completado la descarga');", true); } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "msj", string.Format("showAlert4('{0}');", mensaje), true); } ObtenerTrailer(true); // } break; case "DESCARGA_BLOQUEAR": SolicitudAndenesBC sa = new SolicitudAndenesBC(); sa.SOLI_ID = Convert.ToInt32(hf_idSolicitud.Value); LugarBC l = new LugarBC(); int play_id = sa.ObtenerPlayaId(); drop.Lugar1(ddl_bloquearPos, Convert.ToInt32(dropsite.SelectedValue), play_id, 0, 1); // l.ObtenerXPlaya(play_id)); gv_bloqueo.DataSource = sa.ObtenerBloqueados(); gv_bloqueo.DataBind(); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "asdf", "modalBloqueoAnden();", true); break; } } }