示例#1
0
        public FINCardConfig SingleCardConfig(string id)
        {
            _sb = new  StringBuilder();
            _sb.Append(@"SELECT Id
                , Count
                , CardPrefix
                , Maker
                , Memo
                , UnitPrice
                , ValidPeriod                
                , BatchCardStatus
                , MakeDay
                , Start
               
            FROM FINCardConfigs");
            _sb.AppendFormat(" where Id='{0}'", id);
            _dbFunc.ConnectionString = connstr;
            var dt = _dbFunc.ExecuteDataTable(_sb.ToString());

            if (dt != null && dt.Rows.Count > 0)
            {
                return(TableToModel <FINCardConfig> .FillSingleModel(dt.Rows[0]));
            }
            return(null);
        }
示例#2
0
        public FINCard Single(string Key)
        {
            _sb = new StringBuilder();
            _sb.Append(@"SELECT Id
                                    , Memo
                                    , UserId
                                    , ActivatedDay
                                    , Status
                                    , StatusDay
                                    , Password
                                    , CardConfigId
                                    , EndDay
                                    , FailTimes
                                    , LockedEndTime
                                FROM FINCards");
            _sb.AppendFormat(" where Id='{0}'", Key);
            _dbfunc.ConnectionString = connstr;
            var dt = _dbfunc.ExecuteDataTable(_sb.ToString());

            if (dt != null && dt.Rows.Count > 0)
            {
                var mdl = TableToModel <FINCard> .FillSingleModel(dt.Rows[0]);

                return(mdl);
            }
            return(null);
        }
示例#3
0
文件: LessonDAL.cs 项目: HubWong/Edu2
        public TrainBaseLesson GetByVcrId(string vcrid)
        {
            _sb = new StringBuilder();
            _sb.AppendFormat(@"select * from TrainBaseLessons where Id = (select LessonId from vcrs where Id = '{0}')", vcrid);
            _dbfunc.ConnectionString = connstr;
            DataTable dt = _dbfunc.ExecuteDataTable(_sb.ToString());

            if (dt != null && dt.Rows.Count > 0)
            {
                return(TableToModel <TrainBaseLesson> .FillSingleModel(dt.Rows[0]));
            }
            return(null);
        }
示例#4
0
文件: VcrDAL.cs 项目: HubWong/Edu2
        public Vcr Single(string k)
        {
            _sb = new StringBuilder();
            _sb.AppendFormat("select * from Vcrs where Id='{0}'", k);
            _dbFun.ConnectionString = connstr;
            var dt = _dbFun.ExecuteDataTable(_sb.ToString());

            if (dt != null && dt.Rows.Count > 0)
            {
                return(TableToModel <Vcr> .FillSingleModel(dt.Rows[0]));
            }
            return(null);
        }
示例#5
0
文件: LessonDAL.cs 项目: HubWong/Edu2
        public TrainBaseLesson Single(string k)
        {
            _sb = new StringBuilder();
            _sb.AppendFormat("select * from Trainbaselessons where Id='{0}'", k);
            _dbfunc.ConnectionString = connstr;
            DataTable dt = _dbfunc.ExecuteDataTable(_sb.ToString());

            if (dt != null && dt.Rows.Count > 0)
            {
                return(TableToModel <TrainBaseLesson> .FillSingleModel(dt.Rows[0]));
            }
            return(null);

            throw new NotImplementedException();
        }
示例#6
0
        public VcrFile Single(string k)
        {
            _sb = new StringBuilder();
            _sb.AppendFormat(@"SELECT  id 
                                                  , VcrId 
                                                  , Name 
                                                  , Path 
                                                  , MakeDay 
                                                  , Maker 
                                                  , FileOk 
                                              FROM VcrFiles  where Id='{0}'", k);
            dbFunc.ConnectionString = connstr;
            var dt = dbFunc.ExecuteDataTable(_sb.ToString());

            if (dt != null && dt.Rows.Count > 0)
            {
                return(TableToModel <VcrFile> .FillSingleModel(dt.Rows[0]));
            }
            return(null);
        }