private void frmKhachHang_Load(object sender, EventArgs e) { TaiKhoan tk = TaiKhoanDAL.layTaiKhoan(this.Text); txbGiaDV.Text = DichVuDAL.layGiaDV().ToString() + " đồng/h"; TimeSpan tongTG = LayTimeSpan(tk.TongTG.Value); TimeSpan tgConLai = LayTimeSpan(tk.TGconLai.Value); txbTGconLai.Text = XuLyDAL.chuyenTimeSpanVeString(tgConLai); txbTGsuDung.Text = "00:00:00"; txbTongTG.Text = XuLyDAL.chuyenTimeSpanVeString(tongTG); }
private void timerBamGio_Tick(object sender, EventArgs e) { TimeSpan timetick = DateTime.Now - timeStart; if (tf == 0) { khh = LayTimeSpan(TaiKhoanDAL.layTaiKhoan(this.Text).TGconLai.Value); } tf = 1; TimeSpan tmp = new TimeSpan(0, 0, 1); khh -= tmp; txbTGsuDung.Text = XuLyDAL.chuyenTimeSpanVeString(timetick); txbTGconLai.Text = XuLyDAL.chuyenTimeSpanVeString(khh); }