private void btnAdd_Click(object sender, EventArgs e) { if (dialog.ShowDialog() == DialogResult.OK) { try { addressbook.FKStateId = dialog.FKSatteId; addressbook.FKUserId = dialog.FKuserID; addressbook.FirstName = dialog.FirstName; addressbook.LastName = dialog.LastName; addressbook.EmailId = dialog.EmailId; addressbook.PhoneNo = dialog.PhoneNo; addressbook.Address1 = dialog.Address1; addressbook.Address2 = dialog.Address2; addressbook.Street = dialog.Street; addressbook.City = dialog.City; addressbook.ZipCode = dialog.ZipCode; addressbook.IsActive = dialog.IsActive; interaction.AddData(addressbook, 4); } catch (Exception) { MessageBox.Show("problem in the add of addressform"); } } dgvAddressBook.DataSource = interaction.Getdetails(4); }
private void btnAdd_Click(object sender, EventArgs e) { state = new State(); StateDialog dialog = new StateDialog(); if (dialog.ShowDialog() == DialogResult.OK) { try { state.FKCountryId = dialog.CountryId; state.StateName = dialog.StateName; state.IsActive = dialog.IsActive; Interaction.AddData(state, 2); } catch (Exception) { MessageBox.Show("you are in the stateform Add"); } } dgvState.DataSource = Interaction.Getdetails(2); }
private void btnAdd_Click(object sender, EventArgs e) { if (userDialog.ShowDialog() == DialogResult.OK) { try { user.UserName = userDialog.UserName; user.Password = userDialog.Password; user.FirstName = userDialog.FirstName; user.LastName = userDialog.LastName; user.EmailId = userDialog.EmailId; user.PhoneNo = userDialog.PhoneNo; user.IsActive = userDialog.IsActive; Interaction.AddData(user, 3); } catch (Exception) { MessageBox.Show("check the add in the user"); } } dgvUser.DataSource = Interaction.Getdetails(3); }
private void btnAdd_Click(object sender, EventArgs e) { Country country = new Country(); CountryDialog = new CountryDialog(); if (CountryDialog.ShowDialog() == DialogResult.OK) { try { country.CountryName = CountryDialog.CountryName; country.ZipCodeStart = CountryDialog.ZipStart; country.ZipCodeEnd = CountryDialog.ZipEnd; country.IsActive = CountryDialog.IsActive; Interaction.AddData(country, 1); } catch (Exception) { MessageBox.Show("In add button of the country"); } dgvCountry.DataSource = Interaction.Getdetails(1); } }
private void lkRegister_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { UserDialog dialog = new UserDialog(); if (dialog.ShowDialog() == DialogResult.OK) { if (interaction.UniqueUser(dialog.UserName) == false) { detail.UserName = dialog.UserName; detail.Password = dialog.Password; detail.FirstName = dialog.FirstName; detail.LastName = dialog.LastName; detail.EmailId = dialog.EmailId; detail.PhoneNo = dialog.PhoneNo; detail.IsActive = dialog.IsActive; interaction.AddData(detail, 3); } else { MessageBox.Show("Fool you are already in the system.\nGo and "); } } }