private void FormMainMenuMaster_Load(object sender, EventArgs e) { lblUser.Text = dataPassing; lblDate.Text = DateTime.Now.ToShortDateString(); lblTime.Text = DateTime.Now.ToLongTimeString(); Admin CheckContract = new Admin(); ArrayList data_contract = CheckContract.CheckContractExpiration(); for (int i = 0; i < data_contract.Count; i = i + 2) { string ContractNumber = (string)data_contract[i]; string ContractEndDate = (string)data_contract[i + 1]; string TodayDate = DateTime.Today.ToShortDateString(); string Date1 = DateTime.Today.AddDays(-1).ToShortDateString(); string Date2 = DateTime.Today.AddDays(-2).ToShortDateString(); string Date3 = DateTime.Today.AddDays(-3).ToShortDateString(); string Date4 = DateTime.Today.AddDays(-4).ToShortDateString(); string Date5 = DateTime.Today.AddDays(-5).ToShortDateString(); string Date6 = DateTime.Today.AddDays(-6).ToShortDateString(); string Date7 = DateTime.Today.AddDays(-7).ToShortDateString(); string Date8 = DateTime.Today.AddDays(-8).ToShortDateString(); string Date9 = DateTime.Today.AddDays(-9).ToShortDateString(); string Date10 = DateTime.Today.AddDays(-10).ToShortDateString(); string Date11 = DateTime.Today.AddDays(-11).ToShortDateString(); string Date12 = DateTime.Today.AddDays(-12).ToShortDateString(); string Date13 = DateTime.Today.AddDays(-13).ToShortDateString(); string Date14 = DateTime.Today.AddDays(-14).ToShortDateString(); string Date15 = DateTime.Today.AddDays(-15).ToShortDateString(); string Date16 = DateTime.Today.AddDays(-16).ToShortDateString(); string Date17 = DateTime.Today.AddDays(-17).ToShortDateString(); string Date18 = DateTime.Today.AddDays(-18).ToShortDateString(); string Date19 = DateTime.Today.AddDays(-19).ToShortDateString(); string Date20 = DateTime.Today.AddDays(-20).ToShortDateString(); string Date21 = DateTime.Today.AddDays(-21).ToShortDateString(); string Date22 = DateTime.Today.AddDays(-22).ToShortDateString(); string Date23 = DateTime.Today.AddDays(-23).ToShortDateString(); string Date24 = DateTime.Today.AddDays(-24).ToShortDateString(); string Date25 = DateTime.Today.AddDays(-25).ToShortDateString(); string Date26 = DateTime.Today.AddDays(-26).ToShortDateString(); string Date27 = DateTime.Today.AddDays(-27).ToShortDateString(); string Date28 = DateTime.Today.AddDays(-28).ToShortDateString(); string Date29 = DateTime.Today.AddDays(-29).ToShortDateString(); string Date30 = DateTime.Today.AddDays(-30).ToShortDateString(); string Date31 = DateTime.Today.AddDays(-31).ToShortDateString(); if (ContractEndDate == TodayDate || ContractEndDate == Date1 || ContractEndDate == Date2 || ContractEndDate == Date3 || ContractEndDate == Date4 || ContractEndDate == Date5 || ContractEndDate == Date6 || ContractEndDate == Date7 || ContractEndDate == Date8 || ContractEndDate == Date9 || ContractEndDate == Date10 || ContractEndDate == Date11 || ContractEndDate == Date12 || ContractEndDate == Date13 || ContractEndDate == Date14 || ContractEndDate == Date15 || ContractEndDate == Date16 || ContractEndDate == Date17 || ContractEndDate == Date18 || ContractEndDate == Date19 || ContractEndDate == Date20 || ContractEndDate == Date21 || ContractEndDate == Date22 || ContractEndDate == Date23 || ContractEndDate == Date24 || ContractEndDate == Date25 || ContractEndDate == Date26 || ContractEndDate == Date27 || ContractEndDate == Date28 || ContractEndDate == Date29 || ContractEndDate == Date30 || ContractEndDate == Date31) { Console.Beep(); Console.Beep(); Console.Beep(); Console.Beep(); notifyContract.Text = "Contract Expired"; notifyContract.Visible = true; notifyContract.BalloonTipTitle = "Contract Expired"; notifyContract.BalloonTipText = "Click Here to see details"; notifyContract.ShowBalloonTip(300000000); } } }