Exemplo n.º 1
0
 private void navigationFrame_SelectedPageChanging(object sender, SelectedPageChangingEventArgs e)
 {
     if (navigationFrame.SelectedPage == navigationPage1)
     {
         if (grvCongNhan.RowCount == 0)
         {
             XtraMessageBox.Show(Commons.Modules.ObjLanguages.GetLanguage(this.Name, "msgBanCoChuaChonCongNhan"), Commons.Modules.ObjLanguages.GetLanguage(this.Name, "msgThongBao"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
             e.Cancel = true;
         }
         else
         {
             LoadText();
             dxValidationProvider1.Validate();
         }
     }
 }
Exemplo n.º 2
0
 private void main_Wizard_SelectedPageChanging(object sender, SelectedPageChangingEventArgs e)
 {
     this.Cursor = Cursors.WaitCursor;
     try
     {
         // Validate the current page (if moving forward) and make sure we can proceed
         if (_movingNext && !GetWizardPage(e.SelectedPage).Complete())
         {
             e.Cancel = true;
             return;
         }
     }
     finally
     {
         this.Cursor = Cursors.Default;
     }
 }
Exemplo n.º 3
0
        private void radWizard1_SelectedPageChanging(object sender, SelectedPageChangingEventArgs e)
        {
            if (e.SelectedPage == radWizard1.Pages[1])
            {
                if (txtFolderFac.Text == "" || txtFolderDbBak.Text == "")
                {
                    MessageBox.Show("Debe seleccionar las carpetas requeridas", "Información", MessageBoxButtons.OK, MessageBoxIcon.Error);

                    e.Cancel = true;
                }
            }
            else if (e.SelectedPage == radWizard1.Pages[2])
            {
                if (usuarioEstaCreado == false)
                {
                    MessageBox.Show("Debe crear un Usuario antes de continuar", "Información", MessageBoxButtons.OK, MessageBoxIcon.Error);

                    e.Cancel = true;
                }
            }
        }
        private void createMeasureWizard_SelectedPageChanging(object sender, SelectedPageChangingEventArgs e)
        {
            if (e.NextPage == wizardPage2)
            {
                if (gvBatches.SelectedRows.Count == 1)
                {
                    var selectedBatch = gvBatches.SelectedRows.Single().DataBoundItem as BatchDto;

                    _selectedBatch = selectedBatch;
                }
                else
                {
                    RadMessageBox.Show("Debe seleccionar un lote para continuar");
                    e.Cancel = true;
                }
            }

            if (e.NextPage == wizardCompletionPage1)
            {
                ValidateMeasures(e);
            }
        }
        private void ValidateMeasures(SelectedPageChangingEventArgs e)
        {
            if (_newMeasures != null)
            {
                foreach (var measure in _newMeasures)
                {
                    if (!measure.CreatedDate.HasValue)
                    {
                        RadMessageBox.Show(this, string.Format("Debe ingresar una fecha para la medida {0}", measure.Name));
                        e.Cancel = true;
                        break;
                    }

                    if (!measure.Value.HasValue)
                    {
                        RadMessageBox.Show(this, string.Format("Debe ingresar un valor para la medida {0}", measure.Name));
                        e.Cancel = true;
                        break;
                    }
                }
            }
        }
        private void createMeasureWizard_SelectedPageChanging(object sender, SelectedPageChangingEventArgs e)
        {
            if (e.NextPage == wizardPage2)
            {
                if (gvBatches.SelectedRows.Count == 1)
                {
                    var selectedBatch = gvBatches.SelectedRows.Single().DataBoundItem as BatchDto;

                    _selectedBatch = selectedBatch;
                }
                else
                {
                    RadMessageBox.Show("Debe seleccionar un lote para continuar");
                    e.Cancel = true;
                }
            }

            if (e.NextPage == wizardCompletionPage1)
            {
                ValidateMeasures(e);
            }
        }
Exemplo n.º 7
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender">Instance of Object.</param>
 /// <param name="e">Instance of SelectedPageChangingEventArgs.</param>
 private void mainNavigation_SelectedPageChanging(object sender, SelectedPageChangingEventArgs e)
 {
     RefreshDataSource();
 }
Exemplo n.º 8
0
 private void WizardControl_SelectedPageChanging(object sender, SelectedPageChangingEventArgs e)
 {
     Cursor = Cursors.WaitCursor;
 }
        private void ValidateMeasures(SelectedPageChangingEventArgs e)
        {
            if (_newMeasures != null)
            {
                foreach (var measure in _newMeasures)
                {
                    if (!measure.CreatedDate.HasValue)
                    {
                        RadMessageBox.Show(this, string.Format("Debe ingresar una fecha para la medida {0}", measure.Name));
                        e.Cancel = true;
                        break;
                    }

                    if (!measure.Value.HasValue)
                    {
                        RadMessageBox.Show(this, string.Format("Debe ingresar un valor para la medida {0}", measure.Name));
                        e.Cancel = true;
                        break;
                    }
                }
            }
        }
Exemplo n.º 10
0
        private async void radWizard1_SelectedPageChanging(object sender, SelectedPageChangingEventArgs e)
        {
            errorProvider1.Clear();
            if (e.SelectedPage == wizardPageFather && e.NextPage == wizardPageMother)
            {
                //Leaving father page
                fatherValidateAndShowError();
                if (!_entityValidator.IsValid() || !FatherNameForm.IsValid())
                {
                    e.Cancel = true;
                }
            }
            if (e.SelectedPage == wizardPageMother && e.NextPage == wizardPageFamily)
            {
                //Leaving mother page
                motherValidateAndShowError();
                if (!_entityValidator.IsValid() || !MotherNameForm.IsValid() || !MotherAddressForm.IsValid())
                {
                    e.Cancel = true;
                }
                else
                {
                    setFamilyAddressFromMotherAddress();
                }
            }
            if (e.SelectedPage == wizardPageFamily && (e.NextPage == wizardPageProgress))
            {
                //Leaving family page
                familyValidateAndShowError();
                if (!_entityValidator.IsValid() || !FamilyAddressFormPrimary.IsValid() ||
                    (chkFamilyIsTheyRefugees.Checked && !FamilyAddressFormSecondary.IsValid()))
                {
                    e.Cancel = true;
                }
                else
                {
                    radWizard1.NextButton.Enabled = false;
                    radWizard1.BackButton.Enabled = false;
                    var family = GetFamily();
                    var fam    = await _familyEditViewModel.Add(family);

                    _result = fam != null ? true : false;
                    if (_result)
                    {
                        if (picFamilyFamilyCardphoto1.Photo != null)
                        {
                            await _familyEditViewModel.SaveImage("api/family/media/page1/" + fam.Id, picFamilyFamilyCardphoto1.Photo);
                        }
                        if (picFamilyFamilyCardPhoto2.Photo != null)
                        {
                            await _familyEditViewModel.SaveImage("api/family/media/page2/" + fam.Id, picFamilyFamilyCardPhoto2.Photo);
                        }
                        if (picFatherPhoto.Photo != null)
                        {
                            await _familyEditViewModel.SaveImage($"api/father/media/photo/{fam.FatherId}", picFatherPhoto.Photo);
                        }
                        if (picFatherDeathCertifi.Photo != null)
                        {
                            await _familyEditViewModel.SaveImage($"api/father/media/death/{fam.FatherId}", picFatherDeathCertifi.Photo);
                        }
                        if (picMotherIDFace.Photo != null)
                        {
                            await _familyEditViewModel.SaveImage($"api/mother/media/idface/{fam.MotherId}", picMotherIDFace.Photo);
                        }
                        if (picMotherIDBack.Photo != null)
                        {
                            await _familyEditViewModel.SaveImage($"api/mother/media/idback/{fam.MotherId}", picMotherIDBack.Photo);
                        }
                    }
                    radWizard1.SelectNextPage();
                    radWizard1.NextButton.Enabled = true;
                    radWizard1.BackButton.Enabled = true;
                }
            }
            if (e.SelectedPage == wizardCompletionPage1 && e.NextPage == wizardPageProgress)
            {
                e.Cancel = true;
                radWizard1.SelectedPageChanging -= radWizard1_SelectedPageChanging;
                radWizard1.SelectPreviousPage();
                radWizard1.SelectPreviousPage();
                radWizard1.SelectedPageChanging += radWizard1_SelectedPageChanging;
            }
            if (e.NextPage == wizardCompletionPage1)
            {
                lblResult.Text = _result ? Properties.Resources.FamilyCreatedMessage : Properties.Resources.FamilyCreatedErrorMessage;
            }
        }