コード例 #1
0
        public override async Task <bool> Process(IProcessData processData)
        {
            if (!processData.Validate())
            {
                //Console.WriteLine("Error");
                Debug.WriteLine(processData.GetErrors().Count);
                foreach (string error in processData.GetErrors())
                {
                    Debug.WriteLine(error);
                }

                return(false);
            }

            var settings = GetSettings();
            // TODO Get the source From API and/or CouchLite DB
            var manager  = Manager.SharedInstance;
            var database = manager.GetDatabase(settings.SubcontractorDetailsDb());

            StartWorkData startWorkData = (StartWorkData)processData;
            Task <string> taskResult    = Post(startWorkData.GetFormData(), "/rsm/start-work/");
            string        result        = await taskResult;
            dynamic       json          = JObject.Parse(result);
            bool          success       = json.success;

            Debug.WriteLine(success);
            return(success);
        }
コード例 #2
0
        public override async Task <bool> Process(IProcessData processData)
        {
            if (!processData.Validate())
            {
                Debug.WriteLine(processData.GetErrors().Count);
                foreach (string error in processData.GetErrors())
                {
                    Debug.WriteLine(error);
                }

                return(false);
            }

            CacheData cacheData = (CacheData)processData;



            return(true);
        }
コード例 #3
0
        public override async Task <bool> Process(IProcessData processData)
        {
            if (!processData.Validate())
            {
                Debug.WriteLine("Error");
                Debug.WriteLine(processData.GetErrors().Count);
                foreach (string error in processData.GetErrors())
                {
                    Debug.WriteLine(error);
                }

                return(false);
            }

            LoginData     loginData  = (LoginData)processData;
            Task <string> taskResult = Post(loginData.GetFormData(), "/rsm/signin/");
            string        result     = await taskResult;
            dynamic       json       = jParser.Parser.Parse(result);
            bool          success    = json["success"];

            Debug.WriteLine("LoginModule : " + success);


            if (success)
            {
                Staff staff = new Staff();
                staff.EmailAddress = json["result"]["email"];
                staff.FirstName    = json["result"]["fname"];
                staff.LastName     = json["result"]["lname"];
                staff.Id           = json["result"]["userid"];
                staff.Password     = loginData.Password;
                LoggedInStaff      = staff;
            }



            RESULT = json;
            return(success);
        }
コード例 #4
0
        public override async Task <bool> Process(IProcessData processData)
        {
            if (!processData.Validate())
            {
                //Console.WriteLine("Error");
                Debug.WriteLine(processData.GetErrors().Count);
                foreach (string error in processData.GetErrors())
                {
                    Debug.WriteLine(error);
                }

                return(false);
            }
            VersionData versionData = (VersionData)processData;

            Task <string> taskResult = Post(versionData.GetFormData(), "/rsm/version/");
            string        result     = await taskResult;
            dynamic       json       = jParser.Parser.Parse(result);
            bool          success    = json["success"];

            Debug.WriteLine("VersionModule : " + success);
            RESULT = json;
            return(success);
        }