protected void gv_listar_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "COMPLETAR") { this.hf_idSolicitud.Value = e.CommandArgument.ToString(); if (this.comprobarTrailerEx()) { this.btn_mover.Visible = false; this.btn_posModificar.Visible = false; this.btn_cargaFin.Visible = true; this.btn_finalizarExterno.Visible = true; this.llenarForm(); } else { //btn_cargaFin.Visible = true; this.btn_mover.Visible = false; this.btn_finalizarExterno.Visible = false; ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "asdf", "modalConfirmacion();", true); } } if (e.CommandName == "Edit") { this.hf_idSolicitud.Value = e.CommandArgument.ToString(); string id = this.hf_idSolicitud.Value; string url = string.Format("Solicitud_Descarga.aspx?soli_id={0}&type=edit", id); this.Response.Redirect(url); } if (e.CommandName == "EDITPOS") { this.hf_idSolicitud.Value = e.CommandArgument.ToString(); this.btn_mover.Visible = false; this.btn_posModificar.Visible = true; this.btn_cargaFin.Visible = false; this.btn_finalizarExterno.Visible = false; this.llenarForm(); } if (e.CommandName == "POSICION") { this.hf_idSolicitud.Value = e.CommandArgument.ToString(); this.btn_mover.Visible = true; this.btn_posModificar.Visible = false; this.btn_cargaFin.Visible = false; this.btn_finalizarExterno.Visible = false; this.llenarForm(); } if (e.CommandName == "BLOQUEAR") { this.hf_idSolicitud.Value = e.CommandArgument.ToString(); SolicitudAndenesBC s = new SolicitudAndenesBC(); s.SOLI_ID = int.Parse(this.hf_idSolicitud.Value); //LugarBC l = new LugarBC(); int play_id = s.ObtenerPlayaId(); this.drops.Lugar1(this.ddl_bloquearPos, 0, play_id, 1); //utils.CargaDrop(ddl_bloquearPos, "ID", "DESCRIPCION", l.ObtenerXPlaya(play_id)); this.gv_bloqueo.DataSource = s.ObtenerBloqueados(); this.gv_bloqueo.DataBind(); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "asdf", "modalBloqueoAnden();", true); } }
protected void btn_reanudar_Click(object sender, EventArgs e) { SolicitudAndenesBC sa = new SolicitudAndenesBC(); SolicitudBC s = new SolicitudBC(); s.SOLI_ID = Convert.ToInt32(hf_soliId.Value); s.TIMESTAMP = DateTime.Parse(hf_timeStamp.Value); if (!s.validarTimeStamp()) { utils.ShowMessage2(this, "locales", "warn_timestamp"); return; } DataSet ds = new DataSet(); ds.Tables.Add((DataTable)ViewState["andenes"]); ds.Tables.Add((DataTable)ViewState["locales"]); string resultado; bool ejecucion = sa.ReanudarCarga(ds, this.usuario.ID, out resultado); if (resultado == "" && ejecucion) { utils.ShowMessage2(this, "reanudar", "success"); utils.CerrarModal(this, "modalReanudar"); } else { utils.ShowMessage(this, resultado, "error", false); } ObtenerSolicitudes(true); }
protected void btn_emergencia_Click(object sender, EventArgs e) { SolicitudAndenesBC sa = new SolicitudAndenesBC(); SolicitudBC s = new SolicitudBC(); s.SOLI_ID = Convert.ToInt32(this.hf_soliId.Value); s.TIMESTAMP = Convert.ToDateTime(this.hf_timeStamp.Value); if (!s.validarTimeStamp()) { utils.ShowMessage2(this, "locales", "warn_timestamp"); return; } DataTable dt = (DataTable)this.ViewState["locales"]; DataTable dt2 = (DataTable)ViewState["andenes"]; string error = ""; if (sa.Emergencia(dt, dt2, this.usuario.ID, out error) && error == "") { utils.ShowMessage2(this, "andenEmergencia", "success"); utils.CerrarModal(this, "modalReanudar"); } else { utils.ShowMessage(this, error, "error", false); } this.ObtenerSolicitudes(true); }
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(); }
private void ObtenerLocalesSolicitud(bool forzarBD) { DataView dw; if (this.ViewState["locales"] == null || forzarBD) { int soli_id = Convert.ToInt32(this.hf_soliId.Value); DataSet ds; if (Request.Params["type"] == "devolucion") { ds = new SolicitudAndenesBC().ObtenerFinalizados(soli_id); int contador = 0; while (contador < ds.Tables["ANDENES"].Rows.Count) { // ds.Tables["ANDENES"].Rows[contador]["SOAN_ORDEN"] = "1"; // ds.Tables["ANDENES"].Rows[contador]["luga_id"] = ds.Tables["ANDENES"].Rows[0]["luga_id"]; // ds.Tables["ANDENES"].Rows[contador]["solicitud_anden"] = ds.Tables["ANDENES"].Rows[0]["solicitud_anden"]; // ds.Tables["ANDENES"].Rows[contador]["anden"] = ds.Tables["ANDENES"].Rows[0]["anden"]; // ds.Tables["ANDENES"].Rows[contador]["soes_id"] = 150; // ds.Tables["ANDENES"].Rows[contador]["soan_cod"] = ds.Tables["ANDENES"].Rows[0]["soan_cod"]; contador = contador + 1; } dw = new DataView(ds.Tables["ANDENES"]); dw.RowFilter = "SOAN_ORDEN = 1"; ViewState["andenes"] = dw.ToTable(); DataTable dt = ds.Tables["LOCALES"]; foreach (DataRow dr in dt.Rows) { dr["LUGA_ID"] = ds.Tables["ANDENES"].Rows[0]["LUGA_ID"]; dr["SOAN_ORDEN"] = ds.Tables["ANDENES"].Rows[0]["SOAN_ORDEN"]; dr["ANDEN"] = "--";//ds.Tables["ANDENES"].Rows[0]["ANDEN"]; } ViewState["locales"] = dt; } else { ds = new SolicitudAndenesBC().ObtenerTodo(soli_id); ViewState["locales"] = ds.Tables["LOCALES"]; ViewState["andenes"] = ds.Tables["ANDENES"]; } ReordenarLocales(); } dw = ((DataTable)ViewState["locales"]).AsDataView(); dw.Sort = "SOAN_ORDEN,SOLD_ORDEN ASC"; ViewState["locales"] = dw.ToTable(); gv_solLocales.DataSource = ViewState["locales"]; gv_solLocales.DataBind(); calcula_solicitud(null, null); }
protected void btn_terminarCarga_Click(object sender, EventArgs e) { SolicitudAndenesBC anden = new SolicitudAndenesBC(); anden.SOLI_ID = int.Parse(hf_idSolicitud.Value); anden.LUGA_ID = int.Parse(hf_idLugar.Value); anden.SOAN_ORDEN = int.Parse(hf_orden.Value); switch (hf_idEstado.Value) { case "Cargado": anden.FECHA_CARGA_FIN = DateTime.Parse(txt_fechaCarga.Text + " " + txt_horaCarga.Text); string resultado; bool ejecucion = anden.CompletarCarga(anden, usuario.ID, out resultado); if (ejecucion && resultado == "") { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "showAlert('CARGA COMPLETA, DISPONIBLE PARA PONER SELLO');", true); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "cerrar", "cerrarModal('modalCarga');", true); ObtenerSolicitudes(true); } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('" + resultado + "');", true); } break; case "Parcial": anden.FECHA_CARGA_FIN = DateTime.Parse(txt_fechaCarga.Text + " " + txt_horaCarga.Text); anden.PALLETS_CARGADOS = int.Parse(txt_palletsCargados.Text); string resultado1; bool ejecucion1 = anden.InterrumpirCarga(anden, usuario.ID, out resultado1); if (ejecucion1 && resultado1 == "") { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "showAlert('CARGA PARCIAL');", true); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "cerrar", "cerrarModal('modalCarga');", true); ObtenerSolicitudes(true); } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('" + resultado1 + "');", true); } break; default: ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('Se produjo un error');", true); break; } btn_buscarSolicitud_Click(null, null); }
private void validado_sello() { SolicitudAndenesBC anden = new SolicitudAndenesBC(); anden.SOLI_ID = Convert.ToInt32(this.hf_soliId.Value); string resultado; bool ejecucion = anden.SelloValidado(usuario.ID, out resultado); if (ejecucion && resultado == "") { utils.ShowMessage2(this, "validadoSello", "success"); } else { utils.ShowMessage(this, resultado, "error", false); } this.ObtenerSolicitudes(true); }
protected void validado_sello() { SolicitudAndenesBC anden = new SolicitudAndenesBC(); anden.SOLI_ID = int.Parse(this.hf_idSolicitud.Value); string resultado; bool ejecucion = anden.SelloValidado(this.usuario.ID, out resultado); if (ejecucion && resultado == "") { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "showAlert('CARRO CARGADO A ESTACIONAMIENTO');", true); this.ObtenerSolicitudes(true); } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", string.Format("alert('{0}');", resultado), true); } }
protected void btn_bloquearAgregar_Click(object sender, EventArgs e) { SolicitudAndenesBC s = new SolicitudAndenesBC(); string resultado; s.LUGA_ID = int.Parse(this.ddl_bloquearPos.SelectedValue); s.SOLI_ID = int.Parse(this.hf_idSolicitud.Value); if (s.Bloquear(this.u.ID, out resultado)) { this.gv_bloqueo.DataSource = s.ObtenerBloqueados(); this.gv_bloqueo.DataBind(); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "msj", string.Format("showAlert('{0}');", resultado), true); } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "msj", string.Format("alert('{0}');", resultado), true); } }
private void ObtenerLocalesSolicitud(bool forzarBD) { if (this.ViewState["locales"] == null || forzarBD) { SolicitudAndenesBC sa = new SolicitudAndenesBC(); sa.SOLI_ID = Convert.ToInt32(this.hf_soliId.Value); DataSet ds = sa.ObtenerTodo(sa.SOLI_ID); this.ViewState["locales"] = ds.Tables["LOCALES"]; this.ViewState["andenes"] = ds.Tables["ANDENES"]; this.ReordenarLocales(); } DataView dw = ((DataTable)this.ViewState["locales"]).AsDataView(); dw.Sort = "SOAN_ORDEN,SOLD_ORDEN ASC"; this.ViewState["locales"] = dw.ToTable(); this.gv_solLocales.DataSource = this.ViewState["locales"]; this.gv_solLocales.DataBind(); this.calcula_solicitud(null, null); }
protected void gv_bloqueo_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "QUITAR") { SolicitudAndenesBC s = new SolicitudAndenesBC(); string resultado; s.SOLI_ID = Convert.ToInt32(hf_idSolicitud.Value); s.LUGA_ID = Convert.ToInt32(e.CommandArgument.ToString()); if (s.Liberar(usuario.ID, out resultado)) { gv_bloqueo.DataSource = s.ObtenerBloqueados(); gv_bloqueo.DataBind(); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "msj", "showAlert('" + resultado + "');", true); } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "msj", "alert('" + resultado + "');", true); } } }
protected void gv_bloqueo_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "QUITAR") { SolicitudAndenesBC s = new SolicitudAndenesBC(); string resultado; s.SOLI_ID = int.Parse(this.hf_idSolicitud.Value); s.LUGA_ID = int.Parse(e.CommandArgument.ToString()); if (s.Liberar(this.u.ID, out resultado)) { this.gv_bloqueo.DataSource = s.ObtenerBloqueados(); this.gv_bloqueo.DataBind(); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "msj", string.Format("showAlert('{0}');", resultado), true); } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "msj", string.Format("alert('{0}');", resultado), true); } } }
protected void btn_bloquearAgregar_Click(object sender, EventArgs e) { SolicitudAndenesBC s = new SolicitudAndenesBC(); string resultado; s.LUGA_ID = Convert.ToInt32(ddl_bloquearPos.SelectedValue); s.SOLI_ID = Convert.ToInt32(hf_idSolicitud.Value); if (s.Bloquear(usuario.ID, out resultado)) { gv_bloqueo.DataSource = s.ObtenerBloqueados(); gv_bloqueo.DataBind(); utils.ShowMessage(this, resultado, "success", true); } else { utils.ShowMessage(this, resultado, "error", false); } }
protected void btn_cargaTerminar_Click(object sender, EventArgs e) { SolicitudAndenesBC anden = new SolicitudAndenesBC(); anden.SOLI_ID = Convert.ToInt32(this.hf_soliId.Value); anden.LUGA_ID = Convert.ToInt32(this.hf_lugaId.Value); anden.SOAN_ORDEN = Convert.ToInt32(this.hf_soanOrden.Value); anden.FECHA_CARGA_FIN = DateTime.Parse(string.Format("{0} {1}", this.txt_fechaCarga.Text, this.txt_horaCarga.Text)); string resultado; bool ejecucion = anden.CompletarCarga(anden, this.usuario.ID, out resultado); if (ejecucion && resultado == "") { utils.ShowMessage2(this, "cargaCompleta", "success"); utils.CerrarModal(this, "modalCarga"); this.ObtenerSolicitudes(true); } else { utils.ShowMessage(this, resultado, "error", false); } this.ObtenerSolicitudes(true); }
protected void btn_cargaParcial_Click(object sender, EventArgs e) { SolicitudAndenesBC anden = new SolicitudAndenesBC(); anden.SOLI_ID = Convert.ToInt32(this.hf_soliId.Value); anden.LUGA_ID = Convert.ToInt32(this.hf_lugaId.Value); anden.SOAN_ORDEN = Convert.ToInt32(this.hf_soanOrden.Value); anden.FECHA_CARGA_FIN = DateTime.Parse(string.Format("{0} {1}", this.txt_fechaCarga.Text, this.txt_horaCarga.Text)); anden.PALLETS_CARGADOS = Convert.ToInt32(this.txt_palletsCargados.Text); string resultado1; bool ejecucion1 = anden.InterrumpirCarga(anden, this.usuario.ID, out resultado1); if (ejecucion1 && resultado1 == "") { utils.ShowMessage2(this, "cargaParcial", "success"); utils.CerrarModal(this, "modalCarga"); } else { utils.ShowMessage(this, resultado1, "error", false); } this.ObtenerSolicitudes(true); }
protected void btn_reanudar_Click(object sender, EventArgs e) { if (hf_ordenAndenesOk.Value.ToLower() == "true") { SolicitudAndenesBC sa = new SolicitudAndenesBC(); SolicitudBC s = new SolicitudBC(); bool exito = false; s.SOLI_ID = int.Parse(hf_idSolicitud.Value); s.TIMESTAMP = DateTime.Parse(hf_timeStamp.Value); if (!s.validarTimeStamp()) { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('Timestamp incorrecto.');", true); exito = false; } else { sa.SOLI_ID = s.SOLI_ID; bool registros = false; DataView dw = new DataView((DataTable)ViewState["datosA"]); dw.RowFilter = "SOES_ID = -1"; DataTable dt = dw.ToTable(true, "SOAN_ORDEN", "ID_ANDEN"); DataTable dt2 = dw.ToTable(); exito = true; DataView dw2 = new DataView((DataTable)ViewState["datosA"]); dw2.RowFilter = "SOES_ID = -1 or SOES_ID = 100"; DataTable dt4 = dw2.ToTable(); registros = (dt4.Rows.Count > 0); // exito = registros; foreach (DataRow row in dt.Rows) { exito = true; registros = true; sa.MINS_CARGA_EST = 60; //Variable calculada automáticamente sa.LUGA_ID = int.Parse(row["ID_ANDEN"].ToString()); sa.SOAN_ORDEN = int.Parse(row["SOAN_ORDEN"].ToString()); if (sa.AgregarAnden()) { exito = true; } else { exito = false; break; } } if (exito) { foreach (DataRow row in dt2.Rows) { SolicitudLocalesBC sl = new SolicitudLocalesBC(); sl.SOLI_ID = s.SOLI_ID; sl.LUGA_ID = int.Parse(row["ID_ANDEN"].ToString()); sl.LOCA_ID = int.Parse(row["ID_LOCAL"].ToString()); sl.PALLETS = int.Parse(row["PALLETS"].ToString()); sl.SOAN_ORDEN = int.Parse(row["SOAN_ORDEN"].ToString()); sl.SOLD_ORDEN = int.Parse(row["ORDEN"].ToString()); if (sl.AgregarLocal(sl)) { exito = true; } else { exito = false; break; } } if (!registros) { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "showAlert('Debe agregar al menos un andén de carga para continuar la carga.');", true); } else if (exito) { // int nuevolugar; //if (rb_nuevoSi.Checked) // nuevolugar = 0; //else // nuevolugar = int.Parse(ddl_nuevoAnden.SelectedValue); string resultado; bool ejecucion = sa.ReanudarCarga(sa.SOLI_ID, usuario.ID, out resultado); if (resultado == "" && ejecucion) { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "showAlert('Se reanudó la carga correctamente.');", true); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje2", "cerrarModal('modalReanudar');", true); } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('" + resultado + "');", true); } btn_buscarSolicitud_Click(null, null); } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "showAlert('Error');", true); } } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "showAlert('Error');", true); } } } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('Error: Compruebe el órden de los andenes seleccionados.');", true); } }
public bool CancelarCarga(SolicitudAndenesBC anden, int id_usuario, out string resultado) { return(tran.SolicitudAnden_CancelarCarga(anden, id_usuario, out resultado)); }
public bool InterrumpirCarga(SolicitudAndenesBC anden, int id_usuario, out string resultado) { return(tran.SolicitudAnden_InterrumpirCarga(anden, id_usuario, out resultado)); }
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(); }
public bool AgregarAnden(SolicitudAndenesBC anden) { return(tran.SolicitudAnden_Agregar(anden)); }
public bool AgregarAnden(SolicitudAndenesBC anden, out int soan_orden) { return(tran.SolicitudAnden_Agregar(anden, out soan_orden)); }
public bool Bloquear(SolicitudAndenesBC s, int usua_id, out string resultado) { return(tran.SolicitudAnden_Bloquear(s, usua_id, out resultado)); }
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; } } }
protected void btn_reanudar_Click(object sender, EventArgs e) { SolicitudAndenesBC sa = new SolicitudAndenesBC(); SolicitudBC s = new SolicitudBC(); bool exito = false; s.SOLI_ID = int.Parse(this.hf_idSolicitud.Value); s.TIMESTAMP = DateTime.Parse(this.hf_timeStamp.Value); if (!s.validarTimeStamp()) { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('Timestamp incorrecto.');", true); exito = false; } else { sa.SOLI_ID = s.SOLI_ID; bool registros = false; DataTable dt2 = this.ViewState["datosA"] as DataTable; foreach (DataRow row in dt2.Rows) { exito = true; registros = true; if (row["SOES_ID"].ToString() == "100") { registros = true; sa.MINS_CARGA_EST = 60; //Variable calculada automáticamente sa.LUGA_ID = int.Parse(row["ID_ANDEN"].ToString()); int orden; if (sa.AgregarAnden(sa, out orden) && orden > 0) { DataRow[] dtLocales = dt2.Select(string.Format("ID_ANDEN = {0} and orden= {1}", sa.LUGA_ID, orden)); foreach (DataRow rowLocal in dtLocales) { SolicitudLocalesBC sl = new SolicitudLocalesBC(); sl.SOLI_ID = s.SOLI_ID; sl.LUGA_ID = int.Parse(rowLocal["ID_ANDEN"].ToString()); sl.LOCA_ID = int.Parse(rowLocal["ID_LOCAL"].ToString()); sl.PALLETS = int.Parse(rowLocal["PALLETS"].ToString()); sl.SOAN_ORDEN = orden; sl.SOLD_ORDEN = int.Parse(rowLocal["ORDEN"].ToString()); if (sl.AgregarLocal(sl)) { exito = true; } else { exito = false; break; } } } else { exito = false; break; } } } if (!registros) { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "showAlert('Debe agregar al menos un andén de carga para continuar la carga.');", true); } else if (exito) { // int nuevolugar; //if (rb_nuevoSi.Checked) // nuevolugar = 0; //else // nuevolugar = int.Parse(ddl_nuevoAnden.SelectedValue); string resultado; bool ejecucion = sa.ReanudarCarga(sa.SOLI_ID, this.usuario.ID, out resultado); if (resultado == "" && ejecucion) { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "showAlert('Se reanudó la carga correctamente.');", true); } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", string.Format("alert('{0}');", resultado), true); } this.btn_buscarSolicitud_Click(null, null); } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "showAlert('Error');", true); } } }
protected void gv_listar_RowCommand(object sender, GridViewCommandEventArgs e) { SolicitudAndenesBC sa = new SolicitudAndenesBC(); string resultado; try { gv_listar.SelectedIndex = Convert.ToInt32(e.CommandArgument); sa.SOLI_ID = Convert.ToInt32(gv_listar.SelectedDataKey.Values[0]); sa.LUGA_ID = Convert.ToInt32(gv_listar.SelectedDataKey.Values[1]); sa.SOAN_ORDEN = Convert.ToInt32(gv_listar.SelectedDataKey.Values[2]); sa = sa.ObtenerXId(); } catch (Exception) { } hf_accion.Value = e.CommandName; LugarBC l = new LugarBC(); switch (e.CommandName.ToString()) { case "anden": hf_soliId.Value = sa.SOLI_ID.ToString(); hf_soanOrden.Value = sa.SOAN_ORDEN.ToString(); lbl_confirmarTitulo.Text = "Comenzar Carga"; lbl_confirmarMensaje.Text = "¿Comenzar Carga?"; btn_eliminarSolicitud.Visible = false; hf_soanOrden.Value = sa.SOAN_ORDEN.ToString(); hf_lugaId.Value = sa.LUGA_ID.ToString(); btn_andenListo.Visible = true; utils.AbrirModal(this, "modalConfirmar"); break; case "CANCELAR": hf_soliId.Value = sa.SOLI_ID.ToString(); lbl_confirmarTitulo.Text = "Eliminar Solicitud"; lbl_confirmarMensaje.Text = "Se eliminará la solicitud de la base de datos ¿Desea continuar?"; btn_eliminarSolicitud.Visible = true; btn_andenListo.Visible = false; utils.AbrirModal(this, "modalConfirmar"); break; case "encender": hf_soliId.Value = sa.SOLI_ID.ToString(); SolicitudBC solicitud = new SolicitudBC(); solicitud.SOLI_ID = Convert.ToInt32(this.hf_soliId.Value); resultado = ""; bool ejecucion = solicitud.Encender_termo(this.usuario.ID, out resultado); if (ejecucion && resultado == "") { utils.ShowMessage2(this, "encender", "success"); } else { utils.ShowMessage(this, resultado, "error", false); } ObtenerSolicitudes(true); break; case "AndenEmergencia": LimpiarLocales(); l.ObtenerXPlaya(sa.PLAY_ID); btn_loc.Visible = false; hf_soliId.Value = sa.SOLI_ID.ToString(); hf_soanOrden.Value = sa.SOAN_ORDEN.ToString(); hf_caractSolicitud.Value = sa.CARACTERISTICAS; hf_localesSeleccionados.Value = sa.LOCALES; hf_timeStamp.Value = sa.TIMESTAMP.ToString(); ObtenerLocalesSolicitud(true); utils.CargaDropNormal(this.ddl_reanudarAnden, "ID", "CODIGO", l.ObtenerXPlaya(sa.PLAY_ID, 0, 1)); ddl_reanudarAnden.Items.Remove(ddl_reanudarAnden.Items.FindByValue(sa.LUGA_ID.ToString())); lbl_tituloModal.Text = "Agregar Andén de Emergencia"; gv_reanudarLocales.Columns[0].Visible = false; gv_reanudarLocales.Columns[1].Visible = false; btn_reanudar.Visible = false; btn_emergencia.Visible = true; txt_reanudarLocal.Enabled = true; txt_reanudarCodLocal.Enabled = true; btn_agregarCarga.Enabled = true; ddl_reanudarAnden.Enabled = true; utils.AbrirModal(this, "modalReanudar"); break; case "Locales": btn_loc.Visible = true; LimpiarLocales(); hf_soliId.Value = sa.SOLI_ID.ToString(); hf_caractSolicitud.Value = sa.CARACTERISTICAS; hf_localesSeleccionados.Value = sa.LOCALES; hf_timeStamp.Value = sa.TIMESTAMP.ToString(); ObtenerLocalesSolicitud(true); utils.CargaDropNormal(this.ddl_reanudarAnden, "SOAN_COD", "SOLICITUD_ANDEN", (DataTable)this.ViewState["andenes"]); ddl_reanudarAnden.SelectedValue = string.Format("{0},{1},{2}", sa.SOLI_ID, sa.LUGA_ID, sa.SOAN_ORDEN); btn_reanudar.Visible = false; btn_emergencia.Visible = false; lbl_tituloModal.Text = "Modificar Locales"; gv_reanudarLocales.Columns[0].Visible = true; gv_reanudarLocales.Columns[1].Visible = true; txt_reanudarLocal.Enabled = true; txt_reanudarCodLocal.Enabled = true; btn_agregarCarga.Enabled = true; ddl_reanudarAnden.Enabled = true; utils.AbrirModal(this, "modalReanudar"); break; case "Parcial": txt_fechaCarga.Text = DateTime.Now.ToShortDateString(); txt_horaCarga.Text = DateTime.Now.ToShortTimeString(); hf_soliId.Value = sa.SOLI_ID.ToString(); hf_soanOrden.Value = sa.SOAN_ORDEN.ToString(); hf_lugaId.Value = sa.LUGA_ID.ToString(); dv_pallets.Visible = true; btn_cargaParcial.Visible = true; btn_cargaTerminar.Visible = false; btn_loc.Visible = false; utils.AbrirModal(this, "modalCarga"); break; case "Continuar": btn_loc.Visible = false; LimpiarLocales(); hf_soliId.Value = sa.SOLI_ID.ToString(); hf_caractSolicitud.Value = sa.CARACTERISTICAS; hf_localesSeleccionados.Value = sa.LOCALES; hf_timeStamp.Value = sa.TIMESTAMP.ToString(); ObtenerLocalesSolicitud(true); utils.CargaDrop(ddl_reanudarAnden, "ID", "DESCRIPCION", l.ObtenerXPlaya(sa.PLAY_ID)); btn_reanudar.Visible = true; btn_emergencia.Visible = false; lbl_tituloModal.Text = "Reanudar Carga"; gv_reanudarLocales.Columns[0].Visible = true; gv_reanudarLocales.Columns[1].Visible = true; txt_reanudarLocal.Enabled = true; txt_reanudarCodLocal.Enabled = true; btn_agregarCarga.Enabled = true; ddl_reanudarAnden.Enabled = true; utils.AbrirModal(this, "modalReanudar"); break; case "Cargado": btn_loc.Visible = false; dv_pallets.Visible = false; btn_cargaParcial.Visible = false; btn_cargaTerminar.Visible = true; txt_fechaCarga.Text = DateTime.Now.ToShortDateString(); txt_horaCarga.Text = DateTime.Now.ToShortTimeString(); hf_soliId.Value = sa.SOLI_ID.ToString(); hf_soanOrden.Value = sa.SOAN_ORDEN.ToString(); hf_lugaId.Value = sa.LUGA_ID.ToString(); utils.AbrirModal(this, "modalCarga"); break; case "Edit": string url = string.Format("Solicitud_Carga.aspx?id={0}&type=edit", sa.SOLI_ID); this.Response.Redirect(url); break; case "colocar_sello": this.hf_soliId.Value = sa.SOLI_ID.ToString(); this.validar_sello(); break; case "validar_sello": this.hf_soliId.Value = sa.SOLI_ID.ToString(); this.validado_sello(); break; } }
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; }