예제 #1
0
    protected void btn_editGrabar_Click(object sender, EventArgs e)
    {
        ServiciosExternosBC s = new ServiciosExternosBC();

        s.CODIGO = this.txt_editCodigo.Text;
        if (string.IsNullOrEmpty(this.hf_id.Value))
        {
            if (s.Crear())
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "msj", "showAlert('Servicio externo agregado correctamente');", true);
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "cerrar", "cerrarModal('modalEditar');", true);
            }
            else
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('Error');", true);
            }
        }
        else
        {
            s.SEEX_ID = Convert.ToInt32(this.hf_id.Value);
            if (s.Modificar())
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "msj", "showAlert('Servicio externo modificado correctamente');", true);
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "cerrar", "cerrarModal('modalEditar');", true);
            }
            else
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('Error');", true);
            }
        }
        this.ObtenerServicios(true);
    }
예제 #2
0
    private void ObtenerServiciosExternos(bool forzarBD)
    {
        if (this.ViewState["lista"] == null || forzarBD)
        {
            ServiciosExternosBC tracto = new ServiciosExternosBC();
            int      site_id           = Convert.ToInt32(this.ddl_site.SelectedValue);
            DateTime desde             = Convert.ToDateTime(this.txt_desde.Text);
            DateTime hasta             = Convert.ToDateTime(this.txt_hasta.Text);

            DataTable dt = tracto.obtener_Reporte_XParametro(this.txt_buscarNombre.Text, this.chk_buscarInternos.SelectedValue, int.Parse(this.ddl_buscarTransportista.SelectedValue), site_id, desde, hasta);
            this.ViewState["lista"] = dt;
        }
        DataView dw = new DataView((DataTable)this.ViewState["lista"]);

        if (this.ViewState["sortExpresion"] != null)
        {
            String sortExp = (String)this.ViewState["sortExpresion"];
            if (sortExp != "")
            {
                dw.Sort = (String)this.ViewState["sortExpresion"];
            }
        }
        this.gv_listar.DataSource = dw;
        this.gv_listar.DataBind();
    }
예제 #3
0
    protected void btn_Eliminar_Click(object sender, EventArgs e)
    {
        ServiciosExternosBC s = new ServiciosExternosBC();

        if (s.Eliminar(int.Parse(this.hf_id.Value)))
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "showAlert('Servicio externo eliminado exitosamente');", true);
        }
        else
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('Error');", true);
        }
        ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "cerrar", "cerrarModal('modalConfirmar');", true);
        this.ObtenerServicios(true);
    }
예제 #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (this.Session["usuario"] == null)
        {
            this.Response.Redirect("~/InicioQYMS.aspx");
        }

        this.usuario = (UsuarioBC)this.Session["usuario"];
        if (!this.IsPostBack)
        {
            this.drop.Site_Normal(this.ddl_site, this.usuario.ID);
            this.drop.Proveedor(this.ddl_prov);
            ServiciosExternosBC se = new ServiciosExternosBC();
            utils.CargaDrop(this.ddl_servExt, "SEEX_ID", "CODIGO", se.ObtenerTodos());
            this.Limpiar();
        }
    }
예제 #5
0
    private void ObtenerServicios(bool forzarBD)
    {
        if (this.ViewState["listar"] == null || forzarBD)
        {
            ServiciosExternosBC s = new ServiciosExternosBC();
            string    codigo      = txt_buscarCodigo.Text;
            DataTable dt          = s.ObtenerXParametros(codigo);
            this.ViewState["listar"] = dt;
        }
        DataView dw = new DataView((DataTable)this.ViewState["listar"]);

        if (this.ViewState["sortExpresion"] != null && this.ViewState["sortExpresion"].ToString() != "")
        {
            dw.Sort = (String)this.ViewState["sortExpresion"];
        }
        this.gv_listar.DataSource = dw.ToTable();
        this.gv_listar.DataBind();
    }
예제 #6
0
    protected void btn_buscar_Click(object sender, EventArgs e)
    {
        ServiciosExternosVehiculosBC sev = new ServiciosExternosVehiculosBC();
        ServiciosExternosBC          se  = new ServiciosExternosBC();
        bool existe;

        sev           = sev.ObtenerXPlaca(txt_placa.Text, out existe);
        sev.CONDUCTOR = sev.CONDUCTOR.ObtenerXId(sev.SEEX_ID);
        if (!existe)
        {
            if (new TrailerBC().obtenerXPlaca(txt_placa.Text).ID > 0)
            {
                txt_placa.Text = "";
                utils.ShowMessage2(this, "buscar", "warn_trailer");
                return;
            }
            utils.ShowMessage2(this, "buscar", "warn_vehiculoNoExiste");
            Limpiar();
            return;
        }
        if (sev.SITE_ID != Convert.ToInt32(ddl_site.SelectedValue))
        {
            utils.ShowMessage2(this, "buscar", "warn_vehiculoOtroSite");
            Limpiar();
            return;
        }
        if (!sev.SITE_IN)
        {
            utils.ShowMessage2(this, "buscar", "warn_vehiculoFueraSite");
            Limpiar();
            return;
        }
        ProveedorBC p = new ProveedorBC();

        p                        = p.ObtenerXId(sev.PROV_ID);
        hf_id.Value              = sev.SEVE_ID.ToString();
        lbl_proveedor.Text       = p.DESCRIPCION;
        lbl_placa.Text           = sev.PLACA;
        txt_conductorRut.Text    = sev.COSE_RUT;
        txt_conductorNombre.Text = sev.COSE_NOMBRE;
        lbl_servExt.Text         = se.CODIGO;
        dv_contenido.Attributes.Add("style", "display:block");
        utils.ShowMessage2(this, "buscar", "success");
    }
예제 #7
0
 protected void gv_listar_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "EDITAR")
     {
         ServiciosExternosBC s = new ServiciosExternosBC();
         this.hf_id.Value = e.CommandArgument.ToString();
         s.SEEX_ID        = Convert.ToInt32(this.hf_id.Value);
         s = s.ObtenerXId();
         this.txt_editCodigo.Text = s.CODIGO;
         ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "modalEditar();", true);
     }
     else if (e.CommandName == "ELIMINAR")
     {
         this.hf_id.Value = e.CommandArgument.ToString();
         this.lbl_tituloConfirmar.Text = "Eliminar servicio externo";
         this.lbl_msjConfirmar.Text    = "Se eliminará el servicio externo seleccionado, ¿desea continuar?";
         ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "modalConfirmar();", true);
     }
 }
예제 #8
0
 public bool Modificar(ServiciosExternosBC s)
 {
     return(tran.ServiciosExternos_Modificar(s));
 }
예제 #9
0
 public bool Crear(ServiciosExternosBC s)
 {
     return(tran.ServiciosExternos_Crear(s));
 }