protected void Page_Load(object sender, EventArgs e) { GestionarUsuario GestUser = new GestionarUsuario(); if (GestUser.ValidateSesion()) { btnComprar.Enabled = true; GestionarVehiculos GestVehiculos = new GestionarVehiculos(); this.LstVehiculos = GestVehiculos.ConsultarVehiculos(); if (ListaVehiculos.Items.Count == 0) { if (ListaVehiculos != null) { //Inicial ListaVehiculos.Items.Add(new ListItem("Seleccione vehículo", "0")); foreach (Vehiculo Vehicle in LstVehiculos) { ListItem oItem = new ListItem(Vehicle.Marca + " - " + Vehicle.Modelo, Convert.ToString(Vehicle.Id)); //Objeto droplist ListaVehiculos.Items.Add(oItem); } } } } else { btnComprar.Enabled = false; LblResultado.Text = "Sesión invalida, pruebe saliendo e ingresando de nuevo."; } }
protected void Page_Load(object sender, EventArgs e) { GestionarUsuario GestUser = new GestionarUsuario(); if (GestUser.ValidateSesion()) { GestionarVehiculos GestVehiculos = new GestionarVehiculos(); var LstVehiculos = from ListVehicles in GestVehiculos.ConsultarVehiculos() orderby ListVehicles.Cantidad ascending select ListVehicles; GridViewPedidos.DataSource = LstVehiculos.ToList(); /*DataGridViewButtonColumn colBotones = new DataGridViewButtonColumn(); * colBotones.Name = "colBotones"; * colBotones.HeaderText = "Valor Stock";*/ GridViewPedidos.DataBind(); } else { LblResultado.Text = "Sesión invalida, pruebe saliendo e ingresando de nuevo."; } }
protected void Page_Load(object sender, EventArgs e) { GestionarUsuario GestUser = new GestionarUsuario(); LblResultado.Text = ""; txtIdcompra.Enabled = false; BtnFacturar.Enabled = false; if (GestUser.ValidateSesion()) { /*GestionarVentas GestVentas = new GestionarVentas(); * List<Models.SP_ConsultarEstadisticasVentas_Result> LstEstadisticas = GestVentas.ConsultarEstadisticas(); * GridViewCompras.DataSource = LstEstadisticas; * GridViewCompras.DataBind();*/ GestionarCompra GestCompra = new GestionarCompra(); List <Models.SP_ConsultarCompras_Result> LstCompras = GestCompra.ConsultarCompras(); GridViewCompras.DataSource = LstCompras; GridViewCompras.DataBind(); txtIdcompra.Enabled = true; BtnFacturar.Enabled = true; } else { LblResultado.Text = "Sesión invalida, pruebe saliendo e ingresando de nuevo."; } }
protected void Page_Load(object sender, EventArgs e) { GestionarUsuario GestUser = new GestionarUsuario(); LblResultado.Text = ""; LblTotalVentas.Text = "0"; LblVehiculosVendidos.Text = "0"; if (GestUser.ValidateSesion()) { GestionarVentas GestVentas = new GestionarVentas(); List <Models.SP_ConsultarEstadisticasVentas_Result> LstEstadisticas = GestVentas.ConsultarEstadisticas(); GridViewEstadisticas.DataSource = LstEstadisticas; GridViewEstadisticas.DataBind(); decimal VentasTotales = 0; int VehiculosVendidos = 0; foreach (SP_ConsultarEstadisticasVentas_Result Estadistica in LstEstadisticas) { VentasTotales += Convert.ToDecimal(Estadistica.Total_Ventas); VehiculosVendidos += Convert.ToInt32(Estadistica.Cantidad); } LblTotalVentas.Text = Convert.ToString(VentasTotales); LblVehiculosVendidos.Text = Convert.ToString(VehiculosVendidos); } else { LblResultado.Text = "Sesión invalida, pruebe saliendo e ingresando de nuevo."; } }