Ejemplo n.º 1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <NoName.NetShop.Model.UserInRoleModel> GetModelList(string strWhere)
        {
            DataSet ds = dal.GetList(strWhere);
            List <NoName.NetShop.Model.UserInRoleModel> modelList = new List <NoName.NetShop.Model.UserInRoleModel>();
            int rowsCount = ds.Tables[0].Rows.Count;

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