Esempio n. 1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <Dianda.Model.USER_Groups> DataTableToList(DataTable dt)
        {
            List <Dianda.Model.USER_Groups> modelList = new List <Dianda.Model.USER_Groups>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                Dianda.Model.USER_Groups model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model          = new Dianda.Model.USER_Groups();
                    model.ID       = dt.Rows[n]["ID"].ToString();
                    model.NAME     = dt.Rows[n]["NAME"].ToString();
                    model.CONTENTS = dt.Rows[n]["CONTENTS"].ToString();
                    model.ROLE     = dt.Rows[n]["ROLE"].ToString();
                    if (dt.Rows[n]["DELFLAG"].ToString() != "")
                    {
                        model.DELFLAG = int.Parse(dt.Rows[n]["DELFLAG"].ToString());
                    }
                    if (dt.Rows[n]["ISMOREN"].ToString() != "")
                    {
                        model.ISMOREN = int.Parse(dt.Rows[n]["ISMOREN"].ToString());
                    }
                    model.TAGS = dt.Rows[n]["TAGS"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Esempio n. 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(Dianda.Model.USER_Groups model)
 {
     dal.Update(model);
 }
Esempio n. 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(Dianda.Model.USER_Groups model)
 {
     dal.Add(model);
 }