Beispiel #1
0
        public void callRemoveData()
        {
            try
            {
                DialogQuestion msg = new DialogQuestion("Se va a borrar toda la información almacenada, quiere continuar ?");

                bool?lResult = msg.ShowDialog();

                if (lResult != null && lResult.ToString().ToUpper() == "TRUE")
                {
                    string lPass = checkCeredentials();

                    if (lPass != null && lPass != "")
                    {
                        bool       lRemoveResult = readWriteClass.removeData();
                        DialogInfo resultMsg     = new DialogInfo(lRemoveResult ? DialogInfo.TypeMsg.Info : DialogInfo.TypeMsg.Error, lRemoveResult ? "Los datos han sido borrados" : "No se han podido borrar los datos");
                        resultMsg.ShowDialog();
                        mPass = "";
                    }
                    else if (lPass != null)
                    {
                        DialogInfo passError = new DialogInfo(DialogInfo.TypeMsg.Error, "El password maestro introducido no es correcto");
                        passError.ShowDialog();
                    }
                }
            }
            catch (Exception ex)
            {
                callLogger("Método callRemoveData() de la clase Controller => " + ex.ToString() + "__" + DateTime.Now);
            }
        }
Beispiel #2
0
        private void Button_Delete_Click(object sender, RoutedEventArgs e)
        {
            DialogQuestion dialogQuestion = new DialogQuestion("提示", "确定删除布局吗?");

            dialogQuestion.ShowDialog();

            if (dialogQuestion.returnValue == DialogQuestion.DialogReturn.OK)
            {
                if (this.ComboBox_BoardLayout.SelectedIndex >= 0)
                {
                    mainSetting.savedBoardLayouts.Remove(mainSetting.currentBoardLayout);
                    mainSetting.RemoveBoardLayoutFile(mainSetting.currentBoardLayout.LayoutName);
                    this.ComboBox_BoardLayout.Items.RemoveAt(this.ComboBox_BoardLayout.SelectedIndex);

                    if (this.ComboBox_BoardLayout.Items.Count > 0)
                    {
                        this.ComboBox_BoardLayout.SelectedIndex = this.ComboBox_BoardLayout.SelectedIndex - 1 >= 0 ? this.ComboBox_BoardLayout.SelectedIndex : 0;
                    }
                }
            }
        }