本文介绍了如何在搜索实体框架中放置两个不同的查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

下午有智慧的朋友,如果有人指导我,请创建我的产品销售应用程序,我应该在其中查找大宗产品,我的条形码可以进行搜索

我必须批量销售产品时出现问题
我的餐桌产品

Hello

Afternoon friends with wisdom if someone guides me please I'm making a product sale application I have a part where I should look for bulk products I have a bar code that does the search

My problem is generated when I have to sell products in bulk
My table products

IdProduct条码名称名称产品价格IdMeasure IdSubFamilia

我想查询一个带有条形码和idmeasure = 3(公斤)的产品

IdProduct barcode  name Product price IdMeasure IdSubFamilia

I wanted to make a query that brings the products with the bar code and the idmeasure = 3 (this is kilogram)

您必须打开一个批量表单


如果度量不同于3

问我其他问题



此查询可单独使用


在文本框中



条码

You have to open a bulk form


And if the measure is different from 3

Ask me the other query



This query that works alone


It's in text box



Barcode

这是实体framewok层中的内容

This is what is in the entity framewok layer

Public PRODUCT GetBybarcorde (string Code)
        {
            DAL.IRepository repository = new Template.Repository ();
            Try
            {
                Var product = repository.FindEntity <PRODUCT> (a => a.barcorde == Code, "Sale_Details", "Shopping_Details", "Measure", "SubFamilyProduct");
                If (product! = Null)
                {
                    Product.IdFamilia = product.SubFamiliaProducto.IdFamilia;
                    Var fami = new FamilyProduct ();
                    Fami = repository.FindEntity <ProductProduct> (x => x.IdFamilia == product.SubfamilyProduct.IdFamily);
                    Product.familyName = familyfamilyName;
                    Product.MeasureName = product.Measure.Measure1;
                    Product.SubfamilyName = product.SubfamilyProduct.SubfamilyName;
                            

                }
                Else
                {
                    Product = null;
                }
                Return product;
            }
            Catch (Exception ex)
            {
                Throw new Exception (ex.Message);
            }
        }


我缺少一些查询,以通过IdMeasure = 3(即千克)对我进行过滤
我需要两种设置,一种用于IdMeasure = 3,另一种与IdMeasure不同
我被fa


I am missing some query to filter me by the IdMeasure = 3 (which is kilogram)
I need to have two setups one for IdMeasure = 3 and one that is different from IdMeasure
I'm trapped in this by fa

推荐答案


这篇关于如何在搜索实体框架中放置两个不同的查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-10 12:48