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

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

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


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