Exemplo n.º 1
0
        protected override Expression <Func <Purchase, bool> > GetExpression()
        {
            if (!string.IsNullOrWhiteSpace(Keyword))
            {
                ExpressionObj = x =>
                                x.OrderNumber.ToLower().Contains(Keyword) || x.ShipmentTrackingNo.ToLower().Contains(Keyword);
            }

            if (ParentId.IdIsOk())
            {
                ExpressionObj = ExpressionObj.And(x => x.SupplierId == ParentId);
            }

            if (SupplierId.IdIsOk() && SupplierId != new Guid().ToString())
            {
                ExpressionObj = ExpressionObj.And(x => x.SupplierId == SupplierId);
            }

            if (WarehouseId.IdIsOk() && WarehouseId != new Guid().ToString())
            {
                this.ExpressionObj = this.ExpressionObj.And(x => x.WarehouseId == WarehouseId);
            }

            ExpressionObj = ExpressionObj.And(x => x.ShopId == ShopId);
            ExpressionObj = ExpressionObj.And(GenerateBaseEntityExpression());
            return(ExpressionObj);
        }
Exemplo n.º 2
0
        protected override Expression <Func <StockTransferDetail, bool> > GetExpression()
        {
            if (!string.IsNullOrWhiteSpace(Keyword))
            {
                ExpressionObj = x => x.Remarks.ToLower().Contains(Keyword);
            }

            if (!string.IsNullOrWhiteSpace(ParentId))
            {
                ExpressionObj = ExpressionObj.And(x => x.StockTransferId == ParentId);
            }

            if (ProductDetailId.IdIsOk())
            {
                ExpressionObj = ExpressionObj.And(x => x.ProductDetailId == ProductDetailId);
            }

            if (SourceWarehouseId.IdIsOk())
            {
                ExpressionObj = ExpressionObj.And(x => x.SourceWarehouseId == SourceWarehouseId);
            }

            if (DestinationWarehouseId.IdIsOk())
            {
                ExpressionObj = ExpressionObj.And(x => x.DestinationWarehouseId == DestinationWarehouseId);
            }

            ExpressionObj = ExpressionObj.And(x => x.ShopId == ShopId);
            ExpressionObj = ExpressionObj.And(GenerateBaseEntityExpression());
            return(ExpressionObj);
        }
Exemplo n.º 3
0
        protected override Expression <Func <PurchaseDetail, bool> > GetExpression()
        {
            if (!string.IsNullOrWhiteSpace(Keyword))
            {
                ExpressionObj = x => x.Remarks.ToLower().Contains(Keyword);
            }

            if (!string.IsNullOrWhiteSpace(ParentId))
            {
                ExpressionObj = ExpressionObj.And(x => x.PurchaseId == ParentId);
            }

            if (!string.IsNullOrWhiteSpace(ProductDetailId))
            {
                ExpressionObj = ExpressionObj.And(x => x.ProductDetailId == ProductDetailId);
            }

            if (WarehouseId.IdIsOk())
            {
                this.ExpressionObj = this.ExpressionObj.And(x => x.WarehouseId == WarehouseId);
            }

            ExpressionObj = ExpressionObj.And(x => x.ShopId == ShopId);
            ExpressionObj = ExpressionObj.And(GenerateBaseEntityExpression());
            return(ExpressionObj);
        }
Exemplo n.º 4
0
        public override Expression <Func <Teacher, bool> > GetExpression()
        {
            if (!string.IsNullOrWhiteSpace(Keyword))
            {
                ExpressionObj = x =>
                                x.Name.ToLower().Contains(Keyword.ToLower()) ||
                                x.Phone.ToLower().Contains(Keyword.ToLower()) ||
                                x.Address.ToLower().Contains(Keyword.ToLower()) ||
                                x.Email.ToLower().Contains(Keyword.ToLower());
            }
            if (!string.IsNullOrWhiteSpace(Name))
            {
                this.ExpressionObj = ExpressionObj.And(x => Name.ToLower().Contains(Name.ToLower()));
            }
            if (!string.IsNullOrWhiteSpace(Phone))
            {
                this.ExpressionObj = ExpressionObj.And(x => Phone.ToLower().Contains(Phone.ToLower()));
            }
            if (!string.IsNullOrWhiteSpace(Email))
            {
                this.ExpressionObj = ExpressionObj.And(x => Email.ToLower().Contains(Email.ToLower()));
            }
            if (!string.IsNullOrWhiteSpace(Address))
            {
                this.ExpressionObj = ExpressionObj.And(x => Address.ToLower().Contains(Address.ToLower()));
            }


            return(ExpressionObj);
        }
        protected override Expression <Func <ProductDetail, bool> > GetExpression()
        {
            if (!string.IsNullOrWhiteSpace(Keyword))
            {
                ExpressionObj = x =>
                                x.ProductCategory.Name.ToLower().Contains(Keyword) ||
                                x.Name.ToLower().Contains(Keyword) ||
                                x.BarCode.ToLower().Contains(Keyword) ||
                                x.ProductCode.ToLower().Contains(Keyword);
            }

            if (IsProductActive)
            {
                ExpressionObj = ExpressionObj.And(x => x.IsActive == IsProductActive);
            }

            if (IsFinishedProduct)
            {
                ExpressionObj = ExpressionObj.And(x => x.IsRawProduct == false);
            }

            if (ParentId.IdIsOk())
            {
                ExpressionObj = ExpressionObj.And(x => x.ProductCategoryId == ParentId);
            }

            if (OnHand > 0)
            {
                ExpressionObj = ExpressionObj.And(x => x.OnHand <= OnHand);
            }

            ExpressionObj = ExpressionObj.And(x => x.ShopId == ShopId);
            ExpressionObj = ExpressionObj.And(GenerateBaseEntityExpression());
            return(ExpressionObj);
        }
Exemplo n.º 6
0
        protected override Expression <Func <EmployeeInfo, bool> > GetExpression()
        {
            if (!string.IsNullOrWhiteSpace(Keyword))
            {
                ExpressionObj = x =>
                                x.Name.ToLower().Contains(Keyword) || x.Phone.ToLower().Contains(Keyword) ||
                                x.Email.ToLower().Contains(Keyword);
            }

            if (RoleId.IdIsOk())
            {
                this.ExpressionObj = this.ExpressionObj.And(x => x.RoleId == RoleId);
            }

            if (WarehouseId.IdIsOk())
            {
                this.ExpressionObj = this.ExpressionObj.And(x => x.WarehouseId == WarehouseId);
            }

            if (IsEmployeeActive)
            {
                this.ExpressionObj = this.ExpressionObj.And(x => x.IsActive == IsEmployeeActive);
            }

            ExpressionObj = ExpressionObj.And(x => x.ShopId == ShopId);
            ExpressionObj = ExpressionObj.And(GenerateBaseEntityExpression());
            return(ExpressionObj);
        }
Exemplo n.º 7
0
        protected override Expression <Func <SaleDetail, bool> > GetExpression()
        {
            if (!string.IsNullOrWhiteSpace(ParentId))
            {
                ExpressionObj = ExpressionObj.And(x => x.SaleId == ParentId);
            }

            if (!string.IsNullOrWhiteSpace(ProductDetailId))
            {
                ExpressionObj = ExpressionObj.And(x => x.ProductDetailId == ProductDetailId);
            }

            if (WarehouseId.IdIsOk())
            {
                this.ExpressionObj = this.ExpressionObj.And(x => x.WarehouseId == WarehouseId);
            }

            //if (string.IsNullOrWhiteSpace(OrderState))
            //{
            //    OrderState state = (OrderState)Enum.Parse(typeof(OrderState), OrderState);
            //    ExpressionObj = this.ExpressionObj.And(x => x.Sale.OrderState ==)
            //}

            ExpressionObj = ExpressionObj.And(x => x.ShopId == ShopId);
            ExpressionObj = ExpressionObj.And(GenerateBaseEntityExpression());
            return(ExpressionObj);
        }
Exemplo n.º 8
0
        protected override Expression <Func <Teacher, bool> > GetExpression()
        {
            if (Keyword != null && MinCredit != null && MaxCredit != null)
            {
                ExpressionObj = x => (x.TotalCredit > Convert.ToDouble(MinCredit) &&
                                      x.TotalCredit < Convert.ToDouble(MaxCredit)) ||
                                (x.Name.Contains(Keyword) || x.Phone.Contains(Keyword) || x.Courses.Contains(Keyword));
            }

            if (MinCredit != null && MaxCredit != null)
            {
                ExpressionObj = x => x.TotalCredit > Convert.ToDouble(MinCredit) &&
                                x.TotalCredit < Convert.ToDouble(MaxCredit);
            }
            if (Keyword != null)
            {
                ExpressionObj = x => x.Name.Contains(Keyword) || x.Phone.Contains(Keyword) || x.Courses.Contains(Keyword);
            }
            if (MinCredit != null)
            {
                ExpressionObj = x => x.TotalCredit > Convert.ToDouble(MinCredit);
            }
            if (MaxCredit != null)
            {
                ExpressionObj = x => x.TotalCredit < Convert.ToDouble(MaxCredit);
            }

            ExpressionObj = ExpressionObj.And(GenerateBaseEntityExpression());
            return(ExpressionObj);
        }
Exemplo n.º 9
0
        protected override Expression <Func <Transaction, bool> > GetExpression()
        {
            if (!string.IsNullOrWhiteSpace(Keyword))
            {
                ExpressionObj =
                    x =>
                    x.OrderNumber.ToLower().Contains(Keyword) || x.TransactionNumber.ToLower().Contains(Keyword) ||
                    x.AccountHeadName.ToString().ToLower().Contains(Keyword);
            }

            if (!string.IsNullOrWhiteSpace(AccountHeadId))
            {
                ExpressionObj = ExpressionObj.And(x => x.AccountHeadId == AccountHeadId);
            }

            if (!string.IsNullOrWhiteSpace(WalletId))
            {
                this.ExpressionObj = this.ExpressionObj.And(x => x.WalletId == WalletId);
            }

            if (!string.IsNullOrWhiteSpace(ParentId))
            {
                ExpressionObj = ExpressionObj.And(x => x.ParentId == ParentId);
            }

            if (!string.IsNullOrWhiteSpace(TransactionMediumName))
            {
                ExpressionObj = ExpressionObj.And(x => x.TransactionMediumName == TransactionMediumName);
            }

            ExpressionObj = ExpressionObj.And(x => x.ShopId == ShopId);
            ExpressionObj = ExpressionObj.And(GenerateBaseEntityExpression());
            return(ExpressionObj);
        }
Exemplo n.º 10
0
 protected override Expression <Func <Course, bool> > GetExpression()
 {
     Keyword       = Keyword.ToLower();
     ExpressionObj = x => x.Name.Contains(Keyword) || x.Topic.Contains(Keyword);
     ExpressionObj = ExpressionObj.And(GenerateBaseEntityExpression());
     return(ExpressionObj);
 }
 protected override Expression <Func <Student, bool> > GetExpression()
 {
     if (!string.IsNullOrWhiteSpace(Keyword))
     {
         ExpressionObj = x => x.Name.ToLower().Contains(Keyword) || x.Phone.ToLower().Contains(Keyword);
     }
     ExpressionObj = ExpressionObj.And(GenerateBaseEntityExpression());
     return(ExpressionObj);
 }
Exemplo n.º 12
0
 protected override Expression <Func <Department, bool> > GetExpression()
 {
     // by which property we want to query on this table?
     if (!string.IsNullOrWhiteSpace(Keyword))
     {
         ExpressionObj = x => x.Name.ToLower().Contains(Keyword);
     }
     ExpressionObj = ExpressionObj.And(GenerateBaseEntityExpression());
     return(ExpressionObj);
 }
 protected override Expression <Func <Customer, bool> > GetExpression()
 {
     if (!string.IsNullOrWhiteSpace(Keyword))
     {
         ExpressionObj = x => x.Name.ToLower().Contains(Keyword) || x.HouseNo.ToLower().Contains(Keyword) || x.RoadNo.ToLower().Contains(Keyword) || x.Area.ToLower().Contains(Keyword) || x.Thana.ToLower().Contains(Keyword) || x.District.ToLower().Contains(Keyword) || x.Country.ToLower().Contains(Keyword) || x.Phone.ToLower().Contains(Keyword) || x.Email.ToLower().Contains(Keyword);
     }
     ExpressionObj = ExpressionObj
                     .And(GenerateBaseEntityExpression());
     return(ExpressionObj);
 }
Exemplo n.º 14
0
        protected override Expression <Func <Sms, bool> > GetExpression()
        {
            if (!string.IsNullOrWhiteSpace(Keyword))
            {
                ExpressionObj = x => x.Text.ToLower().Contains(Keyword);
            }

            ExpressionObj = ExpressionObj.And(x => x.ShopId == ShopId);
            ExpressionObj = ExpressionObj.And(GenerateBaseEntityExpression());
            return(ExpressionObj);
        }
        protected override Expression <Func <Installment, bool> > GetExpression()
        {
            //if (!string.IsNullOrWhiteSpace(Keyword))
            //{
            //    ExpressionObj = x => x.Sale.OrderNumber.ToLower().Contains(Keyword) || x.Sale.OrderReferenceNumber.ToLower().Contains(Keyword) || x.Sale.CustomerPhone.ToLower().Contains(Keyword) || x.Sale.CustomerName.ToLower().Contains(Keyword);
            //}

            ExpressionObj = ExpressionObj.And(x => x.ShopId == ShopId);
            ExpressionObj = ExpressionObj.And(GenerateBaseEntityExpression());
            return(ExpressionObj);
        }
Exemplo n.º 16
0
        protected override Expression <Func <InstallmentDetail, bool> > GetExpression()
        {
            if (ScheduledDate != new DateTime())
            {
                this.ExpressionObj = this.ExpressionObj.And(x => x.ScheduledDate.Date == ScheduledDate.Date);
            }

            ExpressionObj = ExpressionObj.And(x => x.ShopId == ShopId);
            ExpressionObj = ExpressionObj.And(GenerateBaseEntityExpression());
            return(ExpressionObj);
        }
Exemplo n.º 17
0
 protected override Expression <Func <Customer, bool> > GetExpression()
 {
     if (!string.IsNullOrWhiteSpace(Keyword))
     {
         ExpressionObj = x => x.Name.ToLower().Contains(Keyword) || x.MembarshipCardNo.ToLower().Contains(Keyword) || x.Phone.ToLower().Contains(Keyword) || x.Address.ToLower().Contains(Keyword);
     }
     if (!string.IsNullOrWhiteSpace(Id))
     {
         ExpressionObj.And(x => x.Id == Id);
     }
     return(ExpressionObj);
 }
Exemplo n.º 18
0
 protected override Expression <Func <Partner, bool> > GetExpression()
 {
     if (!string.IsNullOrWhiteSpace(Keyword))
     {
         ExpressionObj = x => x.PartnerShopId.ToLower().Contains(Keyword) || x.ShopId.ToLower().Contains(Keyword);
     }
     if (!string.IsNullOrWhiteSpace(Id))
     {
         ExpressionObj = ExpressionObj.And(x => x.Id == Id);
     }
     return(ExpressionObj);
 }
Exemplo n.º 19
0
 protected override Expression <Func <PurchaseDetail, bool> > GetExpression()
 {
     if (!string.IsNullOrWhiteSpace(Keyword))
     {
         ExpressionObj = x => x.Product.Name.ToLower().Contains(Keyword) || x.Product.BarCode.ToLower().Contains(Keyword);
     }
     if (!string.IsNullOrWhiteSpace(ParentId))
     {
         ExpressionObj = ExpressionObj.And(x => x.PurchaseId == ParentId);
     }
     return(ExpressionObj);
 }
Exemplo n.º 20
0
 protected override Expression <Func <Content, bool> > GetExpression()
 {
     if (!IsNullOrWhiteSpace(Keyword))
     {
         ExpressionObj = x => x.Name.ToLower().Contains(Keyword);
     }
     if (!IsNullOrWhiteSpace(LevelId) && LevelId != new Guid().ToString())
     {
         ExpressionObj = ExpressionObj.And(x => x.LevelId == LevelId);
     }
     return(ExpressionObj);
 }
Exemplo n.º 21
0
 protected override Expression <Func <Course, bool> > GetExpression()
 {
     if (!string.IsNullOrWhiteSpace(Keyword))
     {
         ExpressionObj = x => x.Name.Contains(Keyword) || x.Description.Contains(Keyword);
     }
     if (Fee > 0)
     {
         ExpressionObj = ExpressionObj.And(x => x.Fee <= Fee);
     }
     return(ExpressionObj);
 }
        protected override Expression <Func <Warehouse, bool> > GetExpression()
        {
            if (!string.IsNullOrWhiteSpace(Keyword))
            {
                ExpressionObj = x =>
                                x.Name.ToLower().Contains(Keyword) || x.Area.ToString().ToLower().Contains(Keyword);
            }

            ExpressionObj = ExpressionObj.And(x => x.ShopId == ShopId);
            ExpressionObj = ExpressionObj.And(GenerateBaseEntityExpression());
            return(ExpressionObj);
        }
Exemplo n.º 23
0
 protected override Expression <Func <CollectionDetail, bool> > GetExpression()
 {
     if (!string.IsNullOrWhiteSpace(Keyword))
     {
         ExpressionObj = x => x.Fee.Name.ToLower().Contains(Keyword);
     }
     if (!string.IsNullOrWhiteSpace(ParentId))
     {
         ExpressionObj = ExpressionObj.And(x => x.CollectionId == ParentId);
     }
     return(ExpressionObj);
 }
Exemplo n.º 24
0
 protected override Expression <Func <Student, bool> > GetExpression()
 {
     if (!string.IsNullOrWhiteSpace(Keyword))
     {
         ExpressionObj = x => x.Name.ToLower().Contains(Keyword) || x.Department.Name.ToLower().Contains(Keyword) || x.Phone.ToLower().Contains(Keyword) || x.Address.ToLower().Contains(Keyword);
     }
     if (!string.IsNullOrWhiteSpace(Id))
     {
         ExpressionObj.And(x => x.Id == Id);
     }
     return(ExpressionObj);
 }
Exemplo n.º 25
0
 protected override Expression <Func <Option, bool> > GetExpression()
 {
     if (!string.IsNullOrWhiteSpace(Keyword))
     {
         ExpressionObj = x => x.Name.Contains(Keyword);
     }
     if (ShowOnlyRightAnswers)
     {
         ExpressionObj.And(x => x.IsAnswer);
     }
     return(ExpressionObj);
 }
        protected override Expression <Func <Supplier, bool> > GetExpression()
        {
            if (!string.IsNullOrWhiteSpace(Keyword))
            {
                ExpressionObj = x =>
                                x.Name.ToLower().Contains(Keyword) || x.StreetAddress.ToLower().Contains(Keyword) ||
                                x.Phone.ToLower().Contains(Keyword) || x.ContactPersonName.ToLower().Contains(Keyword);
            }

            ExpressionObj = ExpressionObj.And(x => x.ShopId == ShopId);
            ExpressionObj = ExpressionObj.And(GenerateBaseEntityExpression());
            return(ExpressionObj);
        }
Exemplo n.º 27
0
        protected override Expression <Func <Product, bool> > GetExpression()
        {
            if (!string.IsNullOrWhiteSpace(Keyword))
            {
                ExpressionObj = x => x.Name.ToLower().Contains(Keyword) || x.BarCode.ToLower().Contains(Keyword);
            }
            if (MaxQuantity > 0)
            {
                ExpressionObj = ExpressionObj.And(x => x.OnHand < MaxQuantity);
            }

            return(ExpressionObj);
        }
        public override Expression <Func <Subscription, bool> > GetExpression()
        {
            if (!string.IsNullOrWhiteSpace(Keyword))
            {
                ExpressionObj = x => x.Package.ToString().Contains(Keyword) || x.Edition.Name.Contains(Keyword);
            }
            if (!string.IsNullOrWhiteSpace(TenantId))
            {
                ExpressionObj = ExpressionObj.And(x => x.TenantId == TenantId);
            }

            return(ExpressionObj);
        }
        protected override Expression <Func <DealerProduct, bool> > GetExpression()
        {
            if (!string.IsNullOrWhiteSpace(Keyword))
            {
                ExpressionObj = x =>
                                x.ProductDetailId.Contains(Keyword) ||
                                x.DealerId.Contains(Keyword);
            }

            ExpressionObj = ExpressionObj.And(x => x.ShopId == ShopId);
            ExpressionObj = ExpressionObj.And(GenerateBaseEntityExpression());
            return(ExpressionObj);
        }
 protected override Expression <Func <ProductGroup, bool> > GetExpression()
 {
     if (!string.IsNullOrWhiteSpace(Keyword))
     {
         ExpressionObj = x => x.Name.ToLower().Contains(Keyword);
     }
     if (IsProductGroupActive)
     {
         ExpressionObj = ExpressionObj.And(x => x.IsActive == IsProductGroupActive);
     }
     ExpressionObj = ExpressionObj.And(x => x.ShopId == ShopId);
     ExpressionObj = ExpressionObj.And(GenerateBaseEntityExpression());
     return(ExpressionObj);
 }