示例#1
0
        public async Task ModifyClicked(Location loc)
        {
            View.ShowLoading();
            long?idLocalizacion = loc.IdLocation == -1 ? (long?)null : loc.IdLocation;
            var  response       = await modifyFichaUseCase.Execute(ficha.TelefonoEmpleado, idLocalizacion);

            View.HideLoading();
            if (response.ErrorCode > 0)
            {
                if (response.ErrorCode == 401)
                {
                    View.ShowDialog(response.Message, "msg_ok", () => Locator.Current.GetService <ILogoutService>().LogoutExpired());
                }
                else
                {
                    View.ShowDialog(response.Message, "msg_ok", null);
                }
            }
            else
            {
                Analytics.TrackEvent("CentroTrabajoActualizado");
                ficha.IdLocalizacion = idLocalizacion;
                navigator.GoBack();
            }
        }
        public async Task SaveClicked(string phone)
        {
            View.ShowLoading();
            var response = await modifyFichaUseCase.Execute(phone, ficha.IdLocalizacion);

            View.HideLoading();
            if (response.ErrorCode > 0)
            {
                if (response.ErrorCode == 401)
                {
                    View.ShowDialog(response.Message, "msg_ok", () => Locator.Current.GetService <ILogoutService>().LogoutExpired());
                }
                else
                {
                    View.ShowDialog(response.Message, "msg_ok", null);
                }
            }
            else
            {
                Analytics.TrackEvent("TelefonoActualizado");
                ficha.TelefonoEmpleado = phone;
                View.ShowDialog("contact_data_save_modify_data_ok", "msg_ok", null);
            }
        }