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

            if (rowsCount > 0)
            {
                TSM.Model.pms_WorkContent model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new TSM.Model.pms_WorkContent();
                    if (dt.Rows[n]["WorkContentID"].ToString() != "")
                    {
                        model.WorkContentID = int.Parse(dt.Rows[n]["WorkContentID"].ToString());
                    }
                    model.WorkContent = dt.Rows[n]["WorkContent"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
示例#2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(TSM.Model.pms_WorkContent model)
 {
     dal.Update(model);
 }
示例#3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(TSM.Model.pms_WorkContent model)
 {
     return(dal.Add(model));
 }