protected void Page_Load(object sender, EventArgs e) { dtSource = new DataTable(); products = new ProductsDataHandler(); dtSource.Columns.Add("SKU", typeof(string)); dtSource.Columns.Add("Nombre", typeof(string)); dtSource.Columns.Add("Precio", typeof(decimal)); dtSource.Columns.Add("Cantidad", typeof(int)); dtSource.Columns.Add("Monto", typeof(decimal)); dgDetalle.DataSource = dtSource; dgDetalle.DataBind(); sales = new SalesDataHandler(); clients = new ClientsDataHandler(); if (Session["Venta"] == null) { Session["Venta"] = new Sale(); } venta = (Sale)Session["Venta"]; //venta.cliente = int.Parse(ddClientes.SelectedValue); venta.fecha = DateTime.Now; venta.productos = 0; venta.montoTotal = 0; ddClientes.Items.Clear(); foreach (DataRow cliente in clients.FetchClients().Rows) { ddClientes.Items.Add(new ListItem(cliente["Nombre"].ToString() + " " + cliente["APaterno"].ToString() + " " + cliente["AMaterno"].ToString(), cliente["ID"].ToString())); } }
protected void Page_Load(object sender, EventArgs e) { products = new ProductsDataHandler(); stocks = new InventoryDataHandler(); ddProductos.Items.Clear(); foreach (DataRow producto in products.FetchProducts().Rows) { ddProductos.Items.Add(new ListItem(producto["Nombre"].ToString(), producto["SKU"].ToString())); } }
protected void Page_Load(object sender, EventArgs e) { da = new ProductsDataHandler(); cat = new CategoriesDataHandler(); List <Categoria> list = cat.GetCategoryList(); foreach (Categoria c in list) { ddCategorias.Items.Add(new ListItem(c.Nombre, c.ID)); } }