当前位置: 首页>>代码示例>>C#>>正文


C# ObjectCriteria.AddSubCriteria方法代码示例

本文整理汇总了C#中AppFrame.ObjectCriteria.AddSubCriteria方法的典型用法代码示例。如果您正苦于以下问题:C# ObjectCriteria.AddSubCriteria方法的具体用法?C# ObjectCriteria.AddSubCriteria怎么用?C# ObjectCriteria.AddSubCriteria使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AppFrame.ObjectCriteria的用法示例。


在下文中一共展示了ObjectCriteria.AddSubCriteria方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: stockSearchView_BarcodeSearchStockEvent

        private void stockSearchView_BarcodeSearchStockEvent(object sender, StockSearchEventArgs e)
        {
            var subCriteria = new SubObjectCriteria("ProductMaster");
            subCriteria.AddLikeCriteria("ProductName", "%" + e.ProductMasterName + "%");
            subCriteria.AddEqCriteria("ProductType", e.ProductType);
            subCriteria.AddEqCriteria("ProductSize", e.ProductSize);
            subCriteria.AddEqCriteria("ProductColor", e.ProductColor);
            subCriteria.AddEqCriteria("Country", e.Country);
            subCriteria.AddEqCriteria("Manufacturer", e.Manufacturer);
            subCriteria.AddEqCriteria("Packager", e.Packager);
            subCriteria.AddEqCriteria("Distributor", e.Distributor);

            var criteria = new ObjectCriteria(true);
            criteria.AddEqCriteria("DelFlg", CommonConstants.DEL_FLG_NO);
            criteria.AddLikeCriteria("Product.ProductId", e.ProductMasterId + "%");
            criteria.AddSubCriteria("ProductMaster", subCriteria);
            criteria.AddGreaterOrEqualsCriteria("CreateDate", DateUtility.ZeroTime(e.FromDate));
            criteria.AddLesserOrEqualsCriteria("CreateDate", DateUtility.MaxTime(e.ToDate));
            IList list = StockLogic.FindAll(criteria);
            e.StockList = list;
        }
开发者ID:DelLitt,项目名称:opmscoral,代码行数:21,代码来源:StockSearchController.cs

示例2: _departmentStockOutView_LoadProductSizeEvent

 public void _departmentStockOutView_LoadProductSizeEvent(object sender, DepartmentStockOutEventArgs e)
 {
     if (e.SelectedDepartmentStockOutDetail != null && e.SelectedDepartmentStockOutDetail.Product != null && !string.IsNullOrEmpty(e.SelectedDepartmentStockOutDetail.Product.ProductMaster.ProductName))
     {
         var subCriteria = new SubObjectCriteria("ProductMasters");
         subCriteria.AddEqCriteria("DelFlg", CommonConstants.DEL_FLG_NO);
         subCriteria.AddEqCriteria("ProductType", e.SelectedDepartmentStockOutDetail.Product.ProductMaster.ProductType);
         subCriteria.AddEqCriteria("ProductName", e.SelectedDepartmentStockOutDetail.Product.ProductMaster.ProductName);
         subCriteria.AddEqCriteria("ProductColor", e.SelectedDepartmentStockOutDetail.Product.ProductMaster.ProductColor);
         subCriteria.AddEqCriteria("Country", e.SelectedDepartmentStockOutDetail.Product.ProductMaster.Country);
         subCriteria.AddEqCriteria("Manufacturer", e.SelectedDepartmentStockOutDetail.Product.ProductMaster.Manufacturer);
         subCriteria.AddEqCriteria("Distributor", e.SelectedDepartmentStockOutDetail.Product.ProductMaster.Distributor);
         subCriteria.AddEqCriteria("Packager", e.SelectedDepartmentStockOutDetail.Product.ProductMaster.Packager);
         var criteria = new ObjectCriteria();
         criteria.AddSubCriteria("ProductMasters", subCriteria);
         IList productSizes = ProductSizeLogic.FindAll(criteria);
         e.ProductSizeList = productSizes;
     }
 }
开发者ID:DelLitt,项目名称:opmscoral,代码行数:19,代码来源:DepartmentStockOutController.cs

示例3: departmentStockDetailView_SearchDepartmentPriceEvent

        public void departmentStockDetailView_SearchDepartmentPriceEvent(object sender, DepartmentPriceUpdateEventArgs e)
        {
            var subCriteria = new SubObjectCriteria("ProductMaster");
            subCriteria.AddLikeCriteria("ProductMasterId", e.ProductMasterId + "%");
            subCriteria.AddLikeCriteria("ProductName", e.ProductMasterName + "%");
            subCriteria.AddEqCriteria("ProductType", e.ProductType);
            subCriteria.AddEqCriteria("ProductSize",  e.ProductSize);
            subCriteria.AddEqCriteria("ProductColor", e.ProductColor);
            subCriteria.AddEqCriteria("Country", e.Country);
            subCriteria.AddEqCriteria("Packager", e.Packager);
            subCriteria.AddEqCriteria("Manufacturer", e.Manufacturer);
            subCriteria.AddEqCriteria("Distributor", e.Distributor);

            var criteria = new ObjectCriteria();
            criteria.AddEqCriteria("DelFlg", CommonConstants.DEL_FLG_NO);
            criteria.AddSubCriteria("ProductMaster", subCriteria);
            criteria.AddEqCriteria("DepartmentPricePK.DepartmentId", CurrentDepartment.Get().DepartmentId);

            e.DepartmentPriceList = DepartmentPriceLogic.FindAll(criteria);
        }
开发者ID:DelLitt,项目名称:opmscoral,代码行数:20,代码来源:DepartmentPriceUpdateController.cs

示例4: departmentStockCheckingView_LoadProductNamesInTypeEvent

        void departmentStockCheckingView_LoadProductNamesInTypeEvent(object sender, DepartmentStockCheckingEventArgs e)
        {
            SubObjectCriteria prdTypeCrit = new SubObjectCriteria("ProductType");
            prdTypeCrit.AddEqCriteria("TypeName",e.ScannedType.TypeName);

            ObjectCriteria criteria = new ObjectCriteria();
            criteria.AddSubCriteria("ProductType",prdTypeCrit);

            IList prdMasterList = ProductMasterLogic.FindAll(criteria);
            foreach (ProductMaster master in prdMasterList)
            {
                string productName = master.ProductName + "_" + master.ProductColor.ColorName + "_" +
                                     master.ProductSize.SizeName;
                if (!HasInList(e.ScannedType.UnscanProducts, productName))
                {
                    e.ScannedType.UnscanProducts.Add(productName);
                }
            }
        }
开发者ID:DelLitt,项目名称:opmscoral,代码行数:19,代码来源:DepartmentStockViewCheckingController.cs

示例5: _departmentStockInView_FillProductToComboEvent

        void _departmentStockInView_FillProductToComboEvent(object sender, DepartmentStockInEventArgs e)
        {
            ComboBox comboBox = (ComboBox) sender;
                    string originalText = comboBox.Text;
                    if (e.IsFillToComboBox)
                    {
                        ProductMaster searchPM = e.SelectedDepartmentStockInDetail.Product.ProductMaster;
                        var subCrit = new SubObjectCriteria("ProductMaster");
                        subCrit.AddLikeCriteria("ProductName", "%" + searchPM.ProductName + "%");
                        subCrit.AddOrder("ProductName", true);

                        var criteria = new ObjectCriteria(true);
                        /*criteria.AddEqCriteria("pm.DelFlg", CommonConstants.DEL_FLG_NO);
                        criteria.AddEqCriteria("stock.DelFlg", CommonConstants.DEL_FLG_NO);
                        criteria.AddLikeCriteria("pm.ProductName", "%" + searchPM.ProductName + "%");*/
                        criteria.AddSubCriteria("ProductMaster", subCrit);
                        criteria.MaxResult = 200;
                        /*IList list = StockLogic.FindByQueryForStockIn(criteria);*/
                        IList list = StockLogic.FindAll(criteria);
            //                        if (e.ComboBoxDisplayMember.Equals("ProductMasterId"))
            //                        {
            //                            result = ProductMasterLogic.FindProductMasterById(searchPM.ProductMasterId, 50,true);
            //                        }
            //                        else
            //                        {
            //                            result = ProductMasterLogic.FindProductMasterByName(searchPM.ProductName, 50,true);
            //                        }

                        if(list ==null || list.Count == 0)
                        {
                            return;
                        }
                        IList result = new ArrayList();
                        foreach (Stock stock in list)
                        {
                            result.Add(stock.ProductMaster);
                        }
                        IList retlist = RemoveDuplicateName(result);

                        result = new ArrayList();
                        int count = 0;
                        foreach (var p in retlist)
                        {
                            result.Add(p);
                            count++;
                        }

                        BindingList<ProductMaster> productMasters = new BindingList<ProductMaster>();
                        if (result != null)
                        {
                            foreach (ProductMaster master in result)
                            {
                                productMasters.Add(master);
                            }
                        }
                        BindingSource bindingSource = new BindingSource();
                        bindingSource.DataSource = productMasters;
                        comboBox.DataSource = bindingSource;
                        comboBox.DisplayMember = "TypeAndName";
                        comboBox.ValueMember = e.ComboBoxDisplayMember;
                        comboBox.DropDownWidth = 300;
                        comboBox.DropDownHeight = 200;
                        // keep the original text
                        comboBox.Text = originalText;
                        //comboBox.SelectedIndex = -1;
                        //comboBox.SelectionStart = comboBox.Text.Length;
                        //comboBox.DroppedDown = true;
                        comboBox.MaxDropDownItems = 10;
                    }
        }
开发者ID:DelLitt,项目名称:opmscoral,代码行数:70,代码来源:DepartmentStockInExtraController.cs

示例6: _productMasterSearchOrCreateView_SearchRelevantProductsEvent

        void _productMasterSearchOrCreateView_SearchRelevantProductsEvent(object sender, ProductMasterSearchOrCreateEventArgs e)
        {
            var subCriteria = new SubObjectCriteria("ProductMaster");
            subCriteria.AddEqCriteria("ProductName", e.ProductMasterName);

            var criteria = new ObjectCriteria(true);
            criteria.AddEqCriteria("DelFlg", CommonConstants.DEL_FLG_NO);
            criteria.AddSubCriteria("ProductMaster", subCriteria);
            IList list = ProductLogic.FindAll(criteria);
            e.ProductList = list;
        }
开发者ID:DelLitt,项目名称:opmscoral,代码行数:11,代码来源:ProductMasterSearchOrCreateController.cs

示例7: departmentStockInExtraView_LoadMasterDataForExportEvent

        void departmentStockInExtraView_LoadMasterDataForExportEvent(object sender, DepartmentStockInEventArgs e)
        {
            e.SyncFromMainToDepartment = new SyncFromMainToDepartment();
                    if (e.SyncProductMasters)
                    {
                        ObjectCriteria prdCrit = new ObjectCriteria();
                        prdCrit.AddGreaterOrEqualsCriteria("UpdateDate", e.LastSyncTime);
                        IList masterProductList1 = ProductLogic.FindAll(prdCrit);

                        SubObjectCriteria subCrit = new SubObjectCriteria("ProductMaster");
                        subCrit.AddGreaterOrEqualsCriteria("UpdateDate", e.LastSyncTime);
                        prdCrit = new ObjectCriteria();
                        prdCrit.AddSubCriteria("ProductMaster", subCrit);
                        IList masterProductList2 = ProductLogic.FindAll(prdCrit);
                        IList masterProductList = new ArrayList();

                        if (masterProductList1 != null)
                        {
                            foreach (Product product in masterProductList1)
                            {
                                masterProductList.Add(product);
                            }
                        }
                        if (masterProductList2 != null)
                        {
                            foreach (Product product in masterProductList2)
                            {
                                if (!ExistInList(masterProductList, product))
                                {
                                    masterProductList.Add(product);
                                }
                            }
                        }
                        e.SyncFromMainToDepartment.ProductMasterList = masterProductList;
                        e.HasMasterDataToSync = true;
                    }
                    if (e.SyncPrice)
                    {
                        ObjectCriteria deptPriceCrit = new ObjectCriteria();
                        deptPriceCrit.AddGreaterOrEqualsCriteria("UpdateDate", e.LastSyncTime);

                        IList masterDeptPriceList = DepartmentPriceLogic.FindAll(deptPriceCrit);
                        e.SyncFromMainToDepartment.DepartmentPriceMasterList = masterDeptPriceList;
                        e.HasMasterDataToSync = true;
                    }
                    if (e.SyncDepartments)
                    {
                        e.SyncFromMainToDepartment.DepartmentList = DepartmentLogic.FindAll(null);
                        e.SyncFromMainToDepartment.EmployeeList = EmployeeLogic.FindAll(null);
                        e.HasMasterDataToSync = true;
                    }
        }
开发者ID:DelLitt,项目名称:opmscoral,代码行数:52,代码来源:DepartmentStockInExtraController.cs

示例8: departmentStockDetailView_SearchDepartmentPriceEvent

        public void departmentStockDetailView_SearchDepartmentPriceEvent(object sender, DepartmentPriceUpdateEventArgs e)
        {
            var subCriteria = new SubObjectCriteria("ProductMaster");
            subCriteria.AddLikeCriteria("ProductMasterId", "%" + e.ProductMasterId + "%");
            if(e.AbsoluteFinding)
            {
                subCriteria.AddEqCriteria("ProductName", e.ProductMasterName);
            }
            else
            {
                subCriteria.AddLikeCriteria("ProductName", "%" + e.ProductMasterName + "%");
            }
            if(e.ProductType!=null)
            {
                subCriteria.AddEqCriteria("ProductType", e.ProductType);
            }

            if (e.ProductSize != null)
            {
                subCriteria.AddEqCriteria("ProductSize", e.ProductSize);
            }

            if (e.ProductColor != null)
            {
                subCriteria.AddEqCriteria("ProductColor", e.ProductColor);
            }

            if (e.Country != null)
            {
                subCriteria.AddEqCriteria("Country", e.Country);
            }

            if (e.Packager != null)
            {
                subCriteria.AddEqCriteria("Packager", e.Packager);
            }

            if (e.Manufacturer != null)
            {
                subCriteria.AddEqCriteria("Manufacturer", e.Manufacturer);
            }

            if (e.Distributor != null)
            {
                subCriteria.AddEqCriteria("Distributor", e.Distributor);
            }

            subCriteria.AddOrder("ProductName",false);
            subCriteria.AddOrder("ProductColor", false);
            subCriteria.AddOrder("ProductSize", false);
            var criteria = new ObjectCriteria();
            criteria.AddEqCriteria("DelFlg", CommonConstants.DEL_FLG_NO);
            if(e.ZeroPrice)
            {
                criteria.AddEqCriteria("Price", (long) 0);
            }
            if(e.ZeroWholeSalePrice)
            {
                criteria.AddEqCriteria("WholeSalePrice", (long) 0);
            }
            criteria.AddSubCriteria("ProductMaster", subCriteria);
            /*criteria.AddEqCriteria("DepartmentPricePK.DepartmentId", 0);*/

            e.DepartmentPriceList = DepartmentPriceLogic.FindAll(criteria);
        }
开发者ID:DelLitt,项目名称:opmscoral,代码行数:65,代码来源:DepartmentPriceUpdateController.cs

示例9: stockCreateView_SearchStockInDetailEvent

        public void stockCreateView_SearchStockInDetailEvent(object sender, StockCreateEventArgs e)
        {
            // Search StockInDetail
            var subCriteria = new SubObjectCriteria("StockIn");
            subCriteria.AddGreaterOrEqualsCriteria("StockInDate", DateUtility.ZeroTime(e.ImportDateFrom));
            subCriteria.AddLesserOrEqualsCriteria("StockInDate", DateUtility.MaxTime(e.ImportDateTo));
            subCriteria.AddEqCriteria("DelFlg", (long)0);

            var criteria = new ObjectCriteria();
            criteria.AddEqCriteria("DelFlg", (long)0);
            criteria.AddEqCriteria("StockInType", (Int64)e.StockInStatus);
            criteria.AddSubCriteria("StockIn", subCriteria);
            IList stockInDetailList = StockInDetailLogic.FindAll(criteria);
            e.StockInDetailList = stockInDetailList;

            // Search Stock
            if (stockInDetailList.Count > 0)
            {
                // build the Product id list
                IList productIdList = new ArrayList();
                foreach (StockInDetail stockInDetail in stockInDetailList)
                {
                    productIdList.Add(stockInDetail.Product.ProductId);
                }
                criteria = new ObjectCriteria();
                criteria.AddSearchInCriteria("Product.ProductId", productIdList);
                e.StockList = StockLogic.FindAll(criteria);

                criteria = new ObjectCriteria();
                criteria.AddSearchInCriteria("ProductId", productIdList);
                e.ReturnProductList = ReturnProductLogic.FindAll(criteria);
            }
        }
开发者ID:DelLitt,项目名称:opmscoral,代码行数:33,代码来源:StockCreateController.cs

示例10: stockSearchView_BarcodeSearchStockEvent

        private void stockSearchView_BarcodeSearchStockEvent(object sender, StockSearchEventArgs e)
        {
            var subCriteria = new SubObjectCriteria("ProductMaster");
            if(!string.IsNullOrEmpty(e.ProductMasterId))
            {
                subCriteria.AddLikeCriteria("ProductMasterId", "%" + e.ProductMasterId + "%");
            }
            if(!string.IsNullOrEmpty(e.ProductMasterName))
            {
                subCriteria.AddLikeCriteria("ProductName", "%" + e.ProductMasterName + "%");
            }
            if (e.ProductType != null)
            {
                subCriteria.AddEqCriteria("ProductType", e.ProductType);
            }
            if (e.ProductSize != null)
            {
                subCriteria.AddEqCriteria("ProductSize", e.ProductSize);
            }
            if (e.ProductColor != null)
            {
                subCriteria.AddEqCriteria("ProductColor", e.ProductColor);
            }
            if (e.Country != null)
            {
                subCriteria.AddEqCriteria("Country", e.Country);
            }
            if(e.Manufacturer!=null)
            {
                subCriteria.AddEqCriteria("Manufacturer", e.Manufacturer);
            }
            if(e.Packager!=null)
            {
                subCriteria.AddEqCriteria("Packager", e.Packager);
            }
            if (e.Distributor != null)
            {
                subCriteria.AddEqCriteria("Distributor", e.Distributor);
            }
            if (!string.IsNullOrEmpty(e.Description))
            {
                subCriteria.AddLikeCriteria("Description", "%" + e.Description + "%");
            }

            var criteria = new ObjectCriteria(true);
            criteria.AddEqCriteria("DelFlg", CommonConstants.DEL_FLG_NO);
            bool searchByProductId = !string.IsNullOrEmpty(e.ProductId);
            if(searchByProductId)
            {
                criteria.AddLikeCriteria("Product.ProductId", "%" + e.ProductId + "%");
            }

            criteria.AddSubCriteria("ProductMaster", subCriteria);
            criteria.AddOrder("ProductMaster.ProductName", true);
            criteria.AddOrder("Product.ProductId",true);
            IList list = StockLogic.FindAll(criteria);
            if(searchByProductId && e.RelevantProductFinding)
            {
                if(list!=null && list.Count > 0)
                {
                    IList extraList = new ArrayList();
                    foreach (Stock stock in list)
                    {
                        Product product = stock.Product;
                        subCriteria = new SubObjectCriteria("ProductMaster");
                        subCriteria.AddEqCriteria("ProductName", product.ProductMaster.ProductName);
                        criteria = new ObjectCriteria(true);
                        criteria.AddEqCriteria("DelFlg", CommonConstants.DEL_FLG_NO);
                        criteria.AddSubCriteria("ProductMaster", subCriteria);
                        criteria.AddOrder("Product.ProductId", true);
                        IList subList = StockLogic.FindAll(criteria);
                        if(subList!=null && subList.Count > 0 )
                        {
                            foreach (Stock stock1 in subList)
                            {
                                AddStockToList(extraList, stock1);
                            }
                        }
                    }
                    // add to original list
                    foreach (Stock stock in extraList)
                    {
                        AddStockToList(list,stock);
                    }
                }
            }
            e.StockList = list;
        }
开发者ID:DelLitt,项目名称:opmscoral,代码行数:88,代码来源:StockSearchController.cs

示例11: stockSearchView_SearchStockEvent

        public void stockSearchView_SearchStockEvent(object sender, DepartmentStockSearchEventArgs e)
        {
            var criteria = new SubObjectCriteria("ProductMaster");
            if (!string.IsNullOrEmpty(e.ProductMasterId))
            {
                criteria.AddLikeCriteria("ProductMasterId", "%" + e.ProductMasterId + "%");
            }
            criteria.AddEqCriteria("DelFlg", CommonConstants.DEL_FLG_NO);
            criteria.AddLikeCriteria("ProductName", "%" +e.ProductMasterName + "%");
            if (e.ProductType != null && e.ProductType.TypeId > 0)
            {
                criteria.AddEqCriteria("ProductType.TypeId", e.ProductType.TypeId);
            }
            if (e.ProductSize != null && e.ProductSize.SizeId > 0)
            {
                criteria.AddEqCriteria("ProductSize.SizeId", e.ProductSize.SizeId);
            }
            if (e.ProductColor != null && e.ProductColor.ColorId > 0)
            {
                criteria.AddEqCriteria("ProductColor.ColorId", e.ProductColor.ColorId);
            }
            if (e.Country != null && e.Country.CountryId > 0)
            {
                criteria.AddEqCriteria("Country.CountryId", e.Country.CountryId);
            }
            if (!string.IsNullOrEmpty(e.Description))
            {
                criteria.AddLikeCriteria("Description", "%" + e.Description +"%");
            }
            criteria.AddOrder("ProductName",true);

            var objectCriteria = new ObjectCriteria(true);
            objectCriteria.AddEqCriteria("DelFlg", (long)0);
            if (!string.IsNullOrEmpty(e.ProductId))
            {
                objectCriteria.AddLikeCriteria("DepartmentStockPK.ProductId", "%" + e.ProductMasterId + "%");
            }
            objectCriteria.AddEqCriteria("DepartmentStockPK.DepartmentId", CurrentDepartment.Get().DepartmentId);
            objectCriteria.AddSubCriteria("ProductMaster",criteria);

            IList departmentStocks = DepartmentStockLogic.FindAll(objectCriteria);
            IList stockViewList = new ArrayList();
            // create stock view
            if (departmentStocks != null && departmentStocks.Count > 0)
            {
                DepartmentStockView stockView = null;
                foreach (DepartmentStock departmentStock in departmentStocks)
                {
                    if (stockView!=null)
                    {
                       if(!stockView.ProductMaster.ProductName.Equals(
                           departmentStock.Product.ProductMaster.ProductName))
                       {
                           stockViewList.Add(stockView);
                           stockView = null;
                       }
                    }
                    if(stockView == null)
                    {
                        stockView = new DepartmentStockView();
                        stockView.ProductMaster = departmentStock.Product.ProductMaster;
                        stockView.DepartmentStocks = new ArrayList();
                    }

                    stockView.DepartmentStocks.Add(departmentStock);
                    stockView.Quantity += departmentStock.Quantity;
                    stockView.GoodQuantity += departmentStock.GoodQuantity;

                }
                // add last item
                if(stockView!=null)
                {
                    stockViewList.Add(stockView);
                    stockView = null;
                }
                e.DepartmentStockList = stockViewList;
            }
        }
开发者ID:DelLitt,项目名称:opmscoral,代码行数:78,代码来源:DepartmentStockSearchController.cs


注:本文中的AppFrame.ObjectCriteria.AddSubCriteria方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。