private async void updateWOP(WorkOrderParametersView WOP)
        {
            await BeBusy(true);

            WorkOrdersParameters woptoUpdate = new WorkOrdersParameters();

            woptoUpdate.ID             = WOP.wopID;
            woptoUpdate.workOrder_FKID = WOP.workOrder_FKID;
            woptoUpdate.parameter_FKID = WOP.parameter_FKID;
            woptoUpdate.Lenght         = WOP.Lenght;
            woptoUpdate.Amount         = WOP.Amount;
            woptoUpdate.isDone         = WOP.isDone;
            woptoUpdate.lastUpdate     = DateTime.Now;
            woptoUpdate.DoneLength     = WOP.DoneLength;
            woptoUpdate.DoneAmount     = WOP.DoneAmount;
            woptoUpdate.weightAmount   = WOP.weightAmount;
            bool isOk = false;

            try
            {
                isOk = await rcs.PutWorkOrderParameterUpdateAsync(woptoUpdate.ID, woptoUpdate);
            }
            catch (Exception err)
            {
            }

            if (isOk)
            {
                popelateData(n);
                await BeBusy(false);
                await DisplayAlert("ok", "updated", "ok");

                //await Navigation.PopAsync();
            }
            else
            {
                await BeBusy(false);
                await DisplayAlert("Error", "Error", "ok");

                //await Navigation.PopAsync();
            }
        }
Ejemplo n.º 2
0
        private async void update_Clicked(object sender, EventArgs e)
        {
            await BeBusy(true);

            WorkOrdersParameters woptoUpdate = new WorkOrdersParameters();

            woptoUpdate.ID             = wop.wopID;
            woptoUpdate.workOrder_FKID = wop.workOrder_FKID;
            woptoUpdate.parameter_FKID = wop.parameter_FKID;
            woptoUpdate.Lenght         = wop.Lenght;
            woptoUpdate.Amount         = wop.Amount;
            woptoUpdate.isDone         = isDoneValue.IsToggled;
            woptoUpdate.lastUpdate     = DateTime.Now;
            bool isOk = false;

            try
            {
                isOk = await rcs.PutWorkOrderParameterUpdateAsync(woptoUpdate.ID, woptoUpdate);
            }
            catch (Exception err)
            {
            }

            if (isOk)
            {
                await BeBusy(false);
                await DisplayAlert("ok", "updated", "ok");

                await Navigation.PopAsync();
            }
            else
            {
                await BeBusy(false);
                await DisplayAlert("Error", "Error", "ok");

                await Navigation.PopAsync();
            }
        }