Esempio n. 1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<DTcms.Model.StoreDomain> DataTableToList(DataTable dt)
        {
            List<DTcms.Model.StoreDomain> modelList = new List<DTcms.Model.StoreDomain>();
            int rowsCount = dt.Rows.Count;
            if (rowsCount > 0)
            {
                DTcms.Model.StoreDomain model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new DTcms.Model.StoreDomain();
                    if (dt.Rows[n]["Id"].ToString() != "")
                    {
                        model.Id = int.Parse(dt.Rows[n]["Id"].ToString());
                    }
                    model.Name = dt.Rows[n]["Name"].ToString();
                    model.Remark = dt.Rows[n]["Remark"].ToString();

                    modelList.Add(model);
                }
            }
            return modelList;
        }
Esempio n. 2
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <DTcms.Model.StoreDomain> DataTableToList(DataTable dt)
        {
            List <DTcms.Model.StoreDomain> modelList = new List <DTcms.Model.StoreDomain>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                DTcms.Model.StoreDomain model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new DTcms.Model.StoreDomain();
                    if (dt.Rows[n]["Id"].ToString() != "")
                    {
                        model.Id = int.Parse(dt.Rows[n]["Id"].ToString());
                    }
                    model.Name   = dt.Rows[n]["Name"].ToString();
                    model.Remark = dt.Rows[n]["Remark"].ToString();


                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Esempio n. 3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(DTcms.Model.StoreDomain model)
 {
     return(dal.Update(model));
 }
Esempio n. 4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(DTcms.Model.StoreDomain model)
 {
     return(dal.Add(model));
 }