Esempio n. 1
0
    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);
    }
Esempio n. 2
0
    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);
    }
Esempio n. 3
0
    protected void btn_posModificar_Click(object sender, EventArgs e)
    {
        SolicitudBC s = new SolicitudBC();

        s.SOLI_ID     = int.Parse(this.hf_idSolicitud.Value);
        s.OBSERVACION = "";
        s.ID_DESTINO  = int.Parse(this.ddl_editPos.SelectedValue);
        s.TIMESTAMP   = DateTime.Parse(this.hf_timestamp.Value);
        if (s.validarTimeStamp())
        {
            if (s.ModificarDescarga(s))
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "asdf", "showAlert('Solicitud Modificada');", true);
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "cerrarModal", "$('#modalPosicion').modal('hide');", true);
                this.ObtenerSolicitudes(true);
            }
            else
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "asdf", "alert('Ocurrió un error!');", true);
            }
        }
        else
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "asdf", "alert('No se pudo validar timestamp.');", true);
        }
    }
Esempio n. 4
0
    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);
        }
    }
Esempio n. 5
0
    protected void btn_confirmarMov_Click(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(hf_soliId.Value) && string.IsNullOrEmpty(hf_traiId.Value))
        {
            utils.ShowMessage2(this, "modifica", "warn_trailerVacio"); return;
        }
        if (!Convert.ToBoolean(hf_ordenAndenesOk.Value))
        {
            utils.ShowMessage2(this, "nuevo", "warn_ordenAnden"); return;
        }
        DateTime fh = Convert.ToDateTime(string.Format("{0} {1}", txt_solFecha.Text, txt_solHora.Text));

        if (DateTime.Now.AddMinutes(57) > fh)
        {
            utils.ShowMessage2(this, "nuevo", "warn_horaInvalida"); return;
        }
        DataTable dtAndenes = (DataTable)ViewState["andenes"];
        DataTable dtLocales = (DataTable)ViewState["locales"];
        int       registros;

        try
        {
            registros = dtLocales.Rows.Count;
        }
        catch (NullReferenceException)
        {
            registros = 0;
        }
        if (registros == 0)
        {
            utils.ShowMessage2(this, "nuevo", "warn_andenVacio");
        }
        else
        {
            SolicitudBC s  = new SolicitudBC();
            TrailerBC   tr = new TrailerBC();
            DataSet     ds = new DataSet();
            s.ID_TIPO          = 1;
            s.ID_SITE          = Convert.ToInt32(dropsite.SelectedValue);
            s.ID_USUARIO       = usuario.ID; //Variable sesión
            s.FECHA_CREACION   = DateTime.Now;
            s.FECHA_PLAN_ANDEN = Convert.ToDateTime(string.Format("{0} {1}", txt_solFecha.Text, txt_solHora.Text));
            s.DOCUMENTO        = "";
            s.OBSERVACION      = "";
            s.RUTA             = txt_ruta.Text;
            s.ID_SHORTECK      = ddl_idShortek.SelectedValue;
            if (!String.IsNullOrEmpty(hf_traiId.Value))
            {
                s.ID_TRAILER_RESERVADO = Convert.ToInt32(hf_traiId.Value);
            }
            s.TETR_ID         = Convert.ToInt32(DDL_TEMP.SelectedValue);
            s.Pallets         = Convert.ToInt32(txt_totalPallets.Text);
            s.CARACTERISTICAS = hf_caractSolicitud.Value;
            DataView dw      = new DataView((DataTable)ViewState["trailers"]);
            string   mensaje = "";
            dtAndenes.TableName = "ANDENES";
            dtLocales.TableName = "LOCALES";
            ds.Tables.Add(dtAndenes);
            ds.Tables.Add(dtLocales);
            if (hf_soliId.Value == "0")
            {
                if (s.Carga(ds, out mensaje) && mensaje == "")
                {
                    utils.ShowMessage2(this, "nuevo", "success");
                    btn_limpiarDatos_Click(null, null);
                }
                else
                {
                    utils.ShowMessage(this, mensaje, "error", false);
                }
            }
            else
            {
                s.SOLI_ID   = Convert.ToInt32(this.hf_soliId.Value);
                s.TIMESTAMP = DateTime.Parse(this.hf_timeStamp.Value);
                if (!s.validarTimeStamp())
                {
                    utils.ShowMessage2(this, "modifica", "warn_timestamp"); return;
                }
                if (s.ModificarCarga(ds, out mensaje) && mensaje == "")
                {
                    utils.ShowMessage2(this, "modifica", "success");
                    Response.Redirect("control_carga_new.aspx");
                }
                else
                {
                    utils.ShowMessage(this, mensaje, "error", false);
                }
            }
        }
    }
Esempio n. 6
0
    protected void btn_guardar_Click(object sender, EventArgs e)
    {
        TrailerLogiBC t            = new TrailerLogiBC();
        SolicitudBC   s            = new SolicitudBC();
        int           soli_id      = Convert.ToInt32(hf_idSolicitud.Value);
        int           luga_trailer = 0;
        int           soan_orden   = 0;

        try
        {
            luga_trailer = Convert.ToInt32(hf_lugaid.Value);
            soan_orden   = Convert.ToInt32(hf_soanorden.Value);
        }
        catch (Exception)
        {
        }

        int luga_id = 0;
        int site_id = 0;

        try
        {
            luga_id = Convert.ToInt32(ddl_posicion.SelectedValue);
            site_id = Convert.ToInt32(dropsite.SelectedValue);
        }
        catch (Exception)
        {
        }

        string mensaje = "";
        bool   error   = true;

        switch (hf_accion.Value)
        {
        case "DEF_PALLETS":
        case "DEF_DESECHOS":
            if (luga_id != 0)
            {
                error = CrearSolicitud(luga_id, "", out mensaje);
            }
            else
            {
                utils.ShowMessage(this, "Complete todos los datos", "warn", true);
                return;
            }
            break;

        case "DEF_DESCARGA_LI":
            if (luga_id != 0)
            {
                s             = new SolicitudBC();
                s.ID_SITE     = site_id;
                s.ID_USUARIO  = usuario.ID;
                s.DOCUMENTO   = txt_doc.Text;
                s.OBSERVACION = txt_obs.Text;
                s.ID_TRAILER  = Convert.ToInt32(hf_idTrailer.Value);

                error = t.DescargaLI_Crear(s, luga_id, out mensaje);

                if (string.IsNullOrEmpty(mensaje))
                {
                    mensaje = "Se ha creado la solicitud.";
                }
            }
            else
            {
                utils.ShowMessage(this, "Complete todos los datos", "warn", true);
                return;
            }
            break;

        case "DEF_MOVER":
            MovimientoBC mov = new MovimientoBC();
            mov.ID_TRAILER  = Convert.ToInt32(hf_idTrailer.Value);
            mov.OBSERVACION = "";
            mov.ID_DESTINO  = Convert.ToInt32(ddl_posicion.SelectedValue);
            mov.OBSERVACION = txt_obs.Text;
            mov.petroleo    = null;
            error           = mov.MOVIMIENTO(mov, site_id, usuario.ID, out mensaje);
            if (string.IsNullOrEmpty(mensaje))
            {
                mensaje = "Se ha generado el movimiento";
            }
            break;

        case "DESCARGA_EDITA":
            break;

        case "DESCARGA_POSICION_LI":
            break;

        case "DESCARGA_COMPLETA_LI":
            error = t.DescargaLI_Completar(soli_id, luga_trailer, soan_orden, usuario.ID, out mensaje);
            if (string.IsNullOrEmpty(mensaje))
            {
                string error_out;
                mensaje = "Se ha completado la solicitud.";
                error   = CrearSolicitud(luga_id, mensaje, out error_out);
                mensaje = error_out;
            }
            break;

        case "DESECHOS_COMPLETAR":
            error = t.Desechos_Completar(soli_id, luga_trailer, soan_orden, usuario.ID, out mensaje);
            if (string.IsNullOrEmpty(mensaje) && !rb_Nada.Checked)
            {
                mensaje = "Se ha completado la solicitud. ";
                string error_out;
                error   = CrearSolicitud(luga_id, mensaje, out error_out);
                mensaje = error_out;
            }
            break;

        case "PALLETS_COMPLETAR":
            error = t.PALLETS_Completar(soli_id, luga_trailer, soan_orden, usuario.ID, out mensaje);
            if (string.IsNullOrEmpty(mensaje) && !rb_Nada.Checked)
            {
                mensaje = "Se ha completado la solicitud. ";
                string error_out;
                error   = CrearSolicitud(luga_id, mensaje, out error_out);
                mensaje = error_out;
            }
            break;

        case "PALLETS_TRASLADO_ANDEN":
            error = t.Pallets_Reiniciar(soli_id, luga_trailer, luga_id, usuario.ID, soan_orden, soan_orden + 1, out mensaje);

            if (string.IsNullOrEmpty(mensaje))
            {
                mensaje = "Se ha generado el movimiento";
            }
            break;

        case "PALLETS_TRASLADO_EST":

            error = t.Pallets_TrasladoEst(soli_id, luga_trailer, luga_id, soan_orden, usuario.ID, out mensaje);
            if (string.IsNullOrEmpty(mensaje))
            {
                mensaje = "Se ha generado el movimiento";
            }
            break;

        case "PALLETS_REINICIAR":
            error = t.Pallets_Reiniciar(soli_id, luga_trailer, luga_id, usuario.ID, 0, soan_orden + 1, out mensaje);
            if (string.IsNullOrEmpty(mensaje))
            {
                mensaje = "Se ha reanudado la descarga";
            }
            break;

        case "DEF_DESCARGA":
        case "DESCARGA_COMPLETA":
            error = s.DescargaCompleta(soli_id, out mensaje, usuario.ID, luga_id);
            if (string.IsNullOrEmpty(mensaje))
            {
                mensaje = "Se ha completado la descarga";
            }
            break;

        case "DESCARGA_POSICION":
            s             = new SolicitudBC();
            s.SOLI_ID     = Convert.ToInt32(hf_idSolicitud.Value);
            s.OBSERVACION = "";
            s.ID_DESTINO  = luga_id;
            s.TIMESTAMP   = Convert.ToDateTime(hf_timestamp.Value);
            if (s.validarTimeStamp())
            {
                error = s.ModificarDescarga(s);
                if (string.IsNullOrEmpty(mensaje))
                {
                    mensaje = "Se ha modificado la solicitud";
                }
                else
                {
                    mensaje = "Error";
                }
            }
            else
            {
                mensaje = "No se pudo validar timestamp.";
            }
            break;

        case "DESCARGA_MOVER":
            MovimientoBC m = new MovimientoBC();
            s              = new SolicitudBC();
            m.ID_DESTINO   = luga_id;
            m.ID_TRAILER   = Convert.ToInt32(hf_idTrailer.Value);
            m.ID_SOLICITUD = soli_id;
            m.OBSERVACION  = "";

            error = s.DescargaMovimiento(m, site_id, usuario.ID, out mensaje);
            if (string.IsNullOrEmpty(mensaje))
            {
                mensaje = "Se ha generado el movimiento";
            }
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "cerrarmodal", "cerrarModal('modalLogistica');", true);
            break;
        }

        if (error)
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "msj", string.Format("showAlert('{0}');", mensaje), true);
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "cerrar", "cerrarModal('modalLogistica');", true);
        }
        else
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "msj", string.Format("showAlert4('{0}');", mensaje), true);
        }
        ObtenerTrailer(true);
    }
Esempio n. 7
0
    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);
            }
        }
    }
Esempio n. 8
0
 protected void btn_confirmarMov_Click(object sender, EventArgs e)
 {
     if (this.hf_ordenAndenesOk.Value.ToLower() == "true")
     {
         DataTable dtAndenes = (DataTable)ViewState["andenes"];
         DataTable dtLocales = (DataTable)ViewState["locales"];
         int       registros;
         try
         {
             registros = dtLocales.Rows.Count;
         }
         catch (NullReferenceException)
         {
             registros = 0;
         }
         if (registros == 0)
         {
             ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('No hay andenes de carga seleccionados para la solicitud');", true);
         }
         else
         {
             SolicitudBC s = new SolicitudBC();
             s.ID_TIPO          = 1;
             s.ID_SITE          = Convert.ToInt32(this.dropsite.SelectedValue);
             s.ID_USUARIO       = usuario.ID; //Variable sesión
             s.FECHA_CREACION   = DateTime.Now;
             s.FECHA_PLAN_ANDEN = Convert.ToDateTime(string.Format("{0} {1}", this.txt_solFecha.Text, this.txt_solHora.Text));
             s.DOCUMENTO        = "";
             s.OBSERVACION      = "";
             s.RUTA             = this.txt_ruta.Text;
             s.ID_SHORTECK      = this.ddl_idShortek.SelectedValue;
             if (!String.IsNullOrEmpty(this.hf_traiId.Value))
             {
                 s.ID_TRAILER_RESERVADO = Convert.ToInt32(this.hf_traiId.Value);
             }
             s.TETR_ID         = Convert.ToInt32(this.DDL_TEMP.SelectedValue);
             s.Pallets         = Convert.ToInt32(this.txt_totalPallets.Text);
             s.CARACTERISTICAS = this.hf_caractSolicitud.Value;
             DataTable dt3 = (DataTable)(this.ViewState["trailers"]);
             if (DateTime.Now.AddMinutes(57) > s.FECHA_PLAN_ANDEN)
             {
                 ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('Se Necesita al menos una hora para colocar el Trailer en Anden.');", true);
                 return;
             }
             if (string.IsNullOrEmpty(this.hf_traiId.Value))
             {
                 ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('debe seleccionar trailer');", true);
                 return;
             }
             if ((dt3 != null && dt3.Select(string.Format("TRAI_ID = {0}", this.hf_traiId.Value)).Count() < 1) && (this.hf_traiId.Value != "0" || this.hf_soliId.Value != "0"))
             {
                 ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('Trailer Incompatible con solicitud o bloqueado');", true);
                 return;
             }
             TrailerBC tr = new TrailerBC();
             if (s.ID_TRAILER_RESERVADO != 0)
             {
                 tr = tr.obtenerXID(int.Parse(this.hf_traiId.Value));
                 if (s.ID_TRAILER_RESERVADO != 0 && (tr.SOLI_ID != 0 || tr.MOVI_ID != 0))
                 {
                     ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('Trailer asignado a Solicitud o Movimiento');", true);
                     return;
                 }
             }
             string  mensaje = "";
             DataSet ds      = new DataSet();
             dtAndenes.TableName = "ANDENES";
             dtLocales.TableName = "LOCALES";
             ds.Tables.Add(dtAndenes);
             ds.Tables.Add(dtLocales);
             if (this.hf_soliId.Value == "0")
             {
                 if (s.Carga(ds, out mensaje) && mensaje == "")
                 {
                     ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "showAlert('Solicitud Creada Correctamente.');", true);
                     btn_limpiarDatos_Click(null, null);
                 }
                 else
                 {
                     ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", string.Format("alert('{0}');", mensaje), true);
                 }
             }
             else
             {
                 s.TIMESTAMP = DateTime.Parse(this.hf_timeStamp.Value);
                 if (!s.validarTimeStamp())
                 {
                     ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('Timestamp incorrecto.');", true);
                     return;
                 }
                 else
                 {
                     if (s.ModificarCarga(ds, out mensaje) && mensaje == "")
                     {
                         ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('Todo Ok');", true);
                         Response.Redirect("control_carga_new.aspx");
                     }
                     else
                     {
                         ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", string.Format("alert('{0}');", mensaje), true);
                     }
                 }
             }
         }
     }
 }