Example #1
0
        private void parseJob(JSONResponse jresponse, ref RJobDetails jobDetails)
        {
            String  descr         = "";
            String  id            = "";
            String  name          = "";
            int     onrepeat      = 0;
            String  project       = "";
            long    schedinterval = 0;
            int     schedrepeat   = 0;
            long    schedstart    = 0;
            String  status        = "";
            String  statusMsg     = "";
            long    timeStart     = 0;
            long    timeCode      = 0;
            long    timeTotal     = 0;
            String  tag           = "";
            JObject jjob          = default(JObject);

            if (jresponse.JSONMarkup["job"].Type == JTokenType.Object)
            {
                jjob = jresponse.JSONMarkup["job"].Value <JObject>();
            }
            else
            {
                jjob = jresponse.JSONMarkup;
            }
            if (!(jjob == null))
            {
                descr         = JSONUtilities.trimXtraQuotes(jjob["descr"].Value <String>());
                id            = JSONUtilities.trimXtraQuotes(jjob["job"].Value <String>());
                name          = JSONUtilities.trimXtraQuotes(jjob["name"].Value <String>());
                onrepeat      = Convert.ToInt32(jjob["onrepeat"].Value <String>());
                project       = JSONUtilities.trimXtraQuotes(jjob["project"].Value <String>());
                schedinterval = Convert.ToInt64(jjob["schedinterval"].Value <String>());
                schedrepeat   = Convert.ToInt32(jjob["schedrepeat"].Value <String>());
                schedstart    = Convert.ToInt64(jjob["schedstart"].Value <String>());
                status        = JSONUtilities.trimXtraQuotes(jjob["status"].Value <String>());
                statusMsg     = JSONUtilities.trimXtraQuotes(jjob["statusMsg"].Value <String>());
                timeStart     = Convert.ToInt64(jjob["timeStart"].Value <String>());
                timeCode      = Convert.ToInt64(jjob["timeCode"].Value <String>());
                timeTotal     = Convert.ToInt64(jjob["timeTotal"].Value <String>());
                tag           = JSONUtilities.trimXtraQuotes(jjob["tag"].Value <String>());

                jobDetails = new RJobDetails(descr, id, name, onrepeat, project, schedinterval, schedrepeat, schedstart, status, statusMsg, timeStart, timeCode, timeTotal, tag);
            }
        }
        private void parseJob(JSONResponse jresponse, ref RJobDetails jobDetails)
        {
            String descr = "";
            String id = "";
            String name = "";
            int onrepeat = 0;
            String project = "";
            long schedinterval = 0;
            int schedrepeat = 0;
            long schedstart = 0;
            String status = "";
            String statusMsg = "";
            long timeStart = 0;
            long timeCode = 0;
            long timeTotal = 0;
            String tag = "";
            JObject jjob = default(JObject);

            if (jresponse.JSONMarkup["job"].Type == JTokenType.Object)
            {
                jjob = jresponse.JSONMarkup["job"].Value<JObject>();
            }
            else
            {
                jjob = jresponse.JSONMarkup;
            }
            if (!(jjob == null))
            {
                descr = JSONUtilities.trimXtraQuotes(jjob["descr"].Value<String>());
                id = JSONUtilities.trimXtraQuotes(jjob["job"].Value<String>());
                name = JSONUtilities.trimXtraQuotes(jjob["name"].Value<String>());
                onrepeat = Convert.ToInt32(jjob["onrepeat"].Value<String>());
                project = JSONUtilities.trimXtraQuotes(jjob["project"].Value<String>());
                schedinterval = Convert.ToInt64(jjob["schedinterval"].Value<String>());
                schedrepeat = Convert.ToInt32(jjob["schedrepeat"].Value<String>());
                schedstart = Convert.ToInt64(jjob["schedstart"].Value<String>());
                status = JSONUtilities.trimXtraQuotes(jjob["status"].Value<String>());
                statusMsg = JSONUtilities.trimXtraQuotes(jjob["statusMsg"].Value<String>());
                timeStart = Convert.ToInt64(jjob["timeStart"].Value<String>());
                timeCode = Convert.ToInt64(jjob["timeCode"].Value<String>());
                timeTotal = Convert.ToInt64(jjob["timeTotal"].Value<String>());
                tag = JSONUtilities.trimXtraQuotes(jjob["tag"].Value<String>());

                jobDetails = new RJobDetails(descr, id, name, onrepeat, project, schedinterval, schedrepeat, schedstart, status, statusMsg, timeStart, timeCode, timeTotal, tag);

            }
        }