コード例 #1
0
ファイル: AddContact.cs プロジェクト: RoadHog31/ContactU
 private void BtnSave_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(txtBoxFirstName.Text) || !string.IsNullOrWhiteSpace(txtBoxFirstName.Text))
     {
         contactModel.FirstName = txtBoxFirstName.Text.Trim();
     }
     if (!string.IsNullOrEmpty(txtBoxLastName.Text) || !string.IsNullOrWhiteSpace(txtBoxLastName.Text))
     {
         contactModel.LastName = txtBoxLastName.Text.Trim();
     }
     if (!string.IsNullOrEmpty(txtBoxEmail.Text) || !string.IsNullOrWhiteSpace(txtBoxEmail.Text))
     {
         contactModel.Email = txtBoxEmail.Text.Trim();
     }
     if (!string.IsNullOrEmpty(txtBoxMobile.Text) || !string.IsNullOrWhiteSpace(txtBoxMobile.Text))
     {
         contactModel.Mobile = txtBoxMobile.Text.Trim();
     }
     if (contactModel != null)
     {
         p_addcontactpresenter.AddContact(contactModel);
     }
     else
     {
         return;
     }
 }