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

            if (rowsCount > 0)
            {
                Maticsoft.Model.FuWuInfo model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Maticsoft.Model.FuWuInfo();
                    if (dt.Rows[n]["fuwuID"].ToString() != "")
                    {
                        model.fuwuID = int.Parse(dt.Rows[n]["fuwuID"].ToString());
                    }
                    model.fuwuTitle = dt.Rows[n]["fuwuTitle"].ToString();
                    if (dt.Rows[n]["Fatime"].ToString() != "")
                    {
                        model.Fatime = DateTime.Parse(dt.Rows[n]["Fatime"].ToString());
                    }
                    model.ImageURL = dt.Rows[n]["ImageURL"].ToString();
                    if (dt.Rows[n]["FuwuTypeID"].ToString() != "")
                    {
                        model.FuwuTypeID = int.Parse(dt.Rows[n]["FuwuTypeID"].ToString());
                    }
                    model.Write       = dt.Rows[n]["Write"].ToString();
                    model.Fuwucontent = dt.Rows[n]["Fuwucontent"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemple #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Maticsoft.Model.FuWuInfo model)
 {
     return(dal.Update(model));
 }
Exemple #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(Maticsoft.Model.FuWuInfo model)
 {
     return(dal.Add(model));
 }