コード例 #1
0
ファイル: Realizar.aspx.cs プロジェクト: danflr/P7-Tienda
 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()));
     }
 }
コード例 #2
0
 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()));
     }
 }
コード例 #3
0
ファイル: Agregar.aspx.cs プロジェクト: danflr/P7-Tienda
        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));
            }
        }