Пример #1
0
        /// <summary>
        /// 获取试卷的组卷策略详细信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        private static PaperDefineInfo PaperDefineInfo_Get(Paper model)
        {
            try
            {
                using (IDbConnection conn = DbHelper.ResourceService())
                {
                    PaperDefineInfo pd = new PaperDefineInfo();
                    var             p  = new DynamicParameters();
                    p.Add("@PaperID", model.PaperID);

                    var multi = conn.QueryMultiple("PaperDefineInfo_Get", p, commandType: CommandType.StoredProcedure);
                    var paper = multi.Read <Paper>().Single();

                    var grouplist         = multi.Read <PaperGroup>().ToList();
                    var attachmentlist    = multi.Read <Attachment>().ToList();
                    var paperexerciselist = multi.Read <PaperExercise>().ToList();
                    var papertacticlist   = multi.Read <PaperTactic>().ToList();
                    pd.PaperID         = paper.PaperID;
                    pd.Type            = paper.Type;
                    pd.paper           = paper;
                    pd.papergrouplist  = grouplist;
                    pd.attachmentlist  = attachmentlist;
                    pd.exerciselist    = paperexerciselist;
                    pd.papertacticlist = papertacticlist;

                    return(pd);
                }
            }
            catch (Exception e)
            {
                return(null);
            }
        }
Пример #2
0
 /// <summary>
 /// 试卷结构添加,分组、分组的组卷策略,分组中的习题
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public static bool PaperDefineInfo_ADD(PaperDefineInfo model)
 {
     try
     {
         using (var conn = DbHelper.ResourceService())
         {
             return(true);
         }
     }
     catch (Exception e)
     {
         return(false);
     }
 }