Ejemplo n.º 1
0
        private bool AllowDelete(string supplierId)
        {
            bool result = true;

            if (!string.IsNullOrEmpty(supplierId))
            {
                IList <Product>       proEnts = Product.FindAll("from Product where SupplierId='" + supplierId + "'");             //有产品的供应商不允许删除
                IList <PurchaseOrder> poEnts  = PurchaseOrder.FindAll("from PurchaseOrder where SupplierId='" + supplierId + "'"); //有没有做采购单
                IList <InWarehouse>   iwEnts  = InWarehouse.FindAll("from InWarehouse where SupplierId='" + supplierId + "'");     //有没有做入库单
                if (poEnts.Count > 0 || iwEnts.Count > 0 || proEnts.Count > 0)
                {
                    result = false;
                }
            }
            return(result);
        }
        private void DoSelect()
        {
            IList <InWarehouse> iwEnts = InWarehouse.FindAll("from InWarehouse where State='未入库'");

            PageState.Add("InWarehouseList", iwEnts);
        }