123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- using System;
- using System.Collections.Generic;
- using System.Data;
- using System.Data.SqlClient;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Models;
- namespace DAL
- {
- public class ITIN_EmployeeInputService
- {
- List<ITIN_EmployeeInputInfo> excuteSql(string sql, params SqlParameter[] param)
- {
- return ServiceBase<ITIN_EmployeeInputInfo>.excuteSql(new ITIN_EmployeeInputInfo(), "AirTicketBlackCode", sql, CommandType.Text, param);
- }
- ITIN_EmployeeInputInfo excuteType(string sql, params SqlParameter[] param)
- {
- //查询结果放入对象集合
- List<ITIN_EmployeeInputInfo> hdList = excuteSql(sql, param);
- //判断集合是否为空
- if (hdList == null || hdList.Count == 0)
- //返回null
- return null;
- //返回单个对象
- return hdList[0];
- }
- #region 数据添加相关函数
- public bool Insert_ITINEmployeeInfo(ITIN_EmployeeInputInfo _info)
- {
- string sql = " Insert Into ITINEmployee Values(@Diid,@Days,@YDate,@Sort,@Content,@Operators,@OperatorsDate,@IsDel) ";
- SqlParameter[] parameter = new SqlParameter[]{
- new SqlParameter("@Diid",_info.Diid),
- new SqlParameter("@Days",_info.Days),
- new SqlParameter("@YDate",_info.YDate),
- new SqlParameter("@Sort",_info.Sort),
- new SqlParameter("@Content",_info.Content),
- new SqlParameter("@Operators",_info.Operators),
- new SqlParameter("@OperatorsDate",_info.OperatorsDate),
- new SqlParameter("@IsDel",_info.IsDel),
- };
- if (SqlHelper.ExecuteNonQuery(sql, CommandType.Text, parameter) > 0)
- return true;
- return false;
- }
- #endregion
- #region 数据删除相关函数
- public bool Delete_Single_ITIN(int id)
- {
- if (SqlHelper.ExecuteNonQuery("update ITINEmployee set Isdel=1 where Id=@Id", CommandType.Text, new SqlParameter("@Id", id)) > 0)
- return true;
- return false;
- }
- #endregion
- #region 数据修改相关函数
- public bool Update_Single_ITIN(ITIN_EmployeeInputInfo _info)
- {
- string sql = "update ITINEmployee Set Diid=@Diid,Days=@Days,Sort=@Sort,YDate=@YDate,Content=@Content,Operators=@Operators,OperatorsDate=@OperatorsDate,IsDel=@IsDel where Id = @Id";
- SqlParameter[] parameter = new SqlParameter[]{
- new SqlParameter("@Diid",_info.Diid),
- new SqlParameter("@Days",_info.Days),
- new SqlParameter("@YDate",_info.YDate),
- new SqlParameter("@Sort",_info.Sort),
- new SqlParameter("@Content",_info.Content),
- new SqlParameter("@Operators",_info.Operators),
- new SqlParameter("@OperatorsDate",_info.OperatorsDate),
- new SqlParameter("@IsDel",_info.IsDel),
- new SqlParameter("@Id",_info.Id),
- };
- if (SqlHelper.ExecuteNonQuery(sql, CommandType.Text, parameter) > 0)
- return true;
- return false;
- }
- #endregion
- #region 数据查询相关函数
- public List<ITIN_EmployeeInputInfo> Select_List_ITIN(int Diid)
- {
- return excuteSql("select * from ITINEmployee where Isdel=0 and Diid=" + Diid + " order by Days,Sort");
- }
- public ITIN_EmployeeInputInfo Select_Single_ITIN(int id)
- {
- return excuteType("select * from ITINEmployee where Isdel=0 and Id=@id", new SqlParameter("@id", id));
- }
- #endregion
- }
- }
|