private void wizardControl2_SelectedPageChanging(object sender, DevExpress.XtraWizard.WizardPageChangingEventArgs e)
 {
     if (e.Page == completionWizardPage2 && e.Direction == Direction.Forward && gridView1.RowCount == 0)
     {
         MessageBox.Show("Listeye Hiç bir Ürün Eklenmedi");
         e.Cancel = true;
     }
 }
Exemple #2
0
        private void wizardControl1_SelectedPageChanging(object sender, DevExpress.XtraWizard.WizardPageChangingEventArgs e)
        {
            if (e.Page == wizardLisansAnlasmasi)
            {
                if (!cb_LisansControl.Checked)
                {
                    e.Page.AllowNext = false;
                }
            }
            if (e.Page == pageSqlSettings)
            {
                if (chcSunucu.Checked == false && chLocalDB.Checked == false)
                {
                    e.Page.AllowNext = false;
                }
            }

            if (e.Page == pageLisansDemo)
            {
                e.Page.AllowBack = false;
                e.Page.AllowNext = false;
            }
        }
        private void wizardControl1_SelectedPageChanging(object sender, DevExpress.XtraWizard.WizardPageChangingEventArgs e)
        {
            if (e.PrevPage == createNewDataStoreWizardPage && e.Direction == Direction.Forward)
            {
                string dataSourceParentName = this.parentTreeListLookUpEdit.Text;
                object dataSourceParentId   = this.parentTreeListLookUpEdit.EditValue;
                string dataSourceName       = this.nameTextEdit.Text;
                string criteriaString       = this.xpCollection1.CriteriaString;
                bool   isItFolder           = isItFolderCheckEdit.Checked;
                bool   isNewNodeValid       = newDataStoreTreeNodeIsValid(dataSourceParentId, dataSourceName, isItFolder);
                if (!isNewNodeValid)
                {
                    nameValidationHint.Properties.State     = DevExpress.Utils.VisualEffects.ValidationHintState.Indeterminate;
                    parentValidationHint.Properties.State   = DevExpress.Utils.VisualEffects.ValidationHintState.Indeterminate;
                    isFolderValidationHint.Properties.State = DevExpress.Utils.VisualEffects.ValidationHintState.Invalid;
                    string s;
                    if (isItFolder)
                    {
                        s = @"[Folder";
                    }
                    else
                    {
                        s = @"[Data Store";
                    }
                    this.isFolderValidationHint.Properties.InvalidState.Text = s + @"'s Name] must be unique inside any parent!";

                    const string msg = ""
                                       + "<b>[Data Store Name]</b> must be <b>unique</b> inside its <b>[Parents Node]</b>"
                                       + "\n"
                                       + "<b>[Folder Name]</b> must be <b>unique</b> inside its <b>[Parent Node]</b>"
                    ;
                    const string title = @"Data Store Wizard Warning";
                    XtraMessageBox.Show(this, msg, title, MessageBoxButtons.OK, MessageBoxIcon.Warning, DefaultBoolean.True);

                    e.Cancel = true;
                }
                else
                {
                    nameValidationHint.Properties.State     = DevExpress.Utils.VisualEffects.ValidationHintState.Valid;
                    parentValidationHint.Properties.State   = DevExpress.Utils.VisualEffects.ValidationHintState.Valid;
                    isFolderValidationHint.Properties.State = DevExpress.Utils.VisualEffects.ValidationHintState.Valid;
                    if (isItFolder)
                    {
                        string text = dataSourceParentName + "/" + dataSourceName;
                        this.completionWizardPage1.FinishText = ""
                                                                + "You have successfully completed the wizard"
                                                                + "\n\n\n"
                                                                + "A new folder will be created after you click [Finish]!"
                                                                + "\n\n\n"
                                                                + text
                        ;
                        e.Page = this.completionWizardPage1;
                    }
                    else
                    {
                        e.Page = this.createNewDataStoreNodeWizardPage;
                        this.parentNameNodeTextEdit.Text = dataSourceParentName;
                        this.nameNodeTextEdit.Text       = dataSourceName;
                    }
                }
            }
            else if (e.PrevPage == createNewDataStoreWizardPage && e.Direction == Direction.Forward)
            {
            }
            else if (e.PrevPage == createNewDataStoreNodeWizardPage && e.Direction == Direction.Forward)
            {
                string text = this.parentTreeListLookUpEdit.Text + "/" + this.nameTextEdit.Text
                              + "\n"
                              + this.syntaxProviderComboBoxEdit.SelectedItem as string
                              + "\n"
                              + this.connectionStringMemoEdit.Text;
                ;

                this.completionWizardPage1.FinishText = ""
                                                        + "You have successfully completed the wizard"
                                                        + "\n\n\n"
                                                        + "A new [node] will be created after you click [Finish]!"
                                                        + "\n\n\n"
                                                        + text
                ;
                e.Page = this.completionWizardPage1;
            }
        }