Ejemplo n.º 1
0
        public void OnClickAcceptButton()
        {
            string description = descriptionTextBox.getText();

            if (description == "")
            {
                MessageBox.Show("Description is required", "Information", MessageBoxButton.OK, MessageBoxImage.Information);
            }
            else
            {
                string           condition = accept_button.Content.ToString().ToLower();
                MessageBoxResult result    = MessageBox.Show("Are you sure you want to " + condition + " reservation ?", "Confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question);
                switch (result)
                {
                case MessageBoxResult.Yes:
                    if (accept_button.Content.Equals("Accept"))
                    {
                        getController().callMethod("UpdateStatusReservation", reservation.Id, "On Reservation", description);
                    }
                    else
                    {
                        getController().callMethod("UpdateStatusReservation", reservation.Id, "Returned", description);
                    }
                    break;
                }
            }
        }
Ejemplo n.º 2
0
 private bool UserFilter(object item)
 {
     if (String.IsNullOrEmpty(searchTextBox.getText()))
     {
         return(true);
     }
     else
     {
         return((item as ModelSparepart).name.IndexOf(searchTextBox.getText(), StringComparison.OrdinalIgnoreCase) >= 0);
     }
 }
Ejemplo n.º 3
0
 private bool UserFilter(object item)
 {
     if (String.IsNullOrEmpty(searchTextBox.getText()))
     {
         return(true);
     }
     else
     {
         return((item as ModelPayment).status.IndexOf(searchTextBox.getText(), StringComparison.OrdinalIgnoreCase) >= 0 ||
                (item as ModelPayment).repairment_date.IndexOf(searchTextBox.getText(), StringComparison.OrdinalIgnoreCase) >= 0);
     }
 }
        public void onSaveButtonClick()
        {
            ObjectSparepart newSparepart = null;

            if (!nameTxtBox.getText().Equals("") && !priceTxtBox.getText().Equals("") && !stockTxtBox.getText().Equals(""))
            {
                newSparepart = new ObjectSparepart(nameTxtBox.getText(), Int32.Parse(priceTxtBox.getText()), Int16.Parse(stockTxtBox.getText()));
                String token = File.ReadAllText(@"userToken.txt");
                getController().callMethod("addSparepart", uploadImage, newSparepart, token);
            }
            else
            {
                MessageBox.Show("Please fill in all fields before saving", "Failed", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Ejemplo n.º 5
0
        public void onSaveButtonClick()
        {
            ObjectSparepart newSparepart = new ObjectSparepart(nameTxtBox.getText(), Int32.Parse(priceTxtBox.getText()), Int16.Parse(stockTxtBox.getText()));
            String          token        = File.ReadAllText(@"userToken.txt");

            getController().callMethod("editSparepart", uploadImage, newSparepart, sparepartId, token);
        }
Ejemplo n.º 6
0
 public void onRegisterButtonClick()
 {
     getController().callMethod("register",
                                nameTxtBox.getText(),
                                emailTxtBox.getText(),
                                passwordTxtBox.getText(),
                                passwordcTxtBox.getText());
 }
Ejemplo n.º 7
0
        public void onSaveButtonClick()
        {
            System.Diagnostics.Debug.WriteLine("Test onsave page");
            String token     = File.ReadAllText(@"userToken.txt");
            String startTime = startTimeH.getText().ToString() + ":" + startTimeM.getText().ToString() + ":" + startTimeS.getText().ToString();
            String endTime   = endTimeH.getText().ToString() + ":" + endTimeM.getText().ToString() + ":" + endTimeS.getText().ToString();

            getController().callMethod("editProgress", bookingId, startTime, endTime, token);
        }
Ejemplo n.º 8
0
        private void SearchAssetName(object sender, MouseButtonEventArgs e)
        {
            string name = searchTextBox.getText();

            if (name != "")
            {
                getController().callMethod("SearchAsset", name);
            }
            else
            {
                GetAssets();
            }
        }
Ejemplo n.º 9
0
        public void onUpdateButtonClick()
        {
            MessageBoxResult result;

            if (!nameTxtBox.getText().Equals("") && !phoneTxtBox.getText().Equals("") && !emailTxtBox.getText().Equals("") && !addressTxtBox.getText().Equals(""))
            {
                String        phoneNumber = "62" + phoneTxtBox.getText();
                ObjectBengkel newBengkel  = new ObjectBengkel(nameTxtBox.getText(), phoneNumber, emailTxtBox.getText(), addressTxtBox.getText());
                String        token       = File.ReadAllText(@"userToken.txt");
                String[]      password    = new String[2];
                if (!newPass.getPassword().ToString().Equals(""))
                {
                    password[0] = oldPass.getPassword();
                    password[1] = newPass.getPassword();
                }
                getController().callMethod("editProfile", uploadImage, password, newBengkel, token);
            }
            else
            {
                result = MessageBox.Show("All field must be filled !", "Failed", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Ejemplo n.º 10
0
        public void OnClickLoginButton()
        {
            string email    = emailTxtBox.getText();
            string password = passwordBox.getPassword();

            if (email == "" || password == "")
            {
                MessageBox.Show("Please fill all the fields", "Information", MessageBoxButton.OK, MessageBoxImage.Information);
            }
            else
            {
                getController().callMethod("Login", email, password);
            }
        }
        public void OnClickCreateButton()
        {
            string assetName = assetTextBox.getText();
            string quantity  = quantityTextBox.getText();

            if (assetName == "" || quantity == "")
            {
                MessageBox.Show("Please fill all the fields", "Information", MessageBoxButton.OK, MessageBoxImage.Information);
            }
            else
            {
                getController().callMethod("CreateAsset", assetName, quantity, myFile);
            }
        }
Ejemplo n.º 12
0
        public void onSaveButtonClick()
        {
            string name  = nameTxtBox.getText();
            string email = emailTxtBox.getText();
            string role  = comboBox.SelectedValue.ToString();

            if (name.Equals("") || email.Equals("") || role.Equals(""))
            {
                showErrorMessage("All fillable fields are required");
                return;
            }

            getController().callMethod("save", name, email, role);
        }
Ejemplo n.º 13
0
        public void onCreateButtonClick()
        {
            getController().callMethod("create",

                                       name_tb1.getText(),
                                       description_tb1.getText(),
                                       address_tb1.getText(),
                                       contact_tb1.getText().ToString(),
                                       latitude_tb1.getText(),
                                       longitude_tb1.getText(),
                                       category_tb1.getText(),
                                       this.token,
                                       newImage[0]
                                       );
        }
Ejemplo n.º 14
0
        private void edit_btn_Click(object sender, RoutedEventArgs e)
        {
            getController().callMethod("editLocation",

                                       editName_tb1.getText(),
                                       editDescription_tb1.getText(),
                                       editAddress_tb1.getText(),
                                       editContact_tb1.getText().ToString(),
                                       editLatitude_tb1.getText(),
                                       editLongitude_tb1.getText(),
                                       currentId.ToString(),
                                       this.token,
                                       newImage[0]
                                       );
        }
        private void saveButton_Click(object sender, RoutedEventArgs e)
        {
            string name               = fullNameTextBox.getText();
            string email              = emailTextBox.getText();
            string currentPassword    = currentPasswordBox.Password;
            string newPassword        = newPasswordBox.Password;
            string confirmNewPassword = confirmNewPasswordBox.Password;
            MyFile newImageFile       = newProfileImage[0];

            if (name.Equals("") || email.Equals("") ||
                (changePassword && (currentPassword.Equals("") ||
                                    newPassword.Equals("") ||
                                    confirmNewPassword.Equals(""))))
            {
                showErrorMessage("All fillable fields are required.");
                return;
            }

            if (changePassword && !confirmNewPassword.Equals(newPassword))
            {
                showErrorMessage("New password and confirm new password should be equal.");
                return;
            }

            switch (showConfirmationMessage("Proceed update profile?"))
            {
            case MessageBoxResult.OK:
                if (changePassword)
                {
                    getController()
                    .callMethod("updateUser", userId, name, email, currentPassword,
                                newPassword, currentImagePath, newImageFile);
                }
                else
                {
                    getController()
                    .callMethod("updateUser", userId, name, email, null,
                                null, currentImagePath, newImageFile);
                }
                break;

            default:
                break;
            }
        }
Ejemplo n.º 16
0
        public void OnClickUpdateButton()
        {
            string name     = assetTextBox.getText();
            string quantity = quantityTextBox.getText();

            if (name == "" || quantity == "")
            {
                MessageBox.Show("Please fill all the fields", "Information", MessageBoxButton.OK, MessageBoxImage.Information);
            }
            else
            {
                Model.Asset newAsset = new Model.Asset();
                newAsset.Id       = asset.Id;
                newAsset.Name     = name;
                newAsset.Quantity = Int32.Parse(quantity);
                getController().callMethod("UpdateAsset", newAsset, myFile);
            }
        }
        public void onEditButtonClick()
        {
            Console.WriteLine("TEST");



            getController().callMethod("putCategory",

                                       editName_tb1.getText(),
                                       Int32.Parse(editCategory_tb1.getText())

                                       );



            /*
             * editDescription_tb1.getText(),
             * editAddress_tb1.getText(),
             * editContact_tb1.getText().ToString(),
             * editLatitude_tb1.getText(),
             * editLongitude_tb1.getText(),
             * editImage_tb1.getText(),
             * editCategory_tb1.getText()*/
        }
        public void GetReservationAsset()
        {
            string name = searchTextBox.getText();

            getController().callMethod("SearchReservation", name);
        }
Ejemplo n.º 19
0
 public void onLoginButtonClick()
 {
     getController().callMethod("login", emailTxtBox.getText(), passwordTxtBox.getPassword());
 }
Ejemplo n.º 20
0
 public void onCategoryButtonClick()
 {
     getController().callMethod("postCategory",
                                categoryTxtBox.getText(), this.token);
 }
 private void category_btn_Click(object sender, RoutedEventArgs e)
 {
     getController().callMethod("editCategory", categoryTxtBox.getText(), this.token, modelCategory.id.ToString());
 }