private void eTimerCheck(object sender, EventArgs e, udtFeeData data) { if ("TIMER".Equals(data.controlInfo)) { // 시간을 어떻게 계산해야 될까... // 머리가 안돌아가네 // 오재영 때문이야 ㅡㅡ if (int.Parse(data.usedTime) > 30) { // 초과시간 계산 해야될수도있음 udtStatistics.totalFee += udtFeeOption.HourlyRateHour; udtStatistics.totalUsedTime += 60; } else { udtStatistics.totalFee += udtFeeOption.HourlyRateHalf; udtStatistics.totalUsedTime += 30; } } else { udtStatistics.totalFee += int.Parse(data.usedFee); udtStatistics.totalUsedTime += int.Parse(data.usedTime); } udtStatistics.totalNumOfUses++; ucStatistics.AddData(udtStatistics); }
private void BtnStart_Click(object sender, EventArgs e) { if (null != tbTime.Text && 0 < tbTime.Text.Length && !"0".Equals(tbTime.Text)) { if (Properties.Resources.End.ToString().Equals(btnStart.Text)) { this.Player.Stop(); btnStart.Text = Properties.Resources.Start.ToString(); tbTime.Enabled = true; if (null != timerVR) { timerVR.Stop(); } ProgressbarInit(); nDelayTime = 0; this.BackColor = System.Drawing.Color.Transparent; this.pbxTimerState.Image = global::VRTimer.Properties.Resources.GrayCircle; udtFeeData = new udtFeeData(); udtFeeData.controlInfo = "TIMER"; udtFeeData.usedFee = lbTime.Text; udtFeeData.usedTime = tbTime.Text; eTempDataBridge(sender, e, udtFeeData); eStartBtn(sender, e); return; } else { tbExcessTime.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(142)))), ((int)(((byte)(142)))), ((int)(((byte)(142))))); this.pbxTimerState.Image = global::VRTimer.Properties.Resources.GreenCircle; btnStart.Text = Properties.Resources.End.ToString(); tbTime.Enabled = false; string sStartTime = DateTime.Now.ToString(Properties.Resources.StartTimeForm.ToString()); lbStartTime.Text = sStartTime; //lbTime.Text = "30"; try { nMaxTime = int.Parse(tbTime.Text.ToString()) * 60; } catch (Exception ex) { MessageBox.Show(Properties.Resources.InputPayErrorMessage.ToString()); return; } } } else { MessageBox.Show(Properties.Resources.MinimumTimeErrorMessage.ToString()); return; } //pbTimer.Maximum = nMaxTime; timerVR.Start(); eStartBtn(sender, e); }