Ejemplo n.º 1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <Dianda.Model.GUESTBOOK_MAIN> GetModelList(string strWhere)
        {
            DataSet ds = dal.GetList(strWhere);
            List <Dianda.Model.GUESTBOOK_MAIN> modelList = new List <Dianda.Model.GUESTBOOK_MAIN>();
            int rowsCount = ds.Tables[0].Rows.Count;

            if (rowsCount > 0)
            {
                Dianda.Model.GUESTBOOK_MAIN model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model             = new Dianda.Model.GUESTBOOK_MAIN();
                    model.ID          = ds.Tables[0].Rows[n]["ID"].ToString();
                    model.TITLES      = ds.Tables[0].Rows[n]["TITLES"].ToString();
                    model.CLASSID     = ds.Tables[0].Rows[n]["CLASSID"].ToString();
                    model.CONTENTS    = ds.Tables[0].Rows[n]["CONTENTS"].ToString();
                    model.RE_CONTENTS = ds.Tables[0].Rows[n]["RE_CONTENTS"].ToString();
                    if (ds.Tables[0].Rows[n]["STATUS"].ToString() != "")
                    {
                        model.STATUS = int.Parse(ds.Tables[0].Rows[n]["STATUS"].ToString());
                    }
                    model.WRITER = ds.Tables[0].Rows[n]["WRITER"].ToString();
                    if (ds.Tables[0].Rows[n]["DATETIME"].ToString() != "")
                    {
                        model.DATETIME = DateTime.Parse(ds.Tables[0].Rows[n]["DATETIME"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["RE_DATETIME"].ToString() != "")
                    {
                        model.RE_DATETIME = DateTime.Parse(ds.Tables[0].Rows[n]["RE_DATETIME"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["DELFLAG"].ToString() != "")
                    {
                        model.DELFLAG = int.Parse(ds.Tables[0].Rows[n]["DELFLAG"].ToString());
                    }
                    model.COURSEID = ds.Tables[0].Rows[n]["COURSEID"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(Dianda.Model.GUESTBOOK_MAIN model)
 {
     dal.Update(model);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(Dianda.Model.GUESTBOOK_MAIN model)
 {
     dal.Add(model);
 }