Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        public async override Task <bool> Process(ICouchSave couchSave)
        {
            var result = await Process();

            StartWorkData startData = new StartWorkData();

            startData.Work = RESULT;
            couchSave.save((IProcessData)startData, GetSettings());
            return(true);
        }
Ejemplo n.º 3
0
        public override async Task <bool> Process(IProcessData processData, ICouchSave couchSave)
        {
            var result = await Process();

            StartWorkData startData = (StartWorkData)processData;

            startData.Work        = RESULT;
            startData.Work.Subcon = startData.Subcon;
            couchSave.save((IProcessData)startData, GetSettings());
            return(true);
        }