You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
87 lines
2.6 KiB
87 lines
2.6 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Data.SqlClient;
|
|
using System.Linq;
|
|
using System.Reflection;
|
|
using System.Text;
|
|
using MESClassLibrary.BLL.Log;
|
|
using MESClassLibrary.DAL;
|
|
using MESClassLibrary.EFModel;
|
|
|
|
namespace MESClassLibrary.BLL.TruckBox
|
|
{
|
|
public class AddressBLL
|
|
{
|
|
BasicBLL<tb_Address_tx> db=new BasicBLL<tb_Address_tx>();
|
|
|
|
public List<tb_Address_tx> SearchInfo(string location, int flag)
|
|
{
|
|
try
|
|
{
|
|
//string sql = @"select * from tb_Address_tx where Location = @location and Flag=@flag order by id";
|
|
|
|
//SqlParameter[] param = new SqlParameter[2];
|
|
//param[0] = new SqlParameter("@location", SqlDbType.VarChar);
|
|
//param[0].Value = location;
|
|
|
|
//param[1] = new SqlParameter("@flag", SqlDbType.Int);
|
|
//param[1].Value = flag;
|
|
//return SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, param).Tables[0];
|
|
return db.SearchAllInfo().Where(p=>p.Location.Equals(location) && p.Flag==flag).ToList();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogErrBLL.AddInfo(ex.ToString(),MethodBase.GetCurrentMethod());
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public bool UpdateValue(string address, string value)
|
|
{
|
|
bool res = false;
|
|
try
|
|
{
|
|
string sql=@"update tb_Address_tx set RealValue='"+ value +@"' where Address='"+ address +@"'";
|
|
|
|
SqlHelper.ExecuteNonQuery(SqlHelper.GetConnSting(), CommandType.Text, sql, null);
|
|
return true;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogErrBLL.AddInfo(ex.ToString(),MethodBase.GetCurrentMethod());
|
|
}
|
|
|
|
return res;
|
|
}
|
|
|
|
public List<tb_Address_tx> GetDoneValue()
|
|
{
|
|
try
|
|
{
|
|
return db.SearchAllInfo().Where(p => p.ID.Equals(59) || p.ID.Equals(60)).ToList();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogErrBLL.AddInfo(ex.ToString(),MethodBase.GetCurrentMethod());
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public string GetTimeValue(int id)
|
|
{
|
|
string res = "";
|
|
|
|
List<tb_Address_tx> list = db.SearchAllInfo().Where(p => p.ID.Equals(id)).ToList();
|
|
if (list.Any())
|
|
{
|
|
foreach (var item in list)
|
|
{
|
|
res = item.RealValue;
|
|
}
|
|
}
|
|
|
|
return res;
|
|
}
|
|
}
|
|
}
|
|
|