public IndepPracticeContract GetPracticeById(long Id)
        {
            var builder = new SelectBuilder("SELECT * FROM indeppractice")
                          .RegisterEqualClause("id", Id);

            //自动根据dataReader转成实体
            return(AdoProvide.ExecuteReader(ReadConnectionString, builder, reader => EntityHelper.GetEntity <IndepPracticeContract>(reader)).FirstOrDefault());
        }
Exemplo n.º 2
0
        public SupportContract GetModelByResourceId(long resourceId)
        {
            var bulider = new SelectBuilder("select * from support") //查询的SQL语句.
                          .RegisterEqualClause("ResourceId", resourceId);

            //自动根据dataReader转成实体
            return(AdoProvide.ExecuteReader(ReadConnectionString, bulider, reader => EntityHelper.GetEntity <SupportContract>(reader)).FirstOrDefault());
        }
Exemplo n.º 3
0
        /// <summary>
        /// 查询作业答案(无效方法)
        /// </summary>
        /// <param name="doId"></param>
        /// <param name="answerType"></param>
        /// <returns></returns>
        public List <WorkAnswerContract <FlowReadAnswerEntity> > GetReadAnswers(long doId, int answerType)
        {
            var builder = new SelectBuilder("SELECT * FROM workanswer where DoId =@DoId and AnswerType=@AnswerType GROUP BY VersionId ORDER BY Score desc");

            var _params = new IDataParameter[] {
                AdoProvide.BuildParameter("@DoId", doId),
                AdoProvide.BuildParameter("@AnswerType", answerType)
            };

            return(AdoProvide.ExecuteReader(ReadConnectionString, builder, reader => EntityHelper.GetEntity <WorkAnswerContract <FlowReadAnswerEntity> >(reader)).ToList());
        }
        public IndepPracticeContract GetPracticeByIds(long verionId, string moduleId, int userId)
        {
            var builder = new SelectBuilder("SELECT * FROM indeppractice")
                          .RegisterEqualClause("VersionId", verionId)
                          .RegisterEqualClause("ModuleId", moduleId)
                          .RegisterEqualClause("SubmitUserId", userId)
                          .RegisterEqualClause("Status", "0");

            //自动根据dataReader转成实体
            return(AdoProvide.ExecuteReader(ReadConnectionString, builder, reader => EntityHelper.GetEntity <IndepPracticeContract>(reader)).FirstOrDefault());
        }