Ejemplo n.º 1
0
    public override void OnMessage(Message message)
    {
        string name = message.Name;

        object[] body = message.Params;
        switch (name)
        {
        case MessageConst.CMD_LOVEDIARY_PREVIOUS_MONTH:
            Debug.Log("CMD_LOVEDIARY_PREVIOUS_MONTH");
            GetNewMonthData(MonthState.Previous);
            break;

        case MessageConst.CMD_LOVEDIARY_NEXT_MONTH:
            Debug.Log("CMD_LOVEDIARY_NEXT_MONTH");
            GetNewMonthData(MonthState.Next);
            break;

        case MessageConst.CMD_LOVEDIARY_CALENDAR_SELECT:
            Debug.Log("CMD_LOVEDIARY_CALENDAR_SELECT");
            DateTime Dt = (DateTime)body[0];
            if (DateUtil.CheckIsToday(Dt) == 1)
            {
                PopupManager.ShowAlertWindow(I18NManager.Get("LoveDiary_Hint8"), I18NManager.Get("Common_Hint"), I18NManager.Get("Common_Know"));
                return;
            }
            if (DateUtil.CompareToday(GetData <LoveDiaryModel>().UnlockDt, Dt) == 1)
            {
                PopupManager.ShowAlertWindow(I18NManager.Get("LoveDiary_Hint9"), I18NManager.Get("Common_Hint"), I18NManager.Get("Common_Know"));
                return;
            }
            SelctCalender(Dt);
            break;
        }
    }