ke_junjie
2025-06-04 101c57ec4c28bc3c36e49c50a926e9e7c0dd0247
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
50
51
52
53
using IWareDataAccess.EF;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace IWareDataAccess.PDA.Version
{
    public static class VersionSqlFunc
    {
        /// <summary>
        /// 搜索表
        /// </summary>
        /// <param name="keyValue"></param>
        /// <param name="page"></param>
        /// <returns></returns>
        public static PDA_VERSION SearchOne(string url, string version)
        {
            using (Model edm = new Model())
            {
                PDA_VERSION pda = edm.PDA_VERSION.OrderByDescending(x => x.UpdateTime).FirstOrDefault(x => x.Url.Contains(url) && x.Version.Contains(version));
                return pda;
            }
        }
 
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="keyValue"></param>
        /// <param name="page"></param>
        /// <returns></returns>
        public static bool AddOne(string url, string version)
        {
            using (Model edm = new Model())
            {
                PDA_VERSION pda = new PDA_VERSION();
                pda.Version = version;
                pda.Url = url;
                pda.UpdateTime = DateTime.Now;
                edm.PDA_VERSION.Add(pda);
                if (edm.SaveChanges() > 0)
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
        }
    }
}