Пример #1
0
        public ActionResult Edit(AnnouncementConfig model)
        {
            model.CreatedUser = HttpContext.User.Identity.Name;
            string js = "<script>alert(\"保存失败 \");location='/AnnouncementConfig/Index';</script>";

            if (model.PKID != 0)
            {
                if (AnnouncementConfigManager.UpdateAnnouncementConfig(model))
                {
                    return(RedirectToAction("Index"));
                }
                else
                {
                    return(Content(js));
                }
            }
            else
            {
                if (model.NoticeType == 0)
                {
                    js = "<script>alert(\"请选择类型 \");location='/AnnouncementConfig/Index';</script>";
                    return(Content(js));
                }
                if (AnnouncementConfigManager.InsertAnnouncementConfig(model))
                {
                    return(RedirectToAction("Index"));
                }
                else
                {
                    return(Content(js));
                }
            }
        }
    static int ReadConfig(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 1);
        AnnouncementConfig obj = (AnnouncementConfig)LuaScriptMgr.GetNetObjectSelf(L, 1, "AnnouncementConfig");

        obj.ReadConfig();
        return(0);
    }
    static int GetOpenItem(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 1);
        AnnouncementConfig obj = (AnnouncementConfig)LuaScriptMgr.GetNetObjectSelf(L, 1, "AnnouncementConfig");
        AnnouncementItem   o   = obj.GetOpenItem();

        LuaScriptMgr.PushObject(L, o);
        return(1);
    }
Пример #4
0
 public ActionResult Edit(int id = 0)
 {
     if (id == 0)
     {
         AnnouncementConfig model = new AnnouncementConfig();
         return(View(model));
     }
     else
     {
         return(View(AnnouncementConfigManager.GetAnnouncementConfig(id)));
     }
 }
Пример #5
0
        public ActionResult List(int pageIndex = 1, int pageSize = 20)
        {
            int                count  = 0;
            string             strSql = string.Empty;
            AnnouncementConfig model  = new AnnouncementConfig();

            List <AnnouncementConfig> lists = AnnouncementConfigManager.GetAnnouncementConfigList(model, pageSize, pageIndex, out count);

            var list  = new OutData <List <AnnouncementConfig>, int>(lists, count);
            var pager = new PagerModel(pageIndex, pageSize)
            {
                TotalItem = count
            };

            return(View(new ListModel <AnnouncementConfig>(list.ReturnValue, pager)));
        }
        public static bool UpdateAnnouncementConfig(AnnouncementConfig model)
        {
            const string sql          = @"UPDATE [BaoYang].[dbo].[BaoYangNotice] SET                                      
                                           [Content]=@Content  
                                          ,[ImageUrl]=@ImageUrl                                                                     
                                          ,[IsDeleted]=@IsDeleted
                                          ,[CreateTime]=GETDATE()
                                          ,[CreatedUser]=@CreatedUser
                                          ,[H5Url]=@H5Url
                                          ,[IOSProcessValue]=@IOSProcessValue
                                          ,[AndroidProcessValue]=@AndroidProcessValue
                                          ,[IOSCommunicationValue]=@IOSCommunicationValue
                                          ,[AndroidCommunicationValue]=@AndroidCommunicationValue
	                                      ,Status=@Status
                                WHERE PKID=@Id";
            var          sqlParameter = new SqlParameter[]
            {
                new SqlParameter("@AndroidCommunicationValue", model.AndroidCommunicationValue ?? string.Empty),
                new SqlParameter("@AndroidProcessValue", model.AndroidProcessValue ?? string.Empty),
                new SqlParameter("@Content", model.Content ?? string.Empty),
                new SqlParameter("@CreatedUser", model.CreatedUser ?? string.Empty),
                new SqlParameter("@H5Url", model.H5Url ?? string.Empty),
                new SqlParameter("@ImageUrl", model.ImageUrl ?? string.Empty),
                new SqlParameter("@IOSCommunicationValue", model.IOSCommunicationValue),
                new SqlParameter("@IOSProcessValue", model.IOSProcessValue),
                new SqlParameter("@IsDeleted", model.IsDeleted),
                new SqlParameter("@NoticeType", model.NoticeType),
                new SqlParameter("@Status", model.Status),
                new SqlParameter("@Id", model.PKID)
            };

            try
            {
                if (model.Status)
                {
                    UpdateStatus(model.PKID);
                }

                SqlHelper.ExecuteNonQuery(conn, CommandType.Text, sql, sqlParameter);

                return(true);
            }
            catch
            {
                return(true);
            }
        }
Пример #7
0
 public List <AnnouncementConfig> GetAnnouncementConfigList(AnnouncementConfig model, int pageSize, int pageIndex, out int recordCount)
 {
     try
     {
         return(DALAnnouncementConfig.GetAnnouncementConfigList(model, pageSize, pageIndex, out recordCount));
     }
     catch (TuhuBizException)
     {
         throw;
     }
     catch (Exception ex)
     {
         var exception = new AnnouncementConfigException(1, "GetAnnouncementConfigList", ex);
         Logger.Log(Level.Error, exception, "GetAnnouncementConfigList1");
         throw ex;
     }
 }
    static int _CreateAnnouncementConfig(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

        if (count == 0)
        {
            AnnouncementConfig obj = new AnnouncementConfig();
            LuaScriptMgr.PushObject(L, obj);
            return(1);
        }
        else
        {
            LuaDLL.luaL_error(L, "invalid arguments to method: AnnouncementConfig.New");
        }

        return(0);
    }
Пример #9
0
 public bool InsertAnnouncementConfig(AnnouncementConfig model)
 {
     try
     {
         using (var client = new CacheClient())
         {
             var result = client.UpdateBaoYangNoticeSetting();
         }
         return(DALAnnouncementConfig.InsertAnnouncementConfig(model));
     }
     catch (TuhuBizException)
     {
         throw;
     }
     catch (Exception ex)
     {
         var exception = new AnnouncementConfigException(1, "InsertAnnouncementConfig", ex);
         Logger.Log(Level.Error, exception, "InsertAnnouncementConfig");
         throw ex;
     }
 }
        public static List <AnnouncementConfig> GetAnnouncementConfigList(AnnouncementConfig model, int pageSize, int pageIndex, out int recordCount)
        {
            string sql      = @"
                            SELECT  *
                            FROM    ( SELECT   ROW_NUMBER() OVER ( ORDER BY CreateTime DESC ) AS ROWNUMBER ,
                                              [PKID]
                                              ,[Content]     
                                              ,[ImageUrl]
                                              ,[NoticeType]                                           
                                              ,[IsDeleted]
                                              ,[CreateTime]
                                              ,[CreatedUser]
                                              ,[H5Url]
                                              ,[IOSProcessValue]
                                              ,[AndroidProcessValue]
                                              ,[IOSCommunicationValue]
                                              ,[AndroidCommunicationValue]
	                                          ,Status
                                      FROM   [BaoYang].[dbo].[BaoYangNotice] WITH ( NOLOCK )   
                                      WHERE   IsDeleted=0                                
                                    ) AS PG
                            WHERE   PG.ROWNUMBER BETWEEN STR(( @PageIndex - 1 ) * @PageSize + 1)
                                                 AND     STR(@PageIndex * @PageSize)
                            ";
            string sqlCount = @"SELECT COUNT(1) FROM [BaoYang].[dbo].[BaoYangNotice] WITH (NOLOCK) WHERE IsDeleted=0 ";

            var sqlParameters = new SqlParameter[]
            {
                new SqlParameter("@PageSize", pageSize),
                new SqlParameter("@PageIndex", pageIndex)
            };

            recordCount = (int)SqlHelper.ExecuteScalar(connOnRead, CommandType.Text, sqlCount, sqlParameters);

            return(SqlHelper.ExecuteDataTable(connOnRead, CommandType.Text, sql, sqlParameters).ConvertTo <AnnouncementConfig>().ToList());
        }
Пример #11
0
    public void LoadConfig()
    {
        AnnouncementConfigData = new AnnouncementConfig();
        BadgeAttrConfigData    = new BadgeAttrConfig();
        ConstStringConfigData  = new ConstStringConfig();
        CommonConfig           = new CommonConfig();

        AttrNameConfigData        = new AttrNameConfig();
        RoleBaseConfigData2       = new BaseDataConfig2();
        AttrDataConfigData        = new AttrDataConfig();
        TeamLevelConfigData       = new TeamLevelConfig();
        RoleLevelConfigData       = new RoleLevelConfig();
        NPCConfigData             = new NPCDataConfig();
        SkillConfig               = new SkillConfig();
        GoodsConfigData           = new GoodsConfig();
        StoreGoodsConfigData      = new StoreGoodsConfig();
        BaseDataBuyConfigData     = new BaseDataBuyConfig();
        TaskConfigData            = new TaskDataConfig();
        AwardPackConfigData       = new AwardPackDataConfig();
        PractiseConfig            = new PractiseConfig();
        PracticePveConfig         = new PracticePveConfig();
        PractiseStepConfig        = new PractiseStepConfig();
        GameModeConfig            = new GameModeConfig();
        TrainingConfig            = new TrainingConfig();
        TattooConfig              = new TattooConfig();
        EquipmentConfigData       = new EquipmentConfig();
        TourConfig                = new TourConfig();
        GuideConfig               = new GuideConfig();
        FunctionConditionConfig   = new FunctionConditionConfig();
        RoleShapeConfig           = new RoleShapeConfig();
        FashionConfig             = new FashionConfig();
        FashionShopConfig         = new FashionShopConfig();
        VipPrivilegeConfig        = new VipPrivilegeConfig();
        pushConfig                = new PushConfig();
        presentHpConfigData       = new PresentHpConfig();
        LotteryConfig             = new LotteryConfig();
        starAttrConfig            = new StarAttrConfig();
        qualityAttrCorConfig      = new QualityAttrCorConfig();
        skillUpConfig             = new SkillUpConfig();
        RankConfig                = new RankConfig();
        signConfig                = new SignConfig();
        NewComerSignConfig        = new NewComerSignConfig();
        FightingCapacityConfig    = new FightingCapacityConfig();
        BodyInfoListConfig        = new BodyInfoListConfig();
        BadgeSlotsConfig          = new BadgeSlotConfig();
        GoodsComposeNewConfigData = new GoodsComposeNewConfig();

        SceneConfig = new SceneConfig();

        ReboundAttrConfigData    = new ReboundAttrConfig();
        CareerConfigData         = new CareerConfig();
        PotientialEffectConfig   = new PotientialEffectConfig();
        PVPPointConfig           = new PVPPointConfig();
        WinningStreakAwardConfig = new WinningStreakAwardConfig();
        ArticleStrengthConfig    = new ArticleStrengthConfig();
        PhRegainConfig           = new PhRegainConfig();
        MatchAchievementConfig   = new MatchAchievementConfig();
        SpecialActionConfig      = new SpecialActionConfig();
        StealConfig           = new StealConfig();
        CurveRateConfig       = new CurveRateConfig();
        DunkRateConfig        = new DunkRateConfig();
        AIConfig              = new AIConfig();
        AttrReduceConfig      = new AttrReduceConfig();
        qualifyingConfig      = new QualifyingConfig();
        qualifyingNewConfig   = new QualifyingNewConfig();
        qualifyingNewerConfig = new QualifyingNewerConfig();
        bullFightConfig       = new BullFightConfig();
        HedgingConfig         = new HedgingConfig();
        roleGiftConfig        = new RoleGiftConfig();
        DebugConfig           = new DebugConfig();
        shootGameConfig       = new ShootGameConfig();
        MapConfig             = new MapConfig();
        activityConfig        = new ActivityConfig();
        trialConfig           = new TrialConfig();
        gameMatchConfig       = new GameMatchConfig();
        shootSolutionManager  = new ShootSolutionManager();
        talentConfig          = new TalentConfig();
        ladderConfig          = new LadderConfig();
        matchSoundConfig      = new MatchSoundConfig();
        matchMsgConfig        = new MatchMsgConfig();
        MatchPointsConfig     = new MatchPointsConfig();
        AnimationSampleManager.Instance.LoadXml();
    }
        public static bool InsertAnnouncementConfig(AnnouncementConfig model)
        {
            const string sql = @"  INSERT INTO [BaoYang].[dbo].[BaoYangNotice]
                                          ( 
                                           [Content]     
                                          ,[ImageUrl]
                                          ,[NoticeType]                                       
                                          ,[IsDeleted]
                                          ,[CreateTime]
                                          ,[CreatedUser]
                                          ,[H5Url]
                                          ,[IOSProcessValue]
                                          ,[AndroidProcessValue]
                                          ,[IOSCommunicationValue]
                                          ,[AndroidCommunicationValue]
	                                      ,Status
                                          )
                                  VALUES(  
                                           @Content
                                          ,@ImageUrl                                        
                                          ,@NoticeType                                       
                                          ,@IsDeleted
                                          ,GETDATE()
                                          ,@CreatedUser
                                          ,@H5Url
                                          ,@IOSProcessValue
                                          ,@AndroidProcessValue
                                          ,@IOSCommunicationValue
                                          ,@AndroidCommunicationValue
	                                      ,@Status
                                          )SELECT @@IDENTITY";

            var sqlParameter = new SqlParameter[]
            {
                new SqlParameter("@AndroidCommunicationValue", model.AndroidCommunicationValue ?? string.Empty),
                new SqlParameter("@AndroidProcessValue", model.AndroidProcessValue ?? string.Empty),
                new SqlParameter("@Content", model.Content ?? string.Empty),
                new SqlParameter("@CreatedUser", model.CreatedUser ?? string.Empty),
                new SqlParameter("@H5Url", model.H5Url ?? string.Empty),
                new SqlParameter("@ImageUrl", model.ImageUrl ?? string.Empty),
                new SqlParameter("@IOSCommunicationValue", model.IOSCommunicationValue),
                new SqlParameter("@IOSProcessValue", model.IOSProcessValue),
                new SqlParameter("@IsDeleted", model.IsDeleted),
                new SqlParameter("@NoticeType", model.NoticeType),
                new SqlParameter("@Status", model.Status)
            };

            try
            {
                int newid = Convert.ToInt32(SqlHelper.ExecuteScalar(conn, CommandType.Text, sql, sqlParameter));
                if (newid > 0)
                {
                    if (model.Status)
                    {
                        UpdateStatus(newid);
                    }

                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch
            {
                return(false);
            }
        }