Exemple #1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public List <EntityModelAccess> GetModelAccesses()
        {
            List <EntityModelAccess> data = null;
            SqlHelper svc = new SqlHelper(EnumBiz.onlineDB);
            string    Sql = string.Empty;

            Sql = @"select a.modelId,
                           a.modelName
                      from modelAccess a ";
            DataTable dt = svc.GetDataTable(Sql);

            if (dt != null && dt.Rows.Count > 0)
            {
                data = new List <EntityModelAccess>();
                EntityModelAccess vo = null;
                foreach (DataRow dr in dt.Rows)
                {
                    vo           = new EntityModelAccess();
                    vo.modelId   = Function.Int(dr["modelId"]);
                    vo.modelName = dr["modelName"].ToString();
                    data.Add(vo);
                }
            }
            return(data);
        }
Exemple #2
0
        /// <summary>
        /// 疾病模型
        /// </summary>
        /// <param name="parms"></param>
        /// <returns></returns>
        public List <EntityModelAccess> GetModelAccess()
        {
            List <EntityModelAccess> data = null;
            SqlHelper svc = new SqlHelper(EnumBiz.onlineDB);
            string    sql = @"select modelId,
                                  modelName ,
                                  modelIntro ,
                                  modelExplan ,
                                  modelAdvice ,
                                  lowDanger ,
                                  minAge ,
                                  maxAge ,
                                  modelSex ,
                                  isNeedQuestion from modelAccess ";
            DataTable dt  = svc.GetDataTable(sql);

            if (dt != null && dt.Rows.Count > 0)
            {
                data = new List <EntityModelAccess>();
                EntityModelAccess vo = null;
                foreach (DataRow dr in dt.Rows)
                {
                    vo             = new EntityModelAccess();
                    vo.modelId     = Function.Int(dr["modelId"]);
                    vo.modelName   = dr["modelName"].ToString();
                    vo.modelIntro  = dr["modelIntro"].ToString();
                    vo.modelExplan = dr["modelExplan"].ToString();
                    vo.modelAdvice = dr["modelAdvice"].ToString();
                    vo.lowDanger   = Function.Dec(dr["lowDanger"]);
                    vo.minAge      = Function.Dec(dr["minAge"]);
                    vo.maxAge      = Function.Dec(dr["maxAge"]);
                    vo.modelSex    = Function.Dec(dr["modelSex"]);
                    data.Add(vo);
                }
            }

            return(data);
        }