예제 #1
0
파일: VM.cs 프로젝트: Eladzy/FoodAPI
        public void PostToAPI()
        {
            isExecute = false;
            if (foodVmObj != null)
            {
                Task.Run(() =>
                {
                    AccessAPI.Post(foodVmObj);
                    SetCollection();

                    MessageBox.Show($"{foodVmObj.Name} Was Posted Successfully", "Success", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                });
            }
            else
            {
                MessageBox.Show("Operation Failed", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            isExecute = true;
        }