예제 #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <LPWeb.Model.GroupUsers> DataTableToList(DataTable dt)
        {
            List <LPWeb.Model.GroupUsers> modelList = new List <LPWeb.Model.GroupUsers>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                LPWeb.Model.GroupUsers model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new LPWeb.Model.GroupUsers();
                    if (dt.Rows[n]["GroupId"].ToString() != "")
                    {
                        model.GroupId = int.Parse(dt.Rows[n]["GroupId"].ToString());
                    }
                    if (dt.Rows[n]["UserId"].ToString() != "")
                    {
                        model.UserId = int.Parse(dt.Rows[n]["UserId"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
예제 #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(LPWeb.Model.GroupUsers model)
 {
     dal.Update(model);
 }
예제 #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(LPWeb.Model.GroupUsers model)
 {
     dal.Add(model);
 }