/// <summary> /// 绑定Shop信息的数据源 /// </summary> private void BindSourceShop(int start) { Shop shop = new Shop(); shop.Contrac_id = Convert.ToInt32(id); ContractShopProvider provider = new ContractShopProvider(); DataTable table = provider.Select(shop, start, this.ListPager2.PageSize); this.GridView2.DataSource = table.DefaultView; this.GridView2.DataBind(); }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { int rowIndex = Convert.ToInt32(e.CommandArgument); if (e.CommandName.Equals("info")) { Shop shop = new Shop(); shop.Shop_id = Convert.ToInt32(this.GridView1.DataKeys[rowIndex].Value); ContractShopProvider provider = new ContractShopProvider(); DataTable table = provider.Select(shop); Warehouse warehouse = new Warehouse(); warehouse.Warehouse_number = Convert.ToInt32(table.Rows[0]["shop_num"]); warehouse.Good_id = Convert.ToInt32(table.Rows[0]["good_id"]); warehouse.Warehouse_type = "出库"; warehouse.Warehouse_time = DateTime.Now.Date; warehouse.Warehouse_operators = Session["LOGINED"].ToString(); WarehouseProvider warehouseProvider = new WarehouseProvider(); warehouseProvider.Insert(warehouse); if (provider.Delete(shop)) { this.Alert("出库成功!!!"); } } }