public static string GetNextCityBattleTime()
        {
            string unKown = GLang.GetLang(43, new object[0]);
            int    day    = TimeUtil.NowDateTime().DayOfYear;
            BangHuiLingDiItemData lingDiItem = JunQiManager.GetItemByLingDiID(6);
            string result;

            if (null == lingDiItem)
            {
                result = unKown;
            }
            else
            {
                Dictionary <int, int> warRequestMap = WangChengManager.GetWarRequstMap(lingDiItem.WarRequest);
                List <DateTime>       lsDays        = new List <DateTime>();
                for (int i = 0; i < warRequestMap.Count; i++)
                {
                    DateTime dt   = TimeUtil.NowDateTime();
                    int      span = warRequestMap.Values.ElementAt(i) - day;
                    if (span >= 0)
                    {
                        dt = dt.AddDays((double)span);
                    }
                    else
                    {
                        int yearNext = dt.Year + 1;
                        dt = DateTime.Parse(string.Format("{0}-01-01", yearNext)).AddDays((double)(warRequestMap.Values.ElementAt(i) - 1));
                    }
                    lsDays.Add(dt);
                }
                lsDays.Sort(delegate(DateTime l, DateTime r)
                {
                    int result2;
                    if (l.Ticks < r.Ticks)
                    {
                        result2 = -1;
                    }
                    else if (l.Ticks > r.Ticks)
                    {
                        result2 = 1;
                    }
                    else
                    {
                        result2 = 0;
                    }
                    return(result2);
                });
                if (lsDays.Count > 0)
                {
                    DateTime nextDate = lsDays[0];
                    if (WangChengManager.WangChengZhanFightingDayTimes != null && WangChengManager.WangChengZhanFightingDayTimes.Length > 0)
                    {
                        return(lsDays[0].ToString("yyyy-MM-dd " + string.Format("{0:00}:{1:00}", WangChengManager.WangChengZhanFightingDayTimes[0].FromHour, WangChengManager.WangChengZhanFightingDayTimes[0].FromMinute)));
                    }
                }
                result = unKown;
            }
            return(result);
        }
        public static bool IsExistCityWarToday()
        {
            int day = TimeUtil.NowDateTime().DayOfYear;
            BangHuiLingDiItemData lingDiItem = JunQiManager.GetItemByLingDiID(6);
            bool result;

            if (null == lingDiItem)
            {
                result = false;
            }
            else
            {
                Dictionary <int, int> warRequestMap = WangChengManager.GetWarRequstMap(lingDiItem.WarRequest);
                result = warRequestMap.ContainsValue(day);
            }
            return(result);
        }
        protected static void RemoveTodayInWarRequest()
        {
            int day = TimeUtil.NowDateTime().DayOfYear;
            BangHuiLingDiItemData lingDiItem = JunQiManager.GetItemByLingDiID(6);

            if (null != lingDiItem)
            {
                Dictionary <int, int> warRequestMap = WangChengManager.GetWarRequstMap(lingDiItem.WarRequest);
                if (warRequestMap.ContainsValue(day))
                {
                    for (int i = 0; i < warRequestMap.Count; i++)
                    {
                        if (warRequestMap.Values.ElementAt(i) == day)
                        {
                            warRequestMap.Remove(warRequestMap.Keys.ElementAt(i));
                            break;
                        }
                    }
                    string nowWarRequest = WangChengManager.GeWarRequstString(warRequestMap);
                    WangChengManager.SetCityWarRequestToDBServer(6, nowWarRequest);
                }
            }
        }
        public static string GetCityBattleTimeAndBangHuiListString()
        {
            string result;

            if (WangChengManager.WangChengZhanFightingDayTimes == null || WangChengManager.WangChengZhanFightingDayTimes.Length <= 0)
            {
                result = "";
            }
            else
            {
                int day = TimeUtil.NowDateTime().DayOfYear;
                BangHuiLingDiItemData lingDiItem = JunQiManager.GetItemByLingDiID(6);
                if (null == lingDiItem)
                {
                    result = "";
                }
                else
                {
                    Dictionary <int, int> warRequestMap = WangChengManager.GetWarRequstMap(lingDiItem.WarRequest);
                    List <DateTime>       lsDays        = new List <DateTime>();
                    for (int i = 0; i < warRequestMap.Count; i++)
                    {
                        DateTime dt   = TimeUtil.NowDateTime();
                        int      span = warRequestMap.Values.ElementAt(i) - day;
                        if (span >= 0)
                        {
                            dt = dt.AddDays((double)span);
                        }
                        else
                        {
                            int yearNext = dt.Year + 1;
                            dt = DateTime.Parse(string.Format("{0}-01-01", yearNext)).AddDays((double)(warRequestMap.Values.ElementAt(i) - 1));
                        }
                        lsDays.Add(dt);
                    }
                    lsDays.Sort(delegate(DateTime l, DateTime r)
                    {
                        int result2;
                        if (l.Ticks < r.Ticks)
                        {
                            result2 = -1;
                        }
                        else if (l.Ticks > r.Ticks)
                        {
                            result2 = 1;
                        }
                        else
                        {
                            result2 = 0;
                        }
                        return(result2);
                    });
                    string timeBangHuiString = "";
                    int    index             = 0;
                    while (index < lsDays.Count && index < 10)
                    {
                        int dayID = lsDays[index].DayOfYear;
                        for (int i = 0; i < warRequestMap.Count; i++)
                        {
                            if (dayID == warRequestMap.Values.ElementAt(i))
                            {
                                int    bangHuiID = warRequestMap.Keys.ElementAt(i);
                                string strTime;
                                string strBH;
                                WangChengManager.GetWarTimeStringAndBHName(dayID, bangHuiID, out strTime, out strBH);
                                if (timeBangHuiString.Length > 0)
                                {
                                    timeBangHuiString += ",";
                                }
                                timeBangHuiString += string.Format("{0},{1}", strTime, strBH);
                                break;
                            }
                        }
                        index++;
                    }
                    result = timeBangHuiString;
                }
            }
            return(result);
        }
        public static bool GetNextCityBattleTimeAndBangHui(out int dayID, out int bangHuiID)
        {
            dayID     = -1;
            bangHuiID = -1;
            int day = TimeUtil.NowDateTime().DayOfYear;
            BangHuiLingDiItemData lingDiItem = JunQiManager.GetItemByLingDiID(6);
            bool result;

            if (null == lingDiItem)
            {
                result = false;
            }
            else
            {
                Dictionary <int, int> warRequestMap = WangChengManager.GetWarRequstMap(lingDiItem.WarRequest);
                List <DateTime>       lsDays        = new List <DateTime>();
                for (int i = 0; i < warRequestMap.Count; i++)
                {
                    DateTime dt   = TimeUtil.NowDateTime();
                    int      span = warRequestMap.Values.ElementAt(i) - day;
                    if (span >= 0)
                    {
                        dt = dt.AddDays((double)span);
                    }
                    else
                    {
                        int yearNext = dt.Year + 1;
                        dt = DateTime.Parse(string.Format("{0}-01-01", yearNext)).AddDays((double)(warRequestMap.Values.ElementAt(i) - 1));
                    }
                    lsDays.Add(dt);
                }
                lsDays.Sort(delegate(DateTime l, DateTime r)
                {
                    int result2;
                    if (l.Ticks < r.Ticks)
                    {
                        result2 = -1;
                    }
                    else if (l.Ticks > r.Ticks)
                    {
                        result2 = 1;
                    }
                    else
                    {
                        result2 = 0;
                    }
                    return(result2);
                });
                if (lsDays.Count > 0)
                {
                    DateTime nextDate = lsDays[0];
                    if (WangChengManager.WangChengZhanFightingDayTimes != null && WangChengManager.WangChengZhanFightingDayTimes.Length > 0)
                    {
                        dayID = nextDate.DayOfYear;
                        for (int i = 0; i < warRequestMap.Count; i++)
                        {
                            if (dayID == warRequestMap.Values.ElementAt(i))
                            {
                                bangHuiID = warRequestMap.Keys.ElementAt(i);
                                return(true);
                            }
                        }
                        return(false);
                    }
                }
                result = false;
            }
            return(result);
        }