Esempio n. 1
0
        private void dispatcherTimer_Tick(object sender, EventArgs e)
        {
            try
            {
                if (Properties.Settings.Default.idCus > 0)
                {
                    db.Refresh(RefreshMode.KeepChanges, objCus);
                    spinPrice.EditValue = db.funCheckPrice(objClient.idClient).GetValueOrDefault();

                    txtTimePlay.Text = db.funConvertTime(SqlMethods.DateDiffSecond(objLoginCus.startTime, db.funGetdate()));

                    spinMoney.EditValue        = string.Format("{0}", SqlMethods.DateDiffSecond(objLoginCus.startTime, db.funGetdate()) * (db.funCheckPrice(objClient.idClient) / 3600));
                    spinCurrentMoney.EditValue = objCus.currentMoney.GetValueOrDefault();
                    txtEndtime.Text            = db.funConvertTime((int)(objCus.currentMoney.GetValueOrDefault() * 3600 / db.funCheckPrice(objClient.idClient).GetValueOrDefault()));
                    //if (objClient.IsExit == true)
                    //{
                    //    if (objLoginCus != null)
                    //    {
                    //        db.Login_Customers.DeleteOnSubmit(objLoginCus);
                    //        db.SubmitChanges();
                    //    }
                    //    System.Diagnostics.Process.Start("shutdown", "-s -f -t 5");
                    //}
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message); }
        }