예제 #1
0
        public void lbDelete_Click(Object sender, EventArgs e)
        {
            DeleteAccess();
            var userInSession = (Users)Session["userinsession"];
            var lb            = (LinkButton)sender;
            var warehouse     = new Warehouses();

            warehouse.Delete(Convert.ToInt32(lb.CommandArgument), userInSession.ID, OtherMethods.GetIPAddress(), "WarehousesView");
            Page.Response.Redirect("~/ManagerUI/Menu/Souls/WarehousesView.aspx");
        }
        private void DeleteWarehouse()
        {
            if (SelectedWarehouse == null)
            {
                return;
            }

            if (SelectedWarehouse.WarehouseId == 0)
            {
                _Warehouses.Remove(SelectedWarehouse);
                SelectedWarehouse = null;
                return;
            }

            Warehouses.Delete(SelectedWarehouse.WarehouseId);
            _Warehouses.Remove(SelectedWarehouse);
            SelectedWarehouse = null;
        }