Пример #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <NoName.NetShop.Model.RuleModel> GetModelList(string strWhere)
        {
            DataSet ds = dal.GetList(strWhere);
            List <NoName.NetShop.Model.RuleModel> modelList = new List <NoName.NetShop.Model.RuleModel>();
            int rowsCount = ds.Tables[0].Rows.Count;

            if (rowsCount > 0)
            {
                NoName.NetShop.Model.RuleModel model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new NoName.NetShop.Model.RuleModel();
                    if (ds.Tables[0].Rows[n]["SchemeId"].ToString() != "")
                    {
                        model.SchemeId = int.Parse(ds.Tables[0].Rows[n]["SchemeId"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["CateId"].ToString() != "")
                    {
                        model.CateId = int.Parse(ds.Tables[0].Rows[n]["CateId"].ToString());
                    }
                    model.Rule = ds.Tables[0].Rows[n]["Rule"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Пример #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(NoName.NetShop.Model.RuleModel model)
 {
     dal.Update(model);
 }
Пример #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(NoName.NetShop.Model.RuleModel model)
 {
     dal.Add(model);
 }
 /// <summary>
 /// ��������б�
 /// </summary>
 public List<NoName.NetShop.Model.RuleModel> GetModelList(string strWhere)
 {
     DataSet ds = dal.GetList(strWhere);
     List<NoName.NetShop.Model.RuleModel> modelList = new List<NoName.NetShop.Model.RuleModel>();
     int rowsCount = ds.Tables[0].Rows.Count;
     if (rowsCount > 0)
     {
         NoName.NetShop.Model.RuleModel model;
         for (int n = 0; n < rowsCount; n++)
         {
             model = new NoName.NetShop.Model.RuleModel();
             if(ds.Tables[0].Rows[n]["SchemeId"].ToString()!="")
             {
                 model.SchemeId=int.Parse(ds.Tables[0].Rows[n]["SchemeId"].ToString());
             }
             if(ds.Tables[0].Rows[n]["CateId"].ToString()!="")
             {
                 model.CateId=int.Parse(ds.Tables[0].Rows[n]["CateId"].ToString());
             }
             model.Rule=ds.Tables[0].Rows[n]["Rule"].ToString();
             modelList.Add(model);
         }
     }
     return modelList;
 }