private void button_LapThe_Click(object sender, EventArgs e) { if (CheckInfo()) { var docgia = new DataAccess.DataObject.DocGia() { MaTheDG = textBox_MaDocGia.Text, HoTen = textBox_HoTen.Text, LoaiDG = new DataAccess.DataObject.LoaiDocGia() { TenLoaiDocGia = textBox_TenLoaiDocGia.Text }, NgaySinh = dateTimePicker_NgaySinh.Value, DiaChi = textBox_DiaChi.Text, Email = textBox_Email.Text, NgayLapThe = dateTimePicker_NgayLapThe.Value, NgayHetHan = dateTimePicker_NgayHetHan.Value, TongNo = int.Parse(textBox_TongNo.Text) }; Database.AddDocGia(docgia); var isPrint = MessageBox.Show("Bạn có muốn in thẻ đọc giả không ?", "", MessageBoxButtons.YesNo); if (isPrint == DialogResult.Yes) { MessageBox.Show("saved to " + Printer.Print(docgia.ToString())); } Close(); } }
public LapPhieuThuTienPhat(string madocgia) { InitializeComponent(); var materialSkinManager = MaterialSkin.MaterialSkinManager.Instance; materialSkinManager.AddFormToManage(this); materialSkinManager.Theme = MaterialSkin.MaterialSkinManager.Themes.LIGHT; materialSkinManager.ColorScheme = new MaterialSkin.ColorScheme(MaterialSkin.Primary.BlueGrey800, MaterialSkin.Primary.BlueGrey900, MaterialSkin.Primary.BlueGrey500, MaterialSkin.Accent.LightBlue200, MaterialSkin.TextShade.WHITE); docgia = DataAccess.Database.GetDocGia(madocgia); textBox_sotienthu.Focus(); }
private void textBox_madocgia_TextChanged(object sender, EventArgs e) { if (textBox_madocgia.Text.Length == 10) { docgia = Database.GetDocGia(textBox_madocgia.Text); if (docgia != null) { textBox_hoten.Text = docgia.HoTen; textBox_tongno.Text = docgia.TongNo.ToString(); PopulateListView(GetAllForMaDocGia(docgia.MaTheDG)); } } }
private void CapNhatTheDocGia_Load(object sender, EventArgs e) { docgia = Database.GetDocGia(mathedocgia); textBox_MaDocGia.Text = mathedocgia; if (docgia.LoaiDG.TenLoaiDocGia == "X") { radioButton_X.Checked = true; radioButton_Y.Checked = false; } else { radioButton_X.Checked = false; radioButton_Y.Checked = true; } textBox_TenLoaiDocGia.Text = docgia.LoaiDG.TenLoaiDocGia; textBox_HoTen.Text = docgia.HoTen; dateTimePicker_NgaySinh.Value = docgia.NgaySinh; textBox_DiaChi.Text = docgia.DiaChi; textBox_Email.Text = docgia.Email; dateTimePicker_NgayLapThe.Value = docgia.NgayLapThe; textBox_tongno.Text = docgia.TongNo.ToString(); }