コード例 #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <NoName.NetShop.Model.RoleModel> GetModelList(string strWhere)
        {
            DataSet ds = dal.GetList(strWhere);
            List <NoName.NetShop.Model.RoleModel> modelList = new List <NoName.NetShop.Model.RoleModel>();
            int rowsCount = ds.Tables[0].Rows.Count;

            if (rowsCount > 0)
            {
                NoName.NetShop.Model.RoleModel model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new NoName.NetShop.Model.RoleModel();
                    if (ds.Tables[0].Rows[n]["RoleId"].ToString() != "")
                    {
                        model.RoleId = int.Parse(ds.Tables[0].Rows[n]["RoleId"].ToString());
                    }
                    model.RoleName = ds.Tables[0].Rows[n]["RoleName"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
コード例 #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(NoName.NetShop.Model.RoleModel model)
 {
     dal.Update(model);
 }
コード例 #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(NoName.NetShop.Model.RoleModel model)
 {
     dal.Add(model);
 }
コード例 #4
0
 /// <summary>
 /// ��������б�
 /// </summary>
 public List<NoName.NetShop.Model.RoleModel> GetModelList(string strWhere)
 {
     DataSet ds = dal.GetList(strWhere);
     List<NoName.NetShop.Model.RoleModel> modelList = new List<NoName.NetShop.Model.RoleModel>();
     int rowsCount = ds.Tables[0].Rows.Count;
     if (rowsCount > 0)
     {
         NoName.NetShop.Model.RoleModel model;
         for (int n = 0; n < rowsCount; n++)
         {
             model = new NoName.NetShop.Model.RoleModel();
             if(ds.Tables[0].Rows[n]["RoleId"].ToString()!="")
             {
                 model.RoleId=int.Parse(ds.Tables[0].Rows[n]["RoleId"].ToString());
             }
             model.RoleName=ds.Tables[0].Rows[n]["RoleName"].ToString();
             modelList.Add(model);
         }
     }
     return modelList;
 }