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

            if (rowsCount > 0)
            {
                Maticsoft.Model.JiShuInfo model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Maticsoft.Model.JiShuInfo();
                    if (dt.Rows[n]["JishuID"].ToString() != "")
                    {
                        model.JishuID = int.Parse(dt.Rows[n]["JishuID"].ToString());
                    }
                    model.JishuTitle = dt.Rows[n]["JishuTitle"].ToString();
                    model.JishuNum   = dt.Rows[n]["JishuNum"].ToString();
                    if (dt.Rows[n]["Fatime"].ToString() != "")
                    {
                        model.Fatime = DateTime.Parse(dt.Rows[n]["Fatime"].ToString());
                    }
                    model.jishuType    = dt.Rows[n]["jishuType"].ToString();
                    model.ImageURL     = dt.Rows[n]["ImageURL"].ToString();
                    model.JishuPath    = dt.Rows[n]["JishuPath"].ToString();
                    model.Jishucontent = dt.Rows[n]["Jishucontent"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Пример #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Maticsoft.Model.JiShuInfo model)
 {
     return(dal.Update(model));
 }
Пример #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(Maticsoft.Model.JiShuInfo model)
 {
     return(dal.Add(model));
 }