private void btnThem_Click(object sender, RoutedEventArgs e)
 {
     UserControlLibrary.WindowThemKhachHang win = new UserControlLibrary.WindowThemKhachHang(mTransit, BOKhachHang);
     if (win.ShowDialog() == true)
     {
         lsArray.Add(win._Item);
         lvData.Items.Refresh();
     }
 }
 private void btnThem_Click(object sender, RoutedEventArgs e)
 {
     UserControlLibrary.WindowThemKhachHang win = new UserControlLibrary.WindowThemKhachHang(mTransit, BOKhachHang);
     if (win.ShowDialog() == true)
     {
         lsArray.Add(win._Item);
         lvData.Items.Refresh();
     }
 }
 private void btnSua_Click(object sender, RoutedEventArgs e)
 {
     if (lvData.SelectedItems.Count > 0)
     {
         UserControlLibrary.WindowThemKhachHang win = new UserControlLibrary.WindowThemKhachHang(mTransit, BOKhachHang);
         win._Item = (Data.BOKhachHang)lvData.SelectedItems[0];
         if (win.ShowDialog() == true)
         {
             lvData.Items.Refresh();
         }
     }
 }
 private void btnSua_Click(object sender, RoutedEventArgs e)
 {
     if (lvData.SelectedItems.Count > 0)
     {
         UserControlLibrary.WindowThemKhachHang win = new UserControlLibrary.WindowThemKhachHang(mTransit, BOKhachHang);
         win._Item = (Data.BOKhachHang)lvData.SelectedItems[0];
         if (win.ShowDialog() == true)
         {
             lvData.Items.Refresh();
         }
     }
 }
Exemple #5
0
 private void ThemMoi()
 {
     UserControlLibrary.WindowThemKhachHang win = new UserControlLibrary.WindowThemKhachHang(mTranSit, null);
     win._TenKhachHang = txtTenKhachHang.Text;
     win._SoDienThoai  = txtSoDienThoai.Text;
     if (win.ShowDialog() == true)
     {
         //AddList(win._Item);
         if (win._Item.KhachHang.KhachHangID == 0)
         {
             mBOKhachHang.Them(win._Item);
         }
         mBOKhachHang.Commit();
         _KhachHang        = win._Item;
         this.DialogResult = true;
     }
 }
        private void ThemMoi()
        {
            UserControlLibrary.WindowThemKhachHang win = new UserControlLibrary.WindowThemKhachHang(mTranSit, null);
            win._TenKhachHang = txtTenKhachHang.Text;
            win._SoDienThoai = txtSoDienThoai.Text;
            if (win.ShowDialog() == true)
            {
                //AddList(win._Item);
                if (win._Item.KhachHang.KhachHangID==0)
                {

                    mBOKhachHang.Them(win._Item);
                }
                mBOKhachHang.Commit();
                _KhachHang = win._Item;
                this.DialogResult = true;
            }
        }