private void modifyCommand(object parameter)
        {
            if (string.IsNullOrEmpty(Firstname) || string.IsNullOrEmpty(Lastname))
            {
                return;
            }

            if (ModifyContent.ToLower() == "add")
            {
                modifyEntity();
                runTask(SQLFunctionType.Add);
            }
            else
            {
                if (dataModified() == false)
                {
                    return;
                }

                WindowMessageResult modifyResult = MessageBoxEnhanced.Show(
                    "Question...",
                    "You are about to modify a record in the database! Do you wish to continue?",
                    WindowMessageButtons.YesNo,
                    WindowMessageIcon.Question);

                if (modifyResult == WindowMessageResult.Yes)
                {
                    modifyEntity();
                    runTask(SQLFunctionType.Modify);
                }
            }
        }
Example #2
0
 // Usage examples:
 // Windows like dialog:
 // NOTE: See the DialogData class above for more options. The method used below and even direct calling to open a dialog requires a window where the dialog will open.
 public static void ExampleOne(object parameter)
 {
     MessageBoxEnhanced.Show(
         parameter as Window,
         "Example...",
         "This is a sample message...",
         "The is the body of the dialog.",
         WindowMessageButtons.Ok,
         WindowMessageIcon.Information);
 }
        private void deleteCommand(object parameter)
        {
            WindowMessageResult deleteResult = MessageBoxEnhanced.Show(
                "Question...",
                "You are about to delete a record from the database! Do you wish to continue?",
                WindowMessageButtons.YesNo,
                WindowMessageIcon.Question);

            if (deleteResult == WindowMessageResult.Yes)
            {
                runTask(SQLFunctionType.Delete);
            }
        }
Example #4
0
        private void resetCommand(object parameter)
        {
            WindowMessageResult resetResult = MessageBoxEnhanced.Show(
                "Warning...",
                "You are about to reset the database!",
                "Any changes you have made to the current database will lost. Are you sue you wish to continue?",
                WindowMessageButtons.YesNo,
                WindowMessageIcon.Warning);

            if (resetResult == WindowMessageResult.Yes)
            {
                SQLConnection.Close();
                Statics.LoadResourceDatabase(true);
                CloseDialogWithResult(WindowMessageResult.Yes);
            }
        }