Example #1
0
        /// <summary>
        /// 删除一条数据
        /// </summary>
        public void Delete(int bh)
        {
            dal.Delete(bh);

            //级联删除分类关联
            ROYcms.Sys.BLL.ROYcms_Class_News ROYcms_Class_News_bll = new ROYcms.Sys.BLL.ROYcms_Class_News();
            //删除
            ROYcms_Class_News_bll.Delete(" news_id=" + bh);
        }
Example #2
0
        /// <summary>
        /// 删除一个菜单项
        /// </summary>
        /// <param name="ClassId"></param>
        /// <returns></returns>
        public bool DelByClassId(string ClassId)
        {
            //级联删除分类关联
            ROYcms.Sys.BLL.ROYcms_Class_News ROYcms_Class_News_bll = new ROYcms.Sys.BLL.ROYcms_Class_News();
            //删除
            ROYcms_Class_News_bll.Delete(" class_id='" + ClassId + "'");

            //级联删除新闻
            ROYcms.Sys.BLL.ROYcms_news ROYcms_news_bll = new ROYcms.Sys.BLL.ROYcms_news();
            ROYcms_news_bll.Delete(" classname=" + GetIdForClassId(ClassId));
            //级联删除智能表单模型关联
            ROYcms.Sys.BLL.ROYcms_Class_Model ROYcms_Class_Model_bll = new ROYcms.Sys.BLL.ROYcms_Class_Model();
            ROYcms_Class_Model_bll.CidDelete(GetIdForClassId(ClassId));

            bool err = dal.DelByClassId(ClassId);

            return(err);
        }
Example #3
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public void Update(ROYcms.Sys.Model.ROYcms_product model)
        {
            //
            //级联更新  删除以前的分类关联  新建一个分类关联
            //

            ROYcms.Sys.BLL.ROYcms_Class_News   ROYcms_Class_product_bll   = new ROYcms.Sys.BLL.ROYcms_Class_News();
            ROYcms.Sys.Model.ROYcms_Class_News ROYcms_Class_product_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_product_bll.Delete(" (news_id=" + model.bh + ") AND (Class=" + GetClassName(model.bh) + ") ");
            //添加
            ROYcms_Class_product_model.news_id    = model.bh;
            ROYcms_Class_product_model.Class      = Convert.ToInt32(model.classname);
            ROYcms_Class_product_model.class_id   = ROYcms_Class_model.ClassId;
            ROYcms_Class_product_model.class_list = ROYcms_Class_model.ClassList;
            ROYcms_Class_product_model.Time       = DateTime.Now;
            ROYcms_Class_product_model.GUID       = model.GUID;
            ROYcms_Class_product_bll.Add(ROYcms_Class_product_model);

            dal.Update(model);
        }