分支自 SuZhouGuanHong/TaiYuanTaiZhong

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.EFDbContext;
using WIDESEA_Core.FreeDB;
using WIDESEA_Entity.DomainModels;
using WIDESEA_WMS.IRepositories;
using WIDESEA_WMS.Repositories;
 
namespace WIDESEA_WMS.Common
{
    public class QueryData
    {
        static FreeDB freeDB = new FreeDB();
        /// <summary>
        /// 根据图号查询车轮信息
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public static dt_geometry_data QueryMateriel(string type)
        {
            VOLContext Context = new VOLContext();
            Idt_geometry_dataRepository dataRepository = new dt_geometry_dataRepository(Context);
            var materielinfo = dataRepository.Find(x => x.Description == type).OrderBy(x => x.TypeId).FirstOrDefault();
            //var materielinfo = freeDB.Select<dt_geometry_data>().Where(x => x.Description == type).First();
            return materielinfo;
        }
        public static dt_geometry_data_detectionline QueryMateriel1(string type)
        {
            VOLContext Context = new VOLContext();
            Idt_geometry_data_detectionlineRepository data_DetectionlineRepository = new dt_geometry_data_detectionlineRepository(Context);
            //var materielinfo = freeDB.Select<dt_geometry_data_detectionline>().Where(x => x.Description == type).First();
            var materielinfo = data_DetectionlineRepository.Find(x => x.Description == type).OrderBy(x => x.TypeId).FirstOrDefault();
            return materielinfo;
        }
        /// <summary>
        /// 根据主键查询车轮信息
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public static dt_geometry_data QueryMateriel(int type)
        {
            var materielinfo = freeDB.Select<dt_geometry_data>().Where(x => x.TypeId == type).First();
            return materielinfo;
        }
    }
}