Exemplo n.º 1
0
    protected void GridViewFacturasDetail_CustomCallback(object sender, DevExpress.Web.ASPxGridViewCustomCallbackEventArgs e)
    {
        string SerieFactura = Convert.ToString(GridViewFacturas.GetSelectedFieldValues("SerieFactura").Select(c => c).FirstOrDefault());

        GridViewFacturasDetail.DataSource = FacturasRepository.GetFacturasDetail(SerieFactura);
        GridViewFacturasDetail.DataBind();
    }
Exemplo n.º 2
0
    protected void GridViewFacturas_SelectionChanged(object sender, EventArgs e)
    {
        string SerieFactura = Convert.ToString(GridViewFacturas.GetSelectedFieldValues("SerieFactura").Select(c => c).FirstOrDefault());

        GridViewFacturasDetail.DataSource = FacturasRepository.GetFacturasDetail(SerieFactura);
        GridViewFacturasDetail.DataBind();
    }
Exemplo n.º 3
0
    protected void GridViewFacturas_SelectionChanged(object sender, EventArgs e)
    {
        string SerieFactura = Convert.ToString(GridViewFacturas.GetSelectedFieldValues("SerieFactura").Select(c => c).FirstOrDefault());

        GridViewFacturasDetail.DataSource = FacturasRepository.GetFacturasDetail(SerieFactura);
        GridViewFacturasDetail.DataBind();
        ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "divShow('#gridfamilia')", true);
    }
Exemplo n.º 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["User"] != null)
        {
            TopMenu.Visible    = false; //Login
            LogingMenu.Visible = true;  //Logout
        }
        else
        {
            TopMenu.Visible    = true;  //Login
            LogingMenu.Visible = false; //Logout
            if (!HttpContext.Current.Request.Url.AbsoluteUri.Contains("login"))
            {
                if (Page.IsCallback)
                {
                    ASPxWebControl.RedirectOnCallback("/Account/login.aspx");
                }
                else
                {
                    Response.Redirect("/Account/login.aspx");
                }
            }
        }

        DateTime?defecha = null;
        DateTime?afecha  = null;

        if (!Page.IsPostBack)
        {
            Session["buttonclick"] = "date";
            defecha = Convert.ToDateTime(fechahoy.ToString("01/MMM/yyy"));
            afecha  = Convert.ToDateTime(DateTime.DaysInMonth(fechahoy.Year, fechahoy.Month) + "/" + fechahoy.Month + "/" + fechahoy.Year);
        }

        if ((dtfromDate.Date != null || dttoDate.Date != null) && Convert.ToString(Session["buttonclick"]) == "date")
        {
            defecha = dtfromDate.Date;
            afecha  = dttoDate.Date;
        }

        var Cliente = (Clientes)Session["User"];

        GridViewFacturas.DataSource = FacturasRepository.GetAllFacturas("", Cliente.AutoCliente, defecha, afecha);
        GridViewFacturas.DataBind();

        string SerieFactura = string.Empty;

        if (GridViewFacturas.GetSelectedFieldValues("SerieFactura").Count > 0)
        {
            SerieFactura = Convert.ToString(GridViewFacturas.GetSelectedFieldValues("SerieFactura").Select(c => c).FirstOrDefault());
        }
        else
        {
            SerieFactura = Convert.ToString(GridViewFacturas.GetRowValues(0, "SerieFactura"));
        }
        GridViewFacturasDetail.DataSource = FacturasRepository.GetFacturasDetail(SerieFactura);
        GridViewFacturasDetail.DataBind();
    }
Exemplo n.º 5
0
 protected void linkselect_Init(object sender, EventArgs e)
 {
     if (GridViewFacturasDetail.DataSource != null)
     {
         GridViewDataItemTemplateContainer c = ((ASPxHyperLink)sender).NamingContainer as GridViewDataItemTemplateContainer;
         int rowIndex = c.VisibleIndex;
         ((ASPxHyperLink)sender).ClientSideEvents.Click = "function(f,n){window.location.href='../mobile/Albaranes.aspx?albarane=" + GridViewFacturasDetail.GetRowValues(GridViewFacturasDetail.FocusedRowIndex, "SerieAlbaran") + "'}";
         GridViewFacturasDetail.FocusedRowIndex         = rowIndex;
     }
 }
Exemplo n.º 6
0
    protected void GridViewFacturasDetail_CustomUnboundColumnData(object sender, DevExpress.Web.ASPxGridViewColumnDataEventArgs e)
    {
        var Cliente = (Clientes)Session["User"];

        if (Cliente == null)
        {
            ASPxWebControl.RedirectOnCallback("/Account/login.aspx");
        }

        string CodigoCliente = Cliente.Código;
        int    AutoCliente   = Cliente.AutoCliente;
        int    AutoArticulo  = Convert.ToInt32(e.GetListSourceFieldValue("AutoArtículo"));
        string resp          = (string)CommonFunction.Calculoalbaran(Convert.ToString(GridViewFacturasDetail.GetRowValues(e.ListSourceRowIndex, "SerieAlbaran")), 5);

        if (e.Column.FieldName == "TotalNeto")
        {
            var val = CommonFunction.Field(resp, 1, "&");
            if (!string.IsNullOrEmpty(val))
            {
                e.Value = Convert.ToDouble(CommonFunction.Field(resp, 1, "&"));
            }
        }
        else if (e.Column.FieldName == "NetoIgic")
        {
            var val = CommonFunction.Field(resp, 2, "&");
            if (!string.IsNullOrEmpty(val))
            {
                e.Value = Convert.ToDouble(CommonFunction.Field(resp, 2, "&"));
            }
        }
    }
Exemplo n.º 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["User"] == null)
        {
            if (Page.IsCallback)
            {
                ASPxWebControl.RedirectOnCallback("/Account/login.aspx");
            }
            else
            {
                Response.Redirect("/Account/login.aspx");
            }
        }


        //       if (Request.Browser.IsMobileDevice)
        //       {
        //           if (Page.IsCallback)
        //           {
        //              ASPxWebControl.RedirectOnCallback("/mobile/Facturas.aspx");
        //          }
        //          else
        //          {
        //              Response.Redirect("/mobile/Facturas.aspx");
        //          }

        //      }
        DateTime?defecha = null;
        DateTime?afecha  = null;

        if (!Page.IsPostBack)
        {
            Session["buttonclick"] = "date";
            defecha = Convert.ToDateTime(fechahoy.ToString("01/MMM/yyy"));
            afecha  = Convert.ToDateTime(DateTime.DaysInMonth(fechahoy.Year, fechahoy.Month) + "/" + fechahoy.Month + "/" + fechahoy.Year);
        }

        if ((dtfromDate.Date != null || dttoDate.Date != null) && Convert.ToString(Session["buttonclick"]) == "date")
        {
            defecha = dtfromDate.Date;
            afecha  = dttoDate.Date;
        }

        var Cliente = (Clientes)Session["User"];

        GridViewFacturas.DataSource = FacturasRepository.GetAllFacturas("", Cliente.AutoCliente, defecha, afecha);
        GridViewFacturas.DataBind();

        string SerieFactura = string.Empty;

        if (GridViewFacturas.GetSelectedFieldValues("SerieFactura").Count > 0)
        {
            SerieFactura = Convert.ToString(GridViewFacturas.GetSelectedFieldValues("SerieFactura").Select(c => c).FirstOrDefault());
        }
        else
        {
            SerieFactura = Convert.ToString(GridViewFacturas.GetRowValues(0, "SerieFactura"));
        }
        GridViewFacturasDetail.DataSource = FacturasRepository.GetFacturasDetail(SerieFactura);
        GridViewFacturasDetail.DataBind();
    }