コード例 #1
0
ファイル: frmNhaCC.cs プロジェクト: ahhact90/PhuGiaTeam
 private void btnLuu_Click(object sender, EventArgs e)
 {
     if (them == true)
     {
         try
         {
             ecncc.TenNhaCC = txtTen.Text;
             ecncc.Email    = txtEmail.Text;
             ecncc.DiaChi   = txtDiaChi.Text;
             ecncc.Phone    = txtPhone.Text;
             bus.ThemDuLieu(ecncc);
             hienthi("");
             khoa();
         }
         catch
         {
             MessageBox.Show("Lỗi khoogn thể thêm !");
         }
     }
     else
     {
         try
         {
             ecncc.IDNhaCC  = Int32.Parse(txtID.Text);
             ecncc.TenNhaCC = txtTen.Text;
             ecncc.Email    = txtEmail.Text;
             ecncc.DiaChi   = txtDiaChi.Text;
             ecncc.Phone    = txtPhone.Text;
             bus.SuaDuLieu(ecncc);
             hienthi("");
             khoa();
         }
         catch
         {
             MessageBox.Show("Lỗi khoogn thể sửa !");
         }
     }
 }