Пример #1
0
 /// <summary>
 /// 下一页信息
 /// </summary>
 /// <param name="id">The id.</param>
 /// <param name="classname">The classname.</param>
 /// <returns>id,标题,时间</returns>
 public string PgDn(int id, string classname)
 {
     ROYcms.Sys.Model.ROYcms_news Model = dal.TopNews(" bh>" + id + " and classname='" + classname + "' order by bh desc ");
     if (Model != null)
     {
         return(Model.bh.ToString() + "," + Model.title + "," + Model.time);
     }
     else
     {
         return("");
     }
 }
Пример #2
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public int Update(ROYcms.Sys.Model.ROYcms_news model)
        {
            //
            //级联更新  删除以前的分类关联  新建一个分类关联
            //

            ROYcms.Sys.BLL.ROYcms_Class_News   ROYcms_Class_News_bll   = new ROYcms.Sys.BLL.ROYcms_Class_News();
            ROYcms.Sys.Model.ROYcms_Class_News ROYcms_Class_News_model = new ROYcms.Sys.Model.ROYcms_Class_News();
            ROYcms.Sys.BLL.ROYcms_class        ROYcms_Class_bll        = new ROYcms.Sys.BLL.ROYcms_class();
            ROYcms.Sys.Model.ROYcms_class      ROYcms_Class_model      = ROYcms_Class_bll._GetModel(model.classname.ToString());

            //删除
            ROYcms_Class_News_bll.Delete(" (news_id=" + model.bh + ") AND (Class=" + GetClassName(model.bh) + ") ");
            //添加
            ROYcms_Class_News_model.news_id    = model.bh;
            ROYcms_Class_News_model.Class      = Convert.ToInt32(model.classname);
            ROYcms_Class_News_model.class_id   = ROYcms_Class_model.ClassId;
            ROYcms_Class_News_model.class_list = ROYcms_Class_model.ClassList;
            ROYcms_Class_News_model.Time       = DateTime.Now;
            ROYcms_Class_News_model.GUID       = model.GUID;
            ROYcms_Class_News_bll.Add(ROYcms_Class_News_model);

            return(dal.Update(model));
        }
Пример #3
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(ROYcms.Sys.Model.ROYcms_news model)
        {
            int news_id = dal.Add(model);

            //
            //级联添加
            //
            if (news_id != 1)
            {
                ROYcms.Sys.BLL.ROYcms_Class_News   ROYcms_Class_News_bll   = new ROYcms.Sys.BLL.ROYcms_Class_News();
                ROYcms.Sys.Model.ROYcms_Class_News ROYcms_Class_News_model = new ROYcms.Sys.Model.ROYcms_Class_News();
                ROYcms.Sys.BLL.ROYcms_class        ROYcms_Class_bll        = new ROYcms.Sys.BLL.ROYcms_class();
                ROYcms.Sys.Model.ROYcms_class      ROYcms_Class_model      = ROYcms_Class_bll._GetModel(model.classname.ToString());

                ROYcms_Class_News_model.news_id    = news_id;
                ROYcms_Class_News_model.Class      = Convert.ToInt32(model.classname);
                ROYcms_Class_News_model.class_id   = ROYcms_Class_model.ClassId;
                ROYcms_Class_News_model.class_list = ROYcms_Class_model.ClassList;
                ROYcms_Class_News_model.Time       = DateTime.Now;
                ROYcms_Class_News_model.GUID       = model.GUID;
                ROYcms_Class_News_bll.Add(ROYcms_Class_News_model);
            }
            return(news_id);
        }