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


C# AppFrame.ObjectCriteria类代码示例

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


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

示例1: stockInConfirmView_ConfirmStockInEvent

        void stockInConfirmView_ConfirmStockInEvent(object sender, StockInConfirmEventArgs e)
        {
            try
            {
                ObjectCriteria objectCriteria = new ObjectCriteria();
                objectCriteria.AddSearchInCriteria("StockInId", e.ConfirmStockInList);
                objectCriteria.AddEqCriteria("DelFlg", CommonConstants.DEL_FLG_NO);
                IList stockInList = StockInLogic.FindAll(objectCriteria);

                if (stockInList != null && stockInList.Count > 0)
                {
                    foreach (StockIn stockIn in stockInList)
                    {
                        if (stockIn.ConfirmFlg == 1)
                        {
                            stockIn.ConfirmFlg = 0;
                            StockInLogic.Update(stockIn);
                        }
                    }
                }
                else
                {
                    throw new BusinessException("Khong co gi de luu");
                }
            }
            catch (Exception exception)
            {
                e.EventResult = " Error !";
                e.HasErrors = true;
            }
        }
开发者ID:DelLitt,项目名称:opmscoral,代码行数:31,代码来源:StockInConfirmController.cs

示例2: 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

示例3: processPeriodMoneyView_LoadProcessPeriodMoneyEvent

 void processPeriodMoneyView_LoadProcessPeriodMoneyEvent(object sender, ProcessPeriodMoneyEventArgs e)
 {
     DateTime toDay = DateUtility.DateOnly(DateTime.Now);
     ObjectCriteria objectCriteria = new ObjectCriteria();
     objectCriteria.AddEqCriteria("EmployeeMoneyPK.WorkingDay", toDay);
     IList list  = EmployeeMoneyLogic.FindAll(objectCriteria);
     e.PeriodMoneyList = list;
 }
开发者ID:DelLitt,项目名称:opmscoral,代码行数:8,代码来源:ProcessPeriodMoneyController.cs

示例4: closedPeriodView_LoadClosedPeriodEvent

 void closedPeriodView_LoadClosedPeriodEvent(object sender, ClosedPeriodEventArgs e)
 {
     DateTime fromDay = DateUtility.DateOnly(e.FromDate);
     DateTime toDay = DateUtility.DateOnly(e.ToDate);
     ObjectCriteria objectCriteria = new ObjectCriteria();
     objectCriteria.AddBetweenCriteria("EmployeeMoneyPK.WorkingDay", fromDay,toDay);
     IList list = EmployeeMoneyLogic.FindAll(objectCriteria);
     e.EmployeeMoneyList = list;
 }
开发者ID:DelLitt,项目名称:opmscoral,代码行数:9,代码来源:ClosedPeriodLogic.cs

示例5: departmentStockInSearchView_SearchMainStockInEvent

 public void departmentStockInSearchView_SearchMainStockInEvent(object sender, MainStockInSearchEventArgs e)
 {
     var criteria = new ObjectCriteria();
     criteria.AddGreaterOrEqualsCriteria("StockInDate", e.StockInDateFrom);
     criteria.AddLesserOrEqualsCriteria("StockInDate", e.StockInDateTo);
     criteria.AddLikeCriteria("StockInId", e.StockInId + "%");
     criteria.AddEqCriteria("DelFlg", (long)0);
     e.StockInList = StockInLogic.FindAll(criteria);
 }
开发者ID:DelLitt,项目名称:opmscoral,代码行数:9,代码来源:MainStockInSearchController.cs

示例6: departmentStockInSearchView_SearchDepartmentStockInEvent

 public void departmentStockInSearchView_SearchDepartmentStockInEvent(object sender, DepartmentStockInSearchEventArgs e)
 {
     var criteria = new ObjectCriteria();
     criteria.AddEqCriteria("DepartmentStockInPK.DepartmentId", CurrentDepartment.Get().DepartmentId);
     criteria.AddGreaterOrEqualsCriteria("StockInDate", e.StockInDateFrom);
     criteria.AddLesserOrEqualsCriteria("StockInDate", e.StockInDateTo);
     criteria.AddLikeCriteria("DepartmentStockInPK.StockInId", e.StockInId + "%");
     criteria.AddEqCriteria("DelFlg", (long)0);
     e.DepartmeneStockInList = DepartmentStockInLogic.FindAll(criteria);
     EventUtility.fireEvent(CompletedSearchDepartmentStockInEvent,this,e);
 }
开发者ID:DelLitt,项目名称:opmscoral,代码行数:11,代码来源:DepartmentStockInSearchController.cs

示例7: departmentStockDetailView_SearchDepartmentStockInDetailEvent

 public void departmentStockDetailView_SearchDepartmentStockInDetailEvent(object sender, DepartmentStockDetailEventArgs e)
 {
     long deptId = CurrentDepartment.Get().DepartmentId;
     var objectCriteria = new ObjectCriteria(true);
     objectCriteria.AddEqCriteria("s.DelFlg", CommonConstants.DEL_FLG_NO);
     objectCriteria.AddEqCriteria("pm.ProductMasterId", e.ProductMasterId);
     objectCriteria.AddEqCriteria("s.DepartmentStockInDetailPK.DepartmentId", deptId);
     objectCriteria.AddGreaterOrEqualsCriteria("deptStockIn.StockInDate", e.StockInDateFrom);
     objectCriteria.AddLesserOrEqualsCriteria("deptStockIn.StockInDate", e.StockInDateTo);
     e.DepartmentStockInDetailList = DepartmentStockInDetailLogic.FindByQuery(objectCriteria);
     e.ProductPrice = DepartmentPriceLogic.FindById(new DepartmentPricePK { ProductMasterId = e.ProductMasterId, DepartmentId = deptId });
 }
开发者ID:DelLitt,项目名称:opmscoral,代码行数:12,代码来源:DepartmentStockDetailController.cs

示例8: goodsIOSearchView_SearchBlockInDetailEvent

 public void goodsIOSearchView_SearchBlockInDetailEvent(object sender, GoodsIOSearchEventArgs e)
 {
     var criteria = new ObjectCriteria();
     if (!string.IsNullOrEmpty(e.BlockDetailId))
     {
         criteria.AddLikeCriteria("BlockInDetailPK.BlockDetailId", string.Format("{0}%", e.BlockDetailId));
     }
     criteria.AddGreaterOrEqualsCriteria("ImportDate", DateUtility.ZeroTime(e.ImportDateFrom));
     criteria.AddLesserOrEqualsCriteria("ImportDate", DateUtility.MaxTime(e.ImportDateTo));
     if (!e.IsNeedDelete)
     {
         criteria.AddEqCriteria("DelFlg", (Int64)0);
     }
     e.BlockDetailList = BlockInDetailLogic.FindAll(criteria);
 }
开发者ID:DelLitt,项目名称:opmscoral,代码行数:15,代码来源:GoodsIOSearchController.cs

示例9: posLogView_SearchPosLogEvent

 private void posLogView_SearchPosLogEvent(object sender, PosLogEventArgs e)
 {
     var criteria = new ObjectCriteria();
     if(!string.IsNullOrEmpty(e.Username))
     {
         criteria.AddLikeCriteria("PosUser", e.Username + "%");
     }
     if(!string.IsNullOrEmpty(e.Action))
     {
         criteria.AddLikeCriteria("PosAction", e.Action + "%");
     }
     criteria.AddGreaterOrEqualsCriteria("Date", DateUtility.ZeroTime(e.LogDateFrom));
     criteria.AddLesserOrEqualsCriteria("Date", DateUtility.MaxTime(e.LogDateTo));
     criteria.AddOrder("Date", false);
     IList list = PosLogLogic.FindAll(criteria);
     e.PosLogList = list;
 }
开发者ID:DelLitt,项目名称:opmscoral,代码行数:17,代码来源:PosLogController.cs

示例10: employeeWorkingView_LoadEmployeesWorkingDay

        void employeeWorkingView_LoadEmployeesWorkingDay(object sender, EmployeeWorkingsLogicEventArg e)
        {
            ObjectCriteria wDayCrit = new ObjectCriteria();
            wDayCrit.AddEqCriteria("Department.DepartmentId", CurrentDepartment.Get().DepartmentId);
            wDayCrit.AddBetweenCriteria("EmployeeWorkingDayPK.WorkingDay", DateUtility.ZeroTime(DateTime.Now),
                                        DateUtility.MaxTime(DateTime.Now));

            IList wDayResult = EmployeeWorkingDayLogic.FindAll(wDayCrit);
            e.EmployeeWorkingList = wDayResult;
            if(wDayResult!=null && wDayResult.Count > 0)
            {
                foreach (EmployeeWorkingDay workingDay in wDayResult)
                {
                    ObjectCriteria criteria = new ObjectCriteria();
                    criteria.AddEqCriteria("EmployeePK.EmployeeId", workingDay.EmployeeWorkingDayPK.EmployeeId);
                    IList list = EmployeeLogic.FindAll(criteria);
                    workingDay.Employee = (Employee)list[0];
                }
            }
        }
开发者ID:DelLitt,项目名称:opmscoral,代码行数:20,代码来源:EmployeeWorkingsLogicImpl.cs

示例11: FindAll

        /// <summary>
        /// Find all EmployeeMoney from database. No pagination.
        /// </summary>
        /// <param name="criteria"></param>
        /// <returns></returns>
        public IList FindAll(ObjectCriteria criteria)
        {
            ISession session = HibernateTemplate.SessionFactory.OpenSession();
            try
            {
                ICriteria hibernateCriteria = session.CreateCriteria(typeof(EmployeeMoney));
                if (criteria != null)
                {
                    IDictionary<string, SubObjectCriteria> map = criteria.GetSubCriteria();
                    if (map.Count > 0)
                    {
                        foreach (string key in map.Keys)
                        {
                            hibernateCriteria.CreateAlias(key, key);
                        }
                        AddCriteriaAndOrder(hibernateCriteria, criteria.GetWhere(), criteria.GetOrder());

                        foreach (string key in map.Keys)
                        {
                            SubObjectCriteria subCriteria = null;
                            map.TryGetValue(key, out subCriteria);
                            AddCriteriaAndOrder(hibernateCriteria, subCriteria.GetWhere(), subCriteria.GetOrder());
                        }
                    }
                    else
                    {
                        AddCriteriaAndOrder(hibernateCriteria, criteria.GetWhere(), criteria.GetOrder());
                    }
                }
                return hibernateCriteria.List();
            }
            finally
            {
                if (session != null)
                {
                    session.Disconnect();
                }
            }
        }
开发者ID:DelLitt,项目名称:opmscoral,代码行数:44,代码来源:EmployeeMoneyDAOImpl.cs

示例12: productMasterView_InitProductMasterEvent

        private void productMasterView_InitProductMasterEvent(object sender, ProductMasterEventArgs e)
        {
            var criteria = new ObjectCriteria();
            criteria.AddEqCriteria("DelFlg", CommonConstants.DEL_FLG_NO);
            e.ProductTypeList = ProductTypeLogic.FindAll(criteria);
            e.ProductTypeList.Insert(0, new ProductType());
            e.ProductSizeList = ProductSizeLogic.FindAll(criteria);
            e.ProductSizeList.Insert(0, new ProductSize());
            e.ProductColorList = ProductColorLogic.FindAll(criteria);
            e.ProductColorList.Insert(0, new ProductColor());
            e.CountryList = CountryLogic.FindAll(criteria);
            e.CountryList.Insert(0, new Country());
            e.ManufacturerList = ManufacturerLogic.FindAll(criteria);
            e.ManufacturerList.Insert(0, new Manufacturer());
            e.PackagerList = PackagerLogic.FindAll(criteria);
            e.PackagerList.Insert(0, new Packager());
            e.DistributorList = DistributorLogic.FindAll(criteria);
            e.DistributorList.Insert(0, new Distributor());

            if (e.ProductMasterForInit != null)
            {
                criteria = new ObjectCriteria();
                criteria.AddEqCriteria("DelFlg", CommonConstants.DEL_FLG_NO);
                criteria.AddEqCriteria("ProductName", e.ProductMasterForInit.ProductName);
                criteria.AddEqCriteria("ProductType", e.ProductMasterForInit.ProductType);
                criteria.AddEqCriteria("Manufacturer", e.ProductMasterForInit.Manufacturer);
                criteria.AddEqCriteria("Distributor", e.ProductMasterForInit.Distributor);
                criteria.AddEqCriteria("Packager", e.ProductMasterForInit.Packager);
                criteria.AddEqCriteria("Country", e.ProductMasterForInit.Country);

                e.SameProductMasterList = ProductMasterLogic.FindAll(criteria);
            }
        }
开发者ID:DelLitt,项目名称:opmscoral,代码行数:33,代码来源:ProductMasterController.cs

示例13: productMasterView_LoadProductMasterEvent

        public void productMasterView_LoadProductMasterEvent(object sender, ProductMasterEventArgs e)
        {
            if (!string.IsNullOrEmpty(e.ProductMasterId))
            {
                e.ProductMaster = ProductMasterLogic.FindById(e.ProductMasterId);
                if (e.ProductMaster != null)
                {
                    // all the dept has same price
                    var criteria = new ObjectCriteria();
                    criteria.AddEqCriteria("DepartmentPricePK.ProductMasterId", e.ProductMasterId);
                    criteria.AddEqCriteria("DelFlg", CommonConstants.DEL_FLG_NO);
                    IList list = DepartmentPriceLogic.FindAll(criteria);
                    if (list.Count > 0)
                    {
                        e.DepartmentPrice = (DepartmentPrice)list[0];
                    }
                }

            }
        }
开发者ID:DelLitt,项目名称:opmscoral,代码行数:20,代码来源:ProductMasterController.cs

示例14: _departmentStockAdhocProcessingView_LoadAdhocStocksEvent

        void _departmentStockAdhocProcessingView_LoadAdhocStocksEvent(object sender, DepartmentStockAdhocProcessingEventArgs e)
        {
            ObjectCriteria criteria = new ObjectCriteria();
            criteria.AddEqCriteria("DelFlg", CommonConstants.DEL_FLG_NO);
            criteria.AddEqCriteria("Fixed", CommonConstants.DEL_FLG_NO);
            criteria.AddOrder("ProductMaster.ProductMasterId", true);
            IList list = DepartmentStockTempLogic.FindAll(criteria);
            IList deptStockTempList = null;
            if (list != null && list.Count > 0)
            {
                deptStockTempList = new ArrayList();

                foreach (DepartmentStockTemp stockTemp in list)
                {
                    int viewIndex = -1;
                    if(HasInList(stockTemp,deptStockTempList,out viewIndex))
                    {
                        DepartmentStockTempView view = (DepartmentStockTempView) deptStockTempList[viewIndex];
                        view.Quantity += stockTemp.Quantity;

                        view.GoodQuantity += stockTemp.GoodQuantity;
                        view.ErrorQuantity += stockTemp.ErrorQuantity;
                        view.DamageQuantity += stockTemp.DamageQuantity;
                        view.LostQuantity += stockTemp.LostQuantity;
                        view.UnconfirmQuantity += stockTemp.UnconfirmQuantity;
                        view.RealQuantity += stockTemp.GoodQuantity + stockTemp.ErrorQuantity + stockTemp.DamageQuantity +
                                        stockTemp.LostQuantity + stockTemp.UnconfirmQuantity;
                        view.DepartmentStockTemps.Add(stockTemp);
                    }
                    else
                    {
                        DepartmentStockTempView view = new DepartmentStockTempView();
                        view.Quantity += stockTemp.Quantity;
                        view.GoodQuantity += stockTemp.GoodQuantity;
                        view.ErrorQuantity += stockTemp.ErrorQuantity;
                        view.DamageQuantity += stockTemp.DamageQuantity;
                        view.LostQuantity += stockTemp.LostQuantity;
                        view.UnconfirmQuantity += stockTemp.UnconfirmQuantity;
                        view.RealQuantity += stockTemp.GoodQuantity + stockTemp.ErrorQuantity + stockTemp.DamageQuantity +
                                        stockTemp.LostQuantity + stockTemp.UnconfirmQuantity;

                        view.ProductMaster = stockTemp.ProductMaster;
                        view.DepartmentStockTemps = new ArrayList();
                        view.DepartmentStockTemps.Add(stockTemp);
                        deptStockTempList.Add(view);
                    }
                }

            }

            e.DeptStockAdhocList = deptStockTempList;
        }
开发者ID:DelLitt,项目名称:opmscoral,代码行数:52,代码来源:DepartmentStockAdhocProcessingController.cs

示例15: 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


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