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