Commit inicial Ventas Productivo
This commit is contained in:
80
Ventas/RepComisionesJAM2Detalle.aspx.cs
Normal file
80
Ventas/RepComisionesJAM2Detalle.aspx.cs
Normal file
@@ -0,0 +1,80 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Data;
|
||||
using Extensiones;
|
||||
using Microsoft.Reporting.WebForms;
|
||||
|
||||
public partial class Ventas_RepComisionesJAM2Detalle : ClsPaginas
|
||||
{
|
||||
#region PROPIEDADES
|
||||
|
||||
|
||||
#endregion
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
InicializaValores();
|
||||
}
|
||||
}
|
||||
|
||||
private void InicializaValores()
|
||||
{
|
||||
txtFechaI.Text = DateTime.Now.FirstDayOfMonth().ToShortDateString();
|
||||
txtFechaF.Text = DateTime.Now.LastDayOfMonth().ToShortDateString();
|
||||
|
||||
DdlVendedor.DataSource = get_GlobalDTVendedores(UsuarioActual.CveEmpresa);
|
||||
DdlVendedor.DataBind();
|
||||
|
||||
DdlSubProyecto.DataSource = get_GlobalDTSubProyectos(-1, CveEmpresa: UsuarioActual.CveEmpresa);
|
||||
DdlSubProyecto.DataBind();
|
||||
|
||||
DdlVendedor.SelectedValueExist(Request["CveVendedor"] == null ? "-1" : Request["CveVendedor"].ToString());
|
||||
DdlSubProyecto.SelectedValueExist(Request["CveSubProyecto"] == null ? "-1" : Request["CveSubProyecto"].ToString());
|
||||
|
||||
txtFechaI.Text = Request["FechaI"] == null ? DateTime.Now.FirstDayOfMonth().ToShortDateString() : Request["FechaI"].ToString();
|
||||
txtFechaF.Text = Request["FechaF"] == null ? DateTime.Now.LastDayOfMonth().ToShortDateString() : Request["FechaF"].ToString();
|
||||
|
||||
CargaDatos();
|
||||
}
|
||||
|
||||
private void CargaDatos()
|
||||
{
|
||||
ClsEsquemasComisiones ObjComisiones = new ClsEsquemasComisiones();
|
||||
|
||||
DateTime FechaI, FechaF;
|
||||
if (txtFechaI.Text != "") { FechaI = txtFechaI.Text.ToDate(); } else { FechaI = DateTime.MinValue; }
|
||||
if (txtFechaF.Text != "") { FechaF = txtFechaF.Text.ToDate(); } else { FechaF = DateTime.MaxValue; }
|
||||
|
||||
if (ObjComisiones.GetRepComisiones2Detalle(DdlVendedor.SelectedValue.ToEntero(), FechaI, FechaF, DdlSubProyecto.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa))
|
||||
{
|
||||
GvDatos.DataSource = ObjComisiones.DtResultados;
|
||||
}
|
||||
ObjComisiones.Dispose();
|
||||
GvDatos.DataBind();
|
||||
UpDatos.Update();
|
||||
}
|
||||
|
||||
|
||||
protected void GvDatos_RowDataBound(object sender, GridViewRowEventArgs e)
|
||||
{
|
||||
if (e.Row.RowType == DataControlRowType.DataRow)
|
||||
{
|
||||
if (e.Row.DBCampo("CveVendedor").ToEntero() < 1)
|
||||
{
|
||||
e.Row.Cells[0].Text = "Total";
|
||||
e.Row.CssClass = "Totales";
|
||||
}else if(e.Row.DBCampo("CveVenta").ToEntero() < 1)
|
||||
{
|
||||
e.Row.Cells[0].Text = e.Row.DBCampo("Vendedor").ToString();
|
||||
e.Row.CssClass = "SubTotales";
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Row.Cells[8].Text = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user