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;
|
}
|
}
|
}
|
}
|
}
|