Beispiel #1
0
        /// <summary>
        ///     新建全品类标签
        /// </summary>
        public bool AddTagConfig(SqlConnection connection, AllSortTagConfig model)
        {
            var sql = @"INSERT INTO Configuration.dbo.AllSortTagConfig
        ( CreateDateTime ,
          UpdateDateTime ,
          Maintitle,
          Subtitle , 
          SubtitleColor , 
          ChannelJumpUrl ,
          XiaoChannelJumpUrl,
          ChannelState ,
          [Statistics] , 
          State , 
          ParentId ,
          ChannelDescription 
         )
VALUES  ( GETDATE() , -- CreateDateTime - datetime
          GETDATE() , -- UpdateDateTime - datetime
          @Maintitle, -- Maintitle - varchar(100)
          @Subtitle , -- Subtitle - varchar(100)
          @SubtitleColor , -- SubtitleColor - varchar(50)
          @ChannelJumpUrl , -- ChannelJumpUrl - varchar(1000)
          @XiaoChannelJumpUrl , -- XiaoChannelJumpUrl - varchar(1000)
          @ChannelState , -- ChannelState - int
          @Statistics , -- [Statistics] - varchar(50)
          @State , -- State - int
          @ParentId , -- ParentId - int
          @ChannelDescription  -- ChannelDescription - varchar(1000)
         )";

            return(connection.Execute(sql, model) > 0);
        }
Beispiel #2
0
        /// <summary>
        ///     修改全品类标签
        /// </summary>
        public bool UpdateTagConfig(AllSortTagConfig model)
        {
            var dal = new DalSort();

            using (var connection = ProcessConnection.OpenGungnir)
            {
                return(dal.UpdateTagEntity(connection, model));
            }
        }
Beispiel #3
0
        /// <summary>
        ///     修改全品类标签
        /// </summary>
        public bool UpdateTagEntity(SqlConnection connection, AllSortTagConfig model)
        {
            var sql = @"UPDATE Configuration.dbo.AllSortTagConfig SET 
          Maintitle=@Maintitle,
          Subtitle=@Subtitle , 
          SubtitleColor=@SubtitleColor , 
          ChannelJumpUrl=@ChannelJumpUrl  ,
          XiaoChannelJumpUrl=@XiaoChannelJumpUrl  ,
          ChannelState=@ChannelState  ,
         [Statistics]=@Statistics , 
          State=@State  , 
          ParentId=@ParentId  ,
          ChannelDescription=@ChannelDescription ,
          UpdateDateTime=GetDate()  
          WHERE PKID=@PKID";

            return(connection.Execute(sql, model) > 0);
        }
Beispiel #4
0
        /// <summary>
        /// 保存标签栏的新增或修改操作
        /// </summary>
        public ActionResult ConfigTagSave(AllSortTagConfig model)
        {
            AllSortManager manger = new AllSortManager();

            if (model.PKID == 0)
            {
                if (manger.AddTagConfig(model))
                {
                    LoggerManager.InsertOplog(new ConfigHistory()
                    {
                        AfterValue = JsonConvert.SerializeObject(model), Author = User.Identity.Name, BeforeValue = "", ChangeDatetime = DateTime.Now, ObjectID = model.PKID.ToString(), ObjectType = "SortTag", Operation = "新增标签栏配置" + model.Maintitle
                    });
                    return(Json(1));
                }
                else
                {
                    return(Json(0));
                }
            }
            else
            {
                var title  = "";
                var before = manger.GetTagEntity(model.PKID, title);
                if (manger.UpdateTagConfig(model))
                {
                    LoggerManager.InsertOplog(new ConfigHistory()
                    {
                        AfterValue = JsonConvert.SerializeObject(model), Author = User.Identity.Name, BeforeValue = JsonConvert.SerializeObject(before), ChangeDatetime = DateTime.Now, ObjectID = model.PKID.ToString(), ObjectType = "SortTag", Operation = "编辑标签栏配置" + model.Maintitle
                    });
                    return(Json(1));
                }
                else
                {
                    return(Json(0));
                }
            }
        }