private void btTiepNhan_Click(object sender, EventArgs e) { TiepNhan tn = new TiepNhan(); tn.LoaiTN = "KH"; tn.SoHoSo = this.txtSoHoSo.Text; tn.DanhBo = this.txtSoDanhBo.Text; tn.DienThoai = this.txtDienThoai.Text; tn.TenKH = this.txtTenKH.Text; tn.SoNha = this.txtsonha.Text; tn.TenDuong = this.txtDuong.Text; tn.Phuong = this.cbPhuong.SelectedValue + ""; tn.Quan = this.cbQuan.SelectedValue + ""; tn.LoaiHs = this.cbLoaiTiepNhan.SelectedValue + ""; tn.NgayNhan = DateTime.Now; tn.ChuyenHS = true; tn.NgayChuyen = DateTime.Now; tn.DonViChuyen = "TCTB"; tn.Mess = true; tn.GhiChu = this.txtGhiChu.Text; tn.CreateBy = CNguoiDung.HoTen + ""; tn.CreateDate = DateTime.Now; if (CTiepNhanDon.Insert(tn)) { MessageBox.Show(this, "Tiếp Nhận Thông Tin Thành Công!", "..: Thông Báo :..", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show(this, "Tiếp Nhận Thông Tin Thất Bại !", "..: Thông Báo :..", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public void fLoad( ) { txtSoHoSo.Text = CTiepNhanDon.IdentityBienNhan(); cbLoaiTiepNhan.DataSource = CTiepNhanDon.getLoaiTiepNhan("BB"); cbLoaiTiepNhan.DisplayMember = "TenLoai"; cbLoaiTiepNhan.ValueMember = "ID"; try { List <TENDUONG> list = CHeThongDuong.getList(); foreach (var item in list) { namesCollection.Add(item.DUONG); } txtDuong.AutoCompleteMode = AutoCompleteMode.Suggest; txtDuong.AutoCompleteSource = AutoCompleteSource.CustomSource; txtDuong.AutoCompleteCustomSource = namesCollection; this.cbPhuong.DataSource = CHeThongDuong.getListPhuong(); this.cbPhuong.DisplayMember = "Display"; this.cbPhuong.ValueMember = "Value"; cbQuan.DataSource = CHeThongDuong.getListQUAN(); cbQuan.DisplayMember = "Display"; cbQuan.ValueMember = "Value"; } catch (Exception) { } }