Exemplo n.º 1
0
        public async void AddTaskType()
        {
            Value = true;
            var connection = await apiService.CheckConnection();

            if (!connection.IsSuccess)
            {
                await Application.Current.MainPage.DisplayAlert(
                    Languages.Warning,
                    Languages.CheckConnection,
                    Languages.Ok);

                return;
            }
            if (string.IsNullOrEmpty(Code) || string.IsNullOrEmpty(Description))
            {
                Value = true;
                return;
            }

            var taskType = new AddTaskType
            {
                code         = Code,
                description  = Description,
                businessCard = BusinessCard
            };
            var response = await apiService.Save <AddTaskType>(
                "https://app.smart-path.it",
                "/md-core",
                "/medial/taskType",
                taskType);

            if (!response.IsSuccess)
            {
                await Application.Current.MainPage.DisplayAlert("Error", response.Message, "ok");

                return;
            }

            Value = false;
            MessagingCenter.Send((App)Application.Current, "OnSaved");
            DependencyService.Get <INotification>().CreateNotification("Medial", "Task Type Added");
            await App.Current.MainPage.Navigation.PopPopupAsync(true);
        }
Exemplo n.º 2
0
 public frmTaskList(AddTaskType type)
 {
     InitializeComponent();
 }
 public frmTaskList(AddTaskType type)
 {
     InitializeComponent();
 }