コード例 #1
0
ファイル: Bibl.cs プロジェクト: UchihaDanShal/Bookashka
 private void buttonEdit_Click(object sender, EventArgs e)
 {
     if (listViewBibl.SelectedItems.Count == 1)
     {
         BiblSet biblSet = listViewBibl.SelectedItems[0].Tag as BiblSet;
         biblSet.FirstName  = textBoxFirstName.Text;
         biblSet.MiddleName = textBoxMiddleName.Text;
         biblSet.LastName   = textBoxLastName.Text;
         biblSet.Phone      = textBoxPhone.Text;
         biblSet.Email      = textBoxEmail.Text;
         Program.wftDb.SaveChanges();
         ShowClient();
     }
 }
コード例 #2
0
ファイル: Bibl.cs プロジェクト: UchihaDanShal/Bookashka
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            BiblSet biblSet = new BiblSet();

            biblSet.FirstName  = textBoxFirstName.Text;
            biblSet.MiddleName = textBoxMiddleName.Text;
            biblSet.LastName   = textBoxLastName.Text;
            biblSet.Phone      = textBoxPhone.Text;
            biblSet.Email      = textBoxEmail.Text;

            Program.wftDb.BiblSet.Add(biblSet);

            Program.wftDb.SaveChanges();
            ShowClient();
        }
コード例 #3
0
ファイル: Bibl.cs プロジェクト: UchihaDanShal/Bookashka
 private void listViewBibl_SelectedIndexChanged_1(object sender, EventArgs e)
 {
     if (listViewBibl.SelectedItems.Count == 1)
     {
         BiblSet biblSet = listViewBibl.SelectedItems[0].Tag as BiblSet;
         biblSet.FirstName  = textBoxFirstName.Text;
         biblSet.MiddleName = textBoxMiddleName.Text;
         biblSet.LastName   = textBoxLastName.Text;
         biblSet.Phone      = textBoxPhone.Text;
         biblSet.Email      = textBoxEmail.Text;
     }
     else
     {
         textBoxFirstName.Text  = "";
         textBoxMiddleName.Text = "";
         textBoxLastName.Text   = "";
         textBoxPhone.Text      = "";
         textBoxEmail.Text      = "";
     }
 }
コード例 #4
0
ファイル: Bibl.cs プロジェクト: UchihaDanShal/Bookashka
 private void buttonDel_Click(object sender, EventArgs e)
 {
     try
     {
         if (listViewBibl.SelectedItems.Count == 1)
         {
             BiblSet biblSet = listViewBibl.SelectedItems[0].Tag as BiblSet;
             Program.wftDb.BiblSet.Remove(biblSet);
             Program.wftDb.SaveChanges();
             ShowClient();
         }
         textBoxFirstName.Text  = "";
         textBoxMiddleName.Text = "";
         textBoxLastName.Text   = "";
         textBoxPhone.Text      = "";
         textBoxEmail.Text      = "";
     }
     catch
     {
         MessageBox.Show("Невозможно удалить, эта запись используется!", "Ошибка!", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }