Ejemplo n.º 1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <GSSModel.PubNotice> DataTableToList(DataTable dt)
        {
            List <GSSModel.PubNotice> modelList = new List <GSSModel.PubNotice>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                GSSModel.PubNotice model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new GSSModel.PubNotice();
                    if (dt.Rows[n]["F_ID"].ToString() != "")
                    {
                        model.F_ID = int.Parse(dt.Rows[n]["F_ID"].ToString());
                    }
                    model.F_Title = dt.Rows[n]["F_Title"].ToString();
                    model.F_Note  = dt.Rows[n]["F_Note"].ToString();
                    if (dt.Rows[n]["F_DateTime"].ToString() != "")
                    {
                        model.F_DateTime = DateTime.Parse(dt.Rows[n]["F_DateTime"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(GSSModel.PubNotice model)
 {
     return(dal.Update(model));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(GSSModel.PubNotice model)
 {
     return(dal.Add(model));
 }