Beispiel #1
0
        protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            int rowIndex = e.RowIndex;

            Shop shop = new Shop();

            shop.Shop_id = Convert.ToInt32(this.GridView2.DataKeys[rowIndex].Value);

            ContractShopProvider provider = new ContractShopProvider();

            if (provider.Delete(shop))
            {
                this.Alert("删除成功!!!");

                this.ListPager2.RecordCount = this.ListPager2.RecordCount - 1;
                this.BindSourceShop();
            }
        }
Beispiel #2
0
        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("出库成功!!!");
                }
            }
        }