public decimal anadromikaCalcLogoApousias(Oplitis myOplitis) { BLayer myBlayer = new BLayer(); Katigoria category = new Katigoria(); category = myBlayer.get_Katigoria_By_Id(myOplitis); decimal poso = category.katPliroteo; Pliromi myPliromi = new Pliromi(); myPliromi = myBlayer.get_Last_Pliromi_By_Opid(myOplitis); DateTime lastPayDate = myPliromi.PayDay; DateTime currentDate = DateTime.Now; int diafora = currentDate.Month - lastPayDate.Month; decimal anadromika = diafora * poso; return(anadromika); }
protected void logosAnadromikon_SelectedIndexChanged(object sender, EventArgs e) { BLayer myBlayer = new BLayer(); error3.Visible = false; anadromika.Text = string.Empty; posoPliromis.Text = string.Empty; if (logosAnadromikon.SelectedIndex == 0) { panelAllagiKatigorias.Visible = true; panelApousias.Visible = false; anadromikaCalculate.Visible = true; } else if (logosAnadromikon.SelectedIndex == 1) { panelApousias.Visible = true; anadromikaCalculate.Visible = true; panelAllagiKatigorias.Visible = false; DateTime mydatetime = new DateTime(); mydatetime = DateTime.Now; currentDate.Text = mydatetime.Day.ToString() + "/" + mydatetime.Month.ToString() + "/" + mydatetime.Year.ToString(); Pliromi otherPliromi = new Pliromi(); otherOplitis.id = Convert.ToInt32(aa.Text); otherPliromi = myBlayer.get_Last_Pliromi_By_Opid(otherOplitis); lastPliromiDate.Text = otherPliromi.PayDay.ToString(); if (Convert.ToDateTime(currentDate.Text) == Convert.ToDateTime(lastPliromiDate.Text)) { anadromikaCalculate.Visible = false; error3.Visible = true; error3.Text = "Ο επιλεγμένος οπλίτης δεν δικαιούται αναδρομικά λόγω απουσίας!"; } else { anadromikaCalculate.Visible = true; error3.Visible = false; } } }