using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Domain;
using System.Data;

namespace Dao.Implement
{
    public class KongTiaoTimerRepository : RepositoryBase<KongTiaoTimer>, IRoomAirConditionMissionRepository
    {
        public int Add(KongTiaoTimer test)
        {
            object obj= Save(test);
            return 1;
        }


        public new int Update(KongTiaoTimer test)
        {
            Session.CreateSQLQuery("update KongTiaoTimer set IsCancel=1 where MissonKey=?").SetString(0,test.MissonKey).ExecuteUpdate();
            return 1;
        }

        public List<KongTiaoTimer> SelectNoExecuted()
        {
            return LoadAll().Where(r => r.IsCancel==0).ToList();
        }
    }
}
