Example #1
0
        private void bProviderAdd_Click(object sender, System.EventArgs e)
        {
            FormProviderActions formProvider = new FormProviderActions();

            if (formProvider.ShowDialog(null, DbActionsEnum.Create) == DialogResult.OK)
            {
                DbValidation.Instance.saveProvider(formProvider.ResultProvider);
                foreach (ProviderPhoneDB phone in formProvider.Phones)
                {
                    phone.ProviderId = formProvider.ResultProvider.Id;
                    DbValidation.Instance.saveProviderPhone(phone);
                }
                this.refreshSearchProviderByName();
            }
        }
Example #2
0
        private void bProviderModify_Click(object sender, System.EventArgs e)
        {
            FormProviderActions formProvider = new FormProviderActions();

            if (formProvider.ShowDialog(lbProviders.SelectedItem as ProviderDB, DbActionsEnum.Update) == DialogResult.OK)
            {
                DbValidation.Instance.saveProvider(formProvider.ResultProvider);
                foreach (ProviderPhoneDB phone in formProvider.Phones)
                {
                    phone.ProviderId = formProvider.ResultProvider.Id;
                    DbValidation.Instance.saveProviderPhone(phone);
                }
                foreach (ProviderPhoneDB phone in formProvider.DeletedPhones)
                {
                    DbValidation.Instance.deleteProviderPhone(phone);
                }
                this.refreshSearchProviderByName();
            }
        }
Example #3
0
        private void bProviderView_Click(object sender, System.EventArgs e)
        {
            FormProviderActions formProvider = new FormProviderActions();

            formProvider.ShowDialog(lbProviders.SelectedItem as ProviderDB, DbActionsEnum.Show);
        }