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

            if (rowsCount > 0)
            {
                Maticsoft.Model.ComPanyInfo model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Maticsoft.Model.ComPanyInfo();
                    if (dt.Rows[n]["XianshiID"].ToString() != "")
                    {
                        model.XianshiID = int.Parse(dt.Rows[n]["XianshiID"].ToString());
                    }
                    model.Gonggao = dt.Rows[n]["Gonggao"].ToString();
                    if (dt.Rows[n]["GongTime"].ToString() != "")
                    {
                        model.GongTime = DateTime.Parse(dt.Rows[n]["GongTime"].ToString());
                    }
                    model.ImageURL = dt.Rows[n]["ImageURL"].ToString();
                    if (dt.Rows[n]["FenleiID"].ToString() != "")
                    {
                        model.FenleiID = int.Parse(dt.Rows[n]["FenleiID"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Example #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Maticsoft.Model.ComPanyInfo model)
 {
     return(dal.Update(model));
 }
Example #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(Maticsoft.Model.ComPanyInfo model)
 {
     return(dal.Add(model));
 }