Example #1
0
    protected void btn_tranGrabar_Click(object sender, EventArgs e)
    {
        if (string.IsNullOrEmpty(txt_editRutTran.Text))
        {
            utils.ShowMessage2(this, "crearTransportista", "warn_RutVacio"); return;
        }
        if (string.IsNullOrEmpty(txt_editNombre.Text))
        {
            utils.ShowMessage2(this, "crearTransportista", "warn_NombreVacio"); return;
        }
        if (string.IsNullOrEmpty(txt_editRol.Text))
        {
            utils.ShowMessage2(this, "crearTransportista", "warn_RolVacio"); return;
        }

        TransportistaBC transportista = llenarTransportista();
        int             id;

        if (transportista.Crear(out id))
        {
            utils.ShowMessage2(this, "crearTransportista", "success");
        }
        else
        {
            utils.ShowMessage2(this, "crearTransportista", "error");
        }
        TransportistaBC tran = new TransportistaBC();

        utils.CargaDrop(this.ddl_transportista, "ID", "NOMBRE", tran.ObtenerTodos());
        ddl_transportista.SelectedValue = id.ToString();
        utils.CerrarModal(this, "modalTransportista");
    }
Example #2
0
    protected void btn_editGrabar_Click(object sender, EventArgs e)
    {
        CaractCargaBC caca = new CaractCargaBC();

        caca.DESCRIPCION = txt_editDesc.Text;
        caca.VALOR       = int.Parse(txt_editValor.Text);
        caca.CACT_ID     = int.Parse(ddl_editTipo.SelectedValue);
        caca.CODIGO      = txt_editCodigo.Text;
        if (hf_idCaractCarga.Value == "")
        {
            if (caca.Crear(caca))
            {
                utils.ShowMessage2(this, "crear", "success");
                utils.CerrarModal(this, "modalEdit");
            }
            else
            {
                utils.ShowMessage2(this, "crear", "error");
            }
        }
        else
        {
            caca.ID = int.Parse(hf_idCaractCarga.Value);
            if (caca.Modificar(caca))
            {
                utils.ShowMessage2(this, "modificar", "success");
                utils.CerrarModal(this, "modalEdit");
            }
            else
            {
                utils.ShowMessage2(this, "modificar", "error");
            }
        }
        ObtenerCaractCarga(true);
    }
Example #3
0
 protected void btn_editGuardar_Click(object sender, EventArgs e)
 {
     try
     {
         OrigenBC o = new OrigenBC()
         {
             ID_PE        = txt_editIdPe.Text,
             NOMBRE_PE    = txt_editNombre.Text,
             DIRECCION_PE = txt_editDireccion.Text,
             LAT_PE       = Convert.ToDecimal(txt_editLat.Text.Replace(".", ",")),
             LON_PE       = Convert.ToDecimal(txt_editLon.Text.Replace(".", ",")),
             RADIO_PE     = Convert.ToInt32(txt_editRadio.Text),
             IS_POLIGONO  = chk_editPoligono.Checked,
         };
         o.COMUNA.CIUDAD.REGION.REGI_ID = Convert.ToInt32(ddl_editRegion.SelectedValue);
         o.COMUNA.CIUDAD.CIUD_ID        = Convert.ToInt32(ddl_editCiudad.SelectedValue);
         o.COMUNA.COMU_ID    = Convert.ToInt32(ddl_editComu.SelectedValue);
         o.OPERACION.OPER_ID = Convert.ToInt32(ddl_editOpe.SelectedValue);
         o.ICONO.ICON_ID     = Convert.ToInt32(rb_editIconos.SelectedValue);
         if (string.IsNullOrEmpty(hf_idOrigen.Value))
         {
             if (o.Guardar())
             {
                 utils.ShowMessage2(this, "guardar", "success_nuevo");
                 utils.CerrarModal(this, "modalEdit");
             }
             else
             {
                 utils.ShowMessage2(this, "guardar", "error");
             }
         }
         else
         {
             o.ID = Convert.ToInt32(hf_idOrigen.Value);
             if (o.Guardar())
             {
                 utils.ShowMessage2(this, "guardar", "success_modificar");
                 utils.CerrarModal(this, "modalEdit");
             }
             else
             {
                 utils.ShowMessage2(this, "guardar", "error");
             }
         }
     }
     catch (Exception ex)
     {
         utils.ShowMessage(this, ex.Message, "error", false);
     }
     finally
     {
         ObtenerOrigenes(true);
     }
 }
Example #4
0
 protected void btn_editGuardar_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(txt_editPlaca.Text))
     {
         utils.ShowMessage2(this, "modificar", "warn_placaVacia"); return;
     }
     if (ddl_editTipo.SelectedIndex < 1)
     {
         utils.ShowMessage2(this, "modificar", "warn_tipoVacio"); return;
     }
     try
     {
         TrailerBC trailer = new TrailerBC();
         trailer.TRAI_PLACA  = txt_editPlaca.Text;
         trailer.TRAI_NUMERO = txt_editNumero.Text;
         if (ddl_editTipo.SelectedIndex > 0)
         {
             trailer.TRAILER_TIPO.TRTI_ID = Convert.ToInt32(ddl_editTipo.SelectedValue);
         }
         trailer.TRAI_COD = txt_editPlaca.Text;
         if (hf_idTrailer.Value == "")
         {
             if (trailer.Guardar())
             {
                 utils.ShowMessage2(this, "guardar", "success_nuevo");
                 utils.CerrarModal(this, "modalEdit");
             }
             else
             {
                 utils.ShowMessage2(this, "guardar", "error_nuevo");
             }
         }
         else
         {
             trailer.TRAI_ID = Convert.ToInt32(hf_idTrailer.Value);
             if (trailer.Guardar())
             {
                 utils.ShowMessage2(this, "guardar", "success_modificar");
             }
             else
             {
                 utils.ShowMessage2(this, "guardar", "error_modificar");
             }
         }
     }
     catch (Exception ex)
     {
         utils.ShowMessage(this, ex.Message, "error", false);
     }
     finally
     {
         ObtenerTrailer(true);
     }
 }
Example #5
0
    protected void btn_Conf_Click(object sender, EventArgs e)
    {
        if (hf_confirmar.Value == "ELIM")
        {
            ConductorBC c = new ConductorBC();
            c.ID = Convert.ToInt32(hf_id.Value);
            if (c.Eliminar())
            {
                utils.ShowMessage2(this, "eliminar", "success");
                utils.CerrarModal(this, "modalConf");
            }
            else
            {
                utils.ShowMessage2(this, "eliminar", "error");
            }
            ObtenerConductores(true);
        }
        if (hf_confirmar.Value == "BLOQUEAR")
        {
            ConductorBC c = new ConductorBC();
            c.ID             = Convert.ToInt32(hf_id.Value);
            c.MOTIVO_BLOQUEO = txt_confirmarMotivo.Text;

            if (c.Bloquear(((UsuarioBC)this.Session["Usuario"]).ID))
            {
                utils.ShowMessage2(this, "bloquear", "success");
                utils.CerrarModal(this, "modalConf");
            }
            else
            {
                utils.ShowMessage2(this, "bloquear", "error");
            }
            ObtenerConductores(true);
        }
        if (hf_confirmar.Value == "ACTIVAR")
        {
            ConductorBC c = new ConductorBC();
            c.ID = Convert.ToInt32(hf_id.Value);
            if (c.Activar())
            {
                utils.ShowMessage2(this, "activar", "success");
                utils.CerrarModal(this, "modalConf");
            }
            else
            {
                utils.ShowMessage2(this, "activar", "error");
            }
            ObtenerConductores(true);
        }
    }
Example #6
0
    protected void btn_Eliminar_Click(object sender, EventArgs e)
    {
        ProveedorBC prov = new ProveedorBC();

        if (prov.Eliminar(Convert.ToInt32(hf_id.Value)))
        {
            utils.ShowMessage2(this, "eliminar", "success");
            utils.CerrarModal(this, "modalConfirmar");
        }
        else
        {
            utils.ShowMessage2(this, "eliminar", "error");
        }
        ObtenerProveedor(true);
    }
Example #7
0
    protected void btn_Conf_Click(object sender, EventArgs e)
    {
        ServiciosExternosConductorBC c = new ServiciosExternosConductorBC();

        c.ID = Convert.ToInt32(this.hf_id.Value);
        if (c.Eliminar())
        {
            utils.ShowMessage2(this, "eliminar", "success");
        }
        else
        {
            utils.ShowMessage2(this, "eliminar", "error");
        }
        this.ObtenerConductores(true);
        utils.CerrarModal(this, "modalConf");
    }
Example #8
0
    protected void btn_asignarLugares_Click(object sender, EventArgs e)
    {
        //pnl_site.FindControl("")
        int       id_usuario = Convert.ToInt32(hf_idUsuario.Value);
        UsuarioBC u          = new UsuarioBC();

        if (u.AsignarLugar(id_usuario, hf_idLugares.Value))
        {
            utils.ShowMessage(this, "Lugares asignados correctamente.", "success", true);
            utils.CerrarModal(this, "modalAsignar");
        }
        else
        {
            utils.ShowMessage(this, "OcurriĆ³ un error. Revise los datos", "success", true);
        }
        ObtenerUsuarios(true);
    }
Example #9
0
 protected void btn_editGuardar_Click(object sender, EventArgs e)
 {
     try
     {
         ConductorBC u = new ConductorBC()
         {
             COND_RUT        = txt_editRut.Text,
             COND_NOMBRE     = txt_editNombre.Text,
             COND_TELEFONO   = txt_editTelefono.Text,
             COND_EXTRANJERO = chk_editExtranjero.Checked
         };
         if (string.IsNullOrEmpty(hf_id.Value))
         {
             if (u.Guardar())
             {
                 utils.ShowMessage2(this, "guardar", "success_nuevo");
                 utils.CerrarModal(this, "modalEdit");
             }
             else
             {
                 utils.ShowMessage2(this, "guardar", "error");
             }
         }
         else
         {
             u.COND_ID = Convert.ToInt32(hf_id.Value);
             if (u.Guardar())
             {
                 utils.ShowMessage2(this, "guardar", "success_modificar");
                 utils.CerrarModal(this, "modalEdit");
             }
             else
             {
                 utils.ShowMessage2(this, "guardar", "error");
             }
         }
     }
     catch (Exception ex)
     {
         utils.ShowMessage(this, ex.Message, "error", false);
     }
     finally
     {
         ObtenerConductores(true);
     }
 }
Example #10
0
 protected void btn_editGuardar_Click(object sender, EventArgs e)
 {
     try
     {
         ParametroBC p = new ParametroBC();
         p.PARA_NOMBRE          = txt_editNombre.Text;
         p.PARA_OBS             = txt_editObs.Text;
         p.PARA_VALOR           = txt_editValor.Text;
         p.USUA_ID_CREACION     = user.USUA_ID;
         p.USUA_ID_MODIFICACION = user.USUA_ID;
         if (string.IsNullOrEmpty(hf_id.Value))
         {
             if (p.Guardar())
             {
                 utils.ShowMessage2(this, "guardar", "success_nuevo");
                 utils.CerrarModal(this, "modalEdit");
             }
             else
             {
                 utils.ShowMessage2(this, "guardar", "error");
             }
         }
         else
         {
             p.PARA_ID = Convert.ToInt32(hf_id.Value);
             if (p.Guardar())
             {
                 utils.ShowMessage2(this, "guardar", "success_modificar");
             }
             else
             {
                 utils.ShowMessage2(this, "guardar", "error");
             }
         }
     }
     catch (Exception ex)
     {
         utils.ShowMessage(this, ex.Message, "error", false);
     }
     finally
     {
         ObtenerParametros(true);
     }
 }
Example #11
0
 protected void btn_editGuardar_Click(object sender, EventArgs e)
 {
     try
     {
         UsuarioTipoBC ut = new UsuarioTipoBC();
         ut.USTI_NOMBRE         = txt_editNombre.Text;
         ut.USTI_DESC           = txt_editDescripcion.Text;
         ut.USTI_NIVEL_PERMISOS = Convert.ToInt32(txt_editPermisos.Text);
         ut.MENU_ID             = hf_menuId.Value;
         if (string.IsNullOrEmpty(hf_id.Value))
         {
             if (ut.Guardar())
             {
                 utils.ShowMessage2(this, "guardar", "success_nuevo");
                 utils.CerrarModal(this, "modalEdit");
             }
             else
             {
                 utils.ShowMessage2(this, "guardar", "error");
             }
         }
         else
         {
             ut.USTI_ID = Convert.ToInt32(hf_id.Value);
             if (ut.Guardar())
             {
                 utils.ShowMessage2(this, "guardar", "success_modificar");
             }
             else
             {
                 utils.ShowMessage2(this, "guardar", "error");
             }
         }
     }
     catch (Exception ex)
     {
         utils.ShowMessage(this, ex.Message, "error", false);
     }
     finally
     {
         ObtenerPerfiles(true);
     }
 }
Example #12
0
    protected void btn_editGuardar_Click(object sender, EventArgs e)
    {
        try
        {
            TrailerTipoBC tt = new TrailerTipoBC();
            tt.TRTI_DESC  = txt_editDesc.Text;
            tt.TRTI_COLOR = txt_editColor.Text;

            if (hf_id.Value == "")
            {
                if (tt.Guardar())
                {
                    utils.ShowMessage2(this, "guardar", "success_nuevo");
                    utils.CerrarModal(this, "modalEdit");
                }
                else
                {
                    utils.ShowMessage2(this, "guardar", "error_nuevo");
                }
            }
            else
            {
                tt.TRTI_ID = Convert.ToInt32(hf_id.Value);
                if (tt.Guardar())
                {
                    utils.ShowMessage2(this, "guardar", "success_modificar");
                }
                else
                {
                    utils.ShowMessage2(this, "guardar", "error_modificar");
                }
            }
        }
        catch (Exception ex)
        {
            utils.ShowMessage(this, ex.Message, "error", false);
        }
        finally
        {
            ObtenerTipoTrailer(true);
        }
    }
Example #13
0
    protected void btn_confEnviar_Click(object sender, EventArgs e)
    {
        PreRutaBC gd = new PreRutaBC();

        try
        {
            DataTable excel = gd.CrearEnvio(hseleccionado.Value.ToString(), user.USUA_ID, chk_archivar.Checked);
            ViewState["lista"] = excel;
            utils.CerrarModal(this.Page, "modalenviar");
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "exp", "exportar();", true);
        }
        catch (Exception ex)
        {
            utils.ShowMessage(this, ex.Message, "error", false);
        }
        finally
        {
            ObtenerRutas(true);
        }
    }
Example #14
0
    protected void btn_editGrabar_Click(object sender, EventArgs e)
    {
        CaractTipoCargaBC cct = new CaractTipoCargaBC();

        cct.DESCRIPCION = txt_editDesc.Text;
        if (chk_editExcluyente.Checked)
        {
            cct.EXCLUYENTE = true;
        }
        else
        {
            cct.EXCLUYENTE = false;
        }
        cct.ID = Convert.ToInt32(txt_editId.Text);
        if (hf_idCaractTipoCarga.Value == "")
        {
            if (cct.Crear())
            {
                utils.ShowMessage2(this, "crear", "success");
                utils.CerrarModal(this, "modalEdit");
            }
            else
            {
                utils.ShowMessage2(this, "crear", "error");
            }
        }
        else
        {
            cct.ID = Convert.ToInt32(hf_idCaractTipoCarga.Value);
            if (cct.Modificar())
            {
                utils.ShowMessage2(this, "modificar", "success");
                utils.CerrarModal(this, "modalEdit");
            }
            else
            {
                utils.ShowMessage2(this, "modificar", "error");
            }
        }
        ObtenerCaractTipoCarga(true);
    }
Example #15
0
 protected void btn_editGuardar_Click(object sender, EventArgs e)
 {
     try
     {
         TractoBC t = new TractoBC();
         t.TRAC_PLACA = txt_editPatente.Text;
         if (hf_id.Value == "")
         {
             if (t.Guardar())
             {
                 utils.ShowMessage2(this, "guardar", "success_nuevo");
                 utils.CerrarModal(this, "modalEdit");
             }
             else
             {
                 utils.ShowMessage2(this, "guardar", "error_nuevo");
             }
         }
         else
         {
             t.TRAC_ID = Convert.ToInt32(hf_id.Value);
             if (t.Guardar())
             {
                 utils.ShowMessage2(this, "guardar", "success_modificar");
                 utils.CerrarModal(this, "modalEdit");
             }
             else
             {
                 utils.ShowMessage2(this, "guardar", "error_modificar");
             }
         }
     }
     catch (Exception ex)
     {
         utils.ShowMessage(this, ex.Message, "error", false);
     }
     finally
     {
         ObtenerTracto(true);
     }
 }
Example #16
0
    protected void btn_editGrabar_Click(object sender, EventArgs e)
    {
        TrailerBC t = new TrailerBC();

        t.PLACA   = this.txt_editPlaca.Text;
        t.TRAN_ID = Convert.ToInt32(this.ddl_editTran.SelectedValue);
        if (t.CrearGenerico(t, false))
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('Trailer agregado correctamente.');", true);
            this.hf_idTrailer.Value              = t.ID.ToString();
            this.txt_buscarPatente.Text          = t.PLACA;
            this.ddl_transportista.SelectedValue = t.TRAN_ID.ToString();
            utils.CerrarModal(this, "modalTrailer");
        }
    }
Example #17
0
 protected void btn_confEliminarRuta_Click(object sender, EventArgs e)
 {
     try
     {
         PreRutaBC p = new PreRutaBC();
         p.ID = Convert.ToInt64(hf_idRuta.Value);
         p.Eliminar();
         utils.ShowMessage2(this, "eliminar", "success");
         utils.CerrarModal(this, "modalConf");
         ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "elimina2", "eliminarRuta2();", true);
     }
     catch (Exception ex)
     {
         utils.ShowMessage(this, ex.Message, "error", false);
     }
 }
Example #18
0
    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);
    }
Example #19
0
    protected void btn_editGrabar_Click(object sender, EventArgs e)
    {
        if (string.IsNullOrEmpty(txt_editPlaca.Text))
        {
            utils.ShowMessage2(this, "modificar", "warn_placaVacia"); return;
        }
        if (string.IsNullOrEmpty(txt_editNumero.Text) && !chk_editExterno.Checked)
        {
            utils.ShowMessage2(this, "modificar", "warn_numeroVacio"); return;
        }
        if (ddl_editTran.SelectedIndex < 1)
        {
            utils.ShowMessage2(this, "modificar", "warn_transportistaVacio"); return;
        }
        if (ddl_editTipo.SelectedIndex < 1)
        {
            utils.ShowMessage2(this, "modificar", "warn_tipoVacio"); return;
        }
        TrailerBC trailer = new TrailerBC();

        trailer.PLACA = this.txt_editPlaca.Text;
        if (!this.chk_editExterno.Checked)
        {
            trailer.NUMERO = this.txt_editNumero.Text;
        }
        if (ddl_editTran.SelectedIndex > 0)
        {
            trailer.TRAN_ID = Convert.ToInt32(ddl_editTran.SelectedValue);
        }
        if (ddl_editTipo.SelectedIndex > 0)
        {
            trailer.TRTI_ID = Convert.ToInt32(ddl_editTipo.SelectedValue);
        }
        trailer.CODIGO         = this.txt_editPlaca.Text;
        trailer.EXTERNO        = this.chk_editExterno.Checked;
        trailer.NO_EXCLUYENTES = this.hf_noexcluyentes.Value;
        trailer.EXCLUYENTES    = this.hf_excluyentes.Value;
        trailer.ID_SHORTEK     = this.ddl_editShorteck.SelectedValue;
        trailer.REQ_SELLO      = this.chk_editSello.Checked;
        if (this.hf_idTrailer.Value == "")
        {
            if (trailer.Crear())
            {
                utils.ShowMessage2(this, "crear", "success");
                utils.CerrarModal(this, "modalEdit");
            }
            else
            {
                utils.ShowMessage2(this, "crear", "error");
            }
        }
        else
        {
            trailer.ID = Convert.ToInt32(this.hf_idTrailer.Value);
            if (trailer.Modificar())
            {
                utils.ShowMessage2(this, "modificar", "success");
                utils.CerrarModal(this, "modalEdit");
            }
            else
            {
                utils.ShowMessage2(this, "modificar", "error");
            }
        }
        this.ObtenerTrailer(true);
    }
Example #20
0
 protected void btn_editGuardar_Click(object sender, EventArgs e)
 {
     try
     {
         UsuarioBC u = new UsuarioBC()
         {
             USUA_RUT         = txt_editRut.Text,
             USUA_NOMBRE      = txt_editNombre.Text,
             USUA_APELLIDO    = txt_editApellido.Text,
             USUA_USERNAME    = txt_editUsername.Text,
             USUA_PASSWORD    = txt_editPassword.Text,
             USUA_OBSERVACION = txt_editObservacion.Text,
             USUA_CORREO      = txt_editCorreo.Text,
             OPER_ID          = ""
         };
         u.USUARIO_TIPO.USTI_ID = Convert.ToInt32(ddl_editTipo.Text);
         foreach (ListItem i in chklst_editOp.Items)
         {
             if (i.Selected)
             {
                 if (!string.IsNullOrEmpty(u.OPER_ID))
                 {
                     u.OPER_ID += ",";
                 }
                 u.OPER_ID += i.Value;
             }
         }
         if (string.IsNullOrEmpty(hf_id.Value))
         {
             if (u.Guardar())
             {
                 utils.ShowMessage2(this, "guardar", "success_nuevo");
                 utils.CerrarModal(this, "modalEdit");
             }
             else
             {
                 utils.ShowMessage2(this, "guardar", "error");
             }
         }
         else
         {
             u.USUA_ID = Convert.ToInt32(hf_id.Value);
             if (u.Guardar())
             {
                 utils.ShowMessage2(this, "guardar", "success_modificar");
             }
             else
             {
                 utils.ShowMessage2(this, "guardar", "error");
             }
         }
     }
     catch (Exception ex)
     {
         utils.ShowMessage(this, ex.Message, "error", false);
     }
     finally
     {
         ObtenerUsuarios(true);
     }
 }
Example #21
0
 protected void btncorreo_Click(object sender, EventArgs e)
 {
     utils.ShowMessage(this, "Cedible enviada.", "success", true);
     utils.CerrarModal(this, "modalFOTO");
 }