Beispiel #1
0
 public override string ToString()
 {
     return(String.Format("{0,20} {1,2} {2,20} {3,10} {4,15} {5,15}", PersonName, AgeAtEvent, EventName, role.ToString(), StartDT.ToString(), EndDT.ToString()));
 }
Beispiel #2
0
    public bool ParseFrom(JSONNode pJson)
    {
        string startDateTime, endDateTime;
        bool   rVal = false;

        if (pJson.ParseTo("eventType", out eventType, "startDateTime", out startDateTime) &&
            pJson.ParseTo("useFlag", out useFlag, "endDateTime", out endDateTime))
        {
            rVal = true;
        }

        StartDT = startDateTime.ToDateTime();
        EndDT   = endDateTime.ToDateTime();

        Ag.LogStartWithStr(1, " Event  >>>  " + eventType + "      useFlag : " + useFlag + "     is Effective    ::   From  " + StartDT.ToString() + "  ~  " + EndDT.ToString());

        if (eventType == "saleItem" || eventType == "invite" || eventType == "quest" || eventType == "attendance" || eventType == "gift")
        {
            JSONNode rew = pJson ["reward"];
            for (int k = 0; k < rew.Count; k++)
            {
                JSONNode nObj = rew [k];
                Reward   nRew;
                nRew.code  = nObj ["code"];
                nRew.value = nObj ["value"];
                arrReward.Add(nRew);

                ("         reward    parsing    >>  code : " + nRew.code + "      value :  " + nRew.value).HtLog();
            }
        }
        return(rVal);
    }