private bool Save() { bool b_Val = false; TienIch.DsTheBH lib = new TienIch.DsTheBH(); if (this.mdbCon == null || this.mdbCon.State != ConnectionState.Open) { Database.Open(ref this.mdbCon); } if (this.mdbCon.State == ConnectionState.Open) { lib.sIDThe = txtIDThe.Text; lib.sSoThe = txtSoThe.Text.Replace("-", "").Trim(); lib.sHoTen = txtHoTen.Text; lib.sBienSoXe = txtBienSoXe.Text; lib.sDiaChi = txtDiaChi.Text; lib.sSDT = txtDienThoai.Text; if (this.bThemMoi) { b_Val = lib.Insert(mdbCon); } else { b_Val = lib.Update(mdbCon); } if (b_Val) { this.bThemMoi = false; } } return(b_Val); }
void LoadThongTinThe(string sData) { sSerialData += sData; if (TienIch.SerialProtocolParser.Check(sSerialData)) { sIDThe = TienIch.SerialProtocolParser.Parser(sSerialData); sSerialData = ""; this.Invoke((MethodInvoker) delegate { TienIch.DsTheBH ds = new TienIch.DsTheBH(); ds.sIDThe = sIDThe; ds.LoadThongTin(this.conn); txtHoTen.Text = ds.sHoTen; txtBienSoXe.Text = ds.sBienSoXe; }); } }
void LoadThongTinThe(string sData) { sSerialData += sData; if (TienIch.SerialProtocolParser.Check(sSerialData)) { sIDThe = TienIch.SerialProtocolParser.Parser(sSerialData); sSerialData = ""; this.Invoke((MethodInvoker) delegate { txtIDThe.Text = sIDThe; TienIch.DsTheBH ds = new TienIch.DsTheBH(); ds.sIDThe = sIDThe; ds.LoadThongTin(this.mdbCon); txtSoThe.Text = ds.sSoThe; txtHoTen.Text = ds.sHoTen; txtBienSoXe.Text = ds.sBienSoXe; txtDienThoai.Text = ds.sSDT; txtDiaChi.Text = ds.sDiaChi; }); } }