private void btnCalc_Click(object sender, EventArgs e) { if (rdbPartTime.Checked is false && rdbFulltime.Checked is false) { MessageBox.Show("You must choose the job's frequency."); return; } txtDailyW.Text = WorkActions.CalculateDay(workDays, rdbPartTime, dtpWork.Value).ToString(); txtMonthW.Text = WorkActions.CalculateMonth(workDays, rdbPartTime, dtpWork.Value.Month, dtpWork.Value.Year).ToString(); txtYearW.Text = WorkActions.CalculateYear(workDays, rdbPartTime, dtpWork.Value.Year).ToString(); }
private void dtpWork_Leave(object sender, EventArgs e) { try { if (lsbData.Items.Count == 0) { throw new Exception("No data."); } txtDailyW.Text = WorkActions.CalculateDay(workDays, rdbPartTime, dtpWork.Value).ToString(); txtMonthW.Text = WorkActions.CalculateMonth(workDays, rdbPartTime, dtpWork.Value.Month, dtpWork.Value.Year).ToString(); txtYearW.Text = WorkActions.CalculateYear(workDays, rdbPartTime, dtpWork.Value.Year).ToString(); } catch (Exception) { txtDailyW.Text = string.Empty; } }