protected void anadromikaCalculate_Click(object sender, EventArgs e) { if (logosAnadromikon.SelectedIndex == 0) { BLayer myBlayer = new BLayer(); Oplitis myOplitis = new Oplitis(); myOplitis.id = Convert.ToInt32(aa.Text); anadromika.Text = myBlayer.anadromikaCalcLogoKatigorias(myOplitis).ToString(); posoPliromis.Text = anadromika.Text; DateTime mydatetime = new DateTime(); mydatetime = DateTime.Now; priromiDate.Text = mydatetime.Day.ToString() + "/" + mydatetime.Month.ToString() + "/" + mydatetime.Year.ToString(); } else if (logosAnadromikon.SelectedIndex == 1) { BLayer myBlayer = new BLayer(); Oplitis myOplitis = new Oplitis(); myOplitis.id = Convert.ToInt32(aa.Text); decimal poso = myBlayer.anadromikaCalcLogoApousias(myOplitis); anadromika.Text = poso.ToString(); posoPliromis.Text = anadromika.Text; DateTime mydatetime = new DateTime(); mydatetime = DateTime.Now; priromiDate.Text = mydatetime.Day.ToString() + "/" + mydatetime.Month.ToString() + "/" + mydatetime.Year.ToString(); } }
protected void Page_Load(object sender, EventArgs e) { BLayer myBlayer = new BLayer(); Oplitis myOplitis = myBlayer.get_last_updated_oplitis(); aa.Text = myOplitis.id.ToString(); metaboliDate.Text = myOplitis.metaboli.ToString(); asm.Text = myOplitis.asm.ToString(); rank.Text = myOplitis.bathmos.ToString(); fname.Text = myOplitis.onoma.ToString(); lname.Text = myOplitis.eponymo.ToString(); loxos.Text = myOplitis.loxos.ToString(); LabelKatigoria.Text = myOplitis.katigoria.ToString(); paratiriseis.Text = myOplitis.paratiriseis.ToString(); katalogisteo.Text = myOplitis.katalogisteo.ToString(); kratiseis.Text = myOplitis.kratiseis.ToString(); pliroteo.Text = myOplitis.pliroteo.ToString(); dx.Text = myOplitis.dXmas.ToString(); dp.Text = myOplitis.dPasxa.ToString(); isxysMetabolis.Text = myOplitis.isxysDate.ToString(); Oplitis otherOplitis = new Oplitis(); otherOplitis.id = Convert.ToInt32(aa.Text); SqlDataReader myDtr = myBlayer.get_last_updated_oplitis_dik(otherOplitis); BulletedListDikaiologitika.DataSource = myDtr; BulletedListDikaiologitika.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { errorMessage.Visible = false; if (!Page.IsPostBack) { BLayer myBlayer = new BLayer(); DateTime mydatetime = new DateTime(); mydatetime = DateTime.Now; metaboliDate.Text = mydatetime.Day.ToString() + "/" + mydatetime.Month.ToString() + "/" + mydatetime.Year.ToString(); isxysKatigorias.Text = mydatetime.Day.ToString() + "/" + mydatetime.Month.ToString() + "/" + mydatetime.Year.ToString(); SqlDataReader myDtr = myBlayer.get_Rank(); DropDownListRank.DataSource = myDtr; DropDownListRank.DataBind(); SqlDataReader myDtr2 = myBlayer.get_Dikaiologitika(); Dik_Dropdownlist.DataSource = myDtr2; Dik_Dropdownlist.DataBind(); SqlDataReader myDtr4 = myBlayer.get_Oplitis(); GridViewOplitis.DataSource = myDtr4; GridViewOplitis.DataBind(); } }
protected void search_Click(object sender, EventArgs e) { BLayer myBlayer = new BLayer(); TotalOplitis.DataSource = myBlayer.get_Oplitis(); TotalOplitis.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { BLayer myBlayer = new BLayer(); Pliromi myPliromi = new Pliromi(); Oplitis myOplitis = new Oplitis(); myPliromi = myBlayer.get_Last_Pliromi(); aaPliromis.Text = myPliromi.PliromiId.ToString(); priromiDate.Text = myPliromi.PayDay.ToString(); payDate.Text = myPliromi.PayDay.ToString(); asm.Text = myPliromi.p_opasm.ToString(); rank.Text = myPliromi.bathmos.ToString(); fname.Text = myPliromi.onoma.ToString(); lname.Text = myPliromi.eponymo.ToString(); loxos.Text = myPliromi.loxos.ToString(); katigoria.Text = myPliromi.katName.ToString(); katalogisteo.Text = myPliromi.katalogisteo.ToString(); kratiseis.Text = myPliromi.kratiseis.ToString(); pliroteo.Text = myPliromi.pliroteo.ToString(); payType.Text = myPliromi.mPerigrafi.ToString(); opid.Text = myPliromi.Pliromi_opid.ToString(); posoPliromis.Text = myPliromi.Poso.ToString(); myOplitis.id = Convert.ToInt32(opid.Text); SqlDataReader myDtr = myBlayer.get_dikaiologitika_pou_exei_proskomisei_by_id(myOplitis); dikaiologitika.DataSource = myDtr; dikaiologitika.DataBind(); } }
protected void saveButton_Click(object sender, EventArgs e) { try { BLayer myBlayer = new BLayer(); Oplitis myOplitis = new Oplitis(); myOplitis.eggrafi = Convert.ToDateTime(insertDate.Text); myOplitis.asm = Int32.Parse(asm.Text); myOplitis.onoma = fname.Text; myOplitis.eponymo = lname.Text; myOplitis.loxos = loxos.Text; myOplitis.paratiriseis = paratiriseis.Text; myOplitis.bathmos = DropDownListRank.SelectedItem.ToString(); myOplitis.katigoria = TextboxKatigoria.Text; myOplitis.katigoriaFDM = Convert.ToInt32(katigoriaFDM.SelectedValue); if (string.IsNullOrEmpty(lastPayDate.Text)) { DateTime myDT = new DateTime(1 / 1 / 1753); myOplitis.lastPayDay = Convert.ToDateTime(myDT.Day.ToString() + "/" + myDT.Month.ToString() + "/" + myDT.Year.ToString()); } else { myOplitis.lastPayDay = Convert.ToDateTime(lastPayDate.Text); } myBlayer.addOplitis(myOplitis); Page.Response.Redirect("anafora_prosthikis.aspx"); } catch (Exception ex) { errorMessage.Visible = true; errorMessage.Text = ex.Message.ToString(); } }
protected void Submit_Click(object sender, EventArgs e) { try { Oplitis myOplitis = new Oplitis(); BLayer myBlayer = new BLayer(); myOplitis.id = Convert.ToInt32(oplitisid.Text); myOplitis.metaboli = Convert.ToDateTime(metaboliDate.Text); myOplitis.asm = Int32.Parse(asm.Text); myOplitis.onoma = fname.Text; myOplitis.eponymo = lname.Text; myOplitis.loxos = loxos.Text; myOplitis.bathmos = DropDownListRank.SelectedItem.ToString(); myOplitis.paratiriseis = paratiriseis.Text; myOplitis.isxysDate = Convert.ToDateTime(isxysKatigorias.Text); if (string.IsNullOrEmpty(newKatigoria.Text)) { myOplitis.katigoria = currentKatigoria.Text; } else { myOplitis.katigoria = newKatigoria.Text; } myBlayer.updateOplitis(myOplitis); Response.Redirect("anafora_metabolis.aspx"); } catch (Exception ex) { errorMessage.Visible = true; errorMessage.Text = ex.Message.ToString(); } }
protected void CalculateKatigoria_Click(object sender, EventArgs e) { BLayer myBlayer = new BLayer(); Dikaiologitika fermenaDik = new Dikaiologitika(); try { foreach (ListItem li in DikaiologitikaListBox.Items) { fermenaDik.id = Convert.ToInt32(li.Value); fd.Add(fermenaDik); } for (int i = 0; i < fd.Count; i++) { fermenaDik = fd[i]; myBlayer.add_Fermena_Dikaiologitika(fermenaDik); } Katigoria myKatigoria = myBlayer.get_Katigoria_From_Dikaiologitika(); newKatigoria.Text = myKatigoria.katPerigrafi.ToString(); katalogisteo.Text = myKatigoria.katKatalogisteo.ToString(); kratiseis.Text = myKatigoria.katKratiseis.ToString(); pliroteo.Text = myKatigoria.katPliroteo.ToString(); dx.Text = myKatigoria.katDXmas.ToString(); dp.Text = myKatigoria.katDPasxa.ToString(); } catch (Exception ex) { errorMessage.Visible = true; errorMessage.Text = ex.Message.ToString(); } }
protected void register_Click(object sender, EventArgs e) { if (Page.IsValid) { try { string encrypted = FormsAuthentication.HashPasswordForStoringInConfigFile(password.Text, "SHA1"); BLayer myBlayer = new BLayer(); User myUser = new User(); myUser.username = username.Text; myUser.password = encrypted; myUser.userOnoma = fname.Text; myUser.userRank = rank.Text; myUser.userEponymo = lname.Text; myUser.userMonada = monada.Text; int value = myBlayer.register(myUser); if (value == -1) { error.Text = "Το όνομα χρήστη που εισάγατε χρησιμοποιείται ήδη. Παρακαλώ εισάγετε ένα διαφορετικό."; } else { Response.Redirect("../login.aspx"); } } catch (Exception ex) { error.Text = ex.Message.ToString(); } } }
protected void search_Click(object sender, EventArgs e) { BLayer myBlayer = new BLayer(); SqlDataReader myDtr1 = myBlayer.get_Diagrammenos_Oplitis(); deletedOplitis.DataSource = myDtr1; deletedOplitis.DataBind(); }
protected void search_Click(object sender, EventArgs e) { BLayer myBlayer = new BLayer(); SqlDataReader myDtr4 = myBlayer.get_Oplitis(); GridViewOplitis.DataSource = myDtr4; GridViewOplitis.DataBind(); }
protected void search_Click(object sender, EventArgs e) { BLayer myBlayer = new BLayer(); SqlDataReader mydtr = myBlayer.get_Biblio_Pliromon(); TotalPliromes.DataSource = mydtr; TotalPliromes.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { DateTime mydatetime = new DateTime(); mydatetime = DateTime.Now; deleteDate.Text = mydatetime.Day.ToString() + "/" + mydatetime.Month.ToString() + "/" + mydatetime.Year.ToString(); BLayer myBlayer = new BLayer(); TotalOplitis.DataSource = myBlayer.get_Oplitis(); TotalOplitis.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { BLayer myBlayer = new BLayer(); SqlDataReader mydtr = myBlayer.get_Biblio_Pliromon(); TotalPliromes.DataSource = mydtr; TotalPliromes.DataBind(); SqlDataReader mydtr1 = myBlayer.get_Xrimatikos_Logismos(); xrimatikos_logismos.DataSource = mydtr1; xrimatikos_logismos.DataBind(); } }
protected void TotalOplitis_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Select") { BLayer myBlayer = new BLayer(); int row = Convert.ToInt32(e.CommandArgument); int id = Convert.ToInt32(TotalOplitis.DataKeys[row].Values["op_id"].ToString()); otherOplitis.id = id; aa.Text = id.ToString(); lastPaymentsPanel.Visible = true; SqlDataReader myDtr = myBlayer.get_last_payment(otherOplitis); LastPayments.DataSource = myDtr; LastPayments.DataBind(); SqlDataReader myDtr1 = myBlayer.get_last_updated_oplitis_dik(otherOplitis); BulletedListDik.DataSource = myDtr1; BulletedListDik.DataBind(); Katigoria myKatigoria = new Katigoria(); myKatigoria = myBlayer.get_Katigoria_By_Id(otherOplitis); katigoria.Text = myKatigoria.katPerigrafi.ToString(); katalogisteo.Text = myKatigoria.katKatalogisteo.ToString(); kratiseis.Text = myKatigoria.katKratiseis.ToString(); pliroteo.Text = myKatigoria.katPliroteo.ToString(); dp.Text = myKatigoria.katDPasxa.ToString(); dx.Text = myKatigoria.katDXmas.ToString(); RadioButtonListMisthodType.Enabled = true; posoPliromis.Enabled = true; RadioButtonListMisthodType.SelectedIndex = -1; posoPliromis.Text = string.Empty; currentKatigoria.Text = string.Empty; oldKatigoria.Text = string.Empty; isxysKatigorias.Text = string.Empty; metaboliDate.Text = string.Empty; anadromika.Text = string.Empty; PanelAnadromika.Visible = false; anaforaPliromis.Visible = false; panelApousias.Visible = false; panelAllagiKatigorias.Visible = false; logosAnadromikon.SelectedIndex = -1; lastPliromiDate.Text = string.Empty; currentDate.Text = string.Empty; } }
protected void deletedOplitis_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Select") { BLayer myBlayer = new BLayer(); Oplitis myOplitis = new Oplitis(); int row = Convert.ToInt32(e.CommandArgument); int id = Convert.ToInt32(deletedOplitis.DataKeys[row].Values["do_id"].ToString()); lastDeletedPaymentsPanel.Visible = true; myOplitis.id = id; SqlDataReader myDtr = myBlayer.get_pliromi_diagrammenou_opliti_by_id_opliti(myOplitis); LastPayments.DataSource = myDtr; LastPayments.DataBind(); } }
protected void Submit_Click(object sender, EventArgs e) { try { Oplitis myOplitis = new Oplitis(); BLayer myBlayer = new BLayer(); myOplitis.id = Convert.ToInt32(id.Text); myOplitis.diagrafi = Convert.ToDateTime(deleteDate.Text); myBlayer.deleteOplitis(myOplitis); Response.Redirect("anafora_diagrafis.aspx"); } catch (Exception ex) { error.Text = ex.Message.ToString(); } }
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 login_Click(object sender, EventArgs e) { if (Page.IsValid) { string encrypted = FormsAuthentication.HashPasswordForStoringInConfigFile(inputPassword.Text, "SHA1"); BLayer myBlayer = new BLayer(); int value = myBlayer.login(inputUsername.Text, encrypted); if (value == -1) { error.Text = "Το όνομα χρήστη ή/και ο κωδικός είναι λάθος. Παρακαλώ δοκιμάστε ξανά."; } else if (value == 1) { FormsAuthentication.RedirectFromLoginPage(inputUsername.Text, false);//to true na to kano false gia na zita kodiko kathe fora pou anoigo browser Response.Redirect("~/index.aspx"); } } }
public decimal anadromikaCalcLogoKatigorias(Oplitis myOplitis) { Katigoria myKatigoria = new Katigoria(); Change myChange = new Change(); BLayer myBlayer = new BLayer(); myKatigoria = myBlayer.get_diafora_posou(myOplitis); decimal poso = myKatigoria.katDiafora; myChange = myBlayer.getChangeById(myOplitis); DateTime isxysMetabolis = myChange.changeIsxysDate; DateTime metaboliDate = myChange.changeDate; int monthIsxys = isxysMetabolis.Month; int monthMetaboli = metaboliDate.Month; int diafora = monthMetaboli - monthIsxys; decimal anadromika = poso * diafora; return(anadromika); }
protected void saveButton_Click(object sender, EventArgs e) { try { BLayer myBlayer = new BLayer(); Pliromi myPliromi = new Pliromi(); myPliromi.PayDay = Convert.ToDateTime(priromiDate.Text); myPliromi.pmid = Convert.ToInt32(RadioButtonListMisthodType.SelectedValue);// na val0 an o allos den epilexei bathmo na epilegei automata ton bathmo strti myPliromi.Poso = Convert.ToDecimal(posoPliromis.Text); myPliromi.Paid = Convert.ToBoolean(1); myPliromi.Pliromi_opid = Convert.ToInt32(aa.Text); myBlayer.add_Pliromi(myPliromi); Response.Redirect("anafora_pliromis.aspx"); } catch (Exception ex) { error.Visible = true; error.Text = ex.Message.ToString(); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { BLayer myBlayer = new BLayer(); SqlDataReader myDtr = myBlayer.get_Oplitis(); TotalOplitis.DataSource = myDtr; TotalOplitis.DataBind(); SqlDataReader myDtr1 = myBlayer.get_Misthodosia(); RadioButtonListMisthodType.DataSource = myDtr1; RadioButtonListMisthodType.DataBind(); error.Visible = false; anaforaPliromis.Visible = false; //DateTime mydatetime = new DateTime(); //mydatetime = DateTime.Now; //priromiDate.Text = mydatetime.Day.ToString() + "/" + mydatetime.Month.ToString() + "/" + mydatetime.Year.ToString(); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { BLayer myBlayer = new BLayer(); DateTime mydatetime = new DateTime(); mydatetime = DateTime.Now; insertDate.Text = mydatetime.Day.ToString() + "/" + mydatetime.Month.ToString() + "/" + mydatetime.Year.ToString(); SqlDataReader myDtr = myBlayer.get_Rank(); DropDownListRank.DataSource = myDtr; DropDownListRank.DataBind(); SqlDataReader myDtr1 = myBlayer.get_Dikaiologitika(); DikaiologitikaDropdownlist.DataSource = myDtr1; DikaiologitikaDropdownlist.DataBind(); SqlDataReader mydtr2 = myBlayer.get_Katigoria(); katigoriaFDM.DataSource = mydtr2; katigoriaFDM.DataBind(); } }
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; } } }
protected void Page_Load(object sender, EventArgs e) { BLayer myBlayer = new BLayer(); SqlDataReader myDtr = myBlayer.get_dikaiologitika_pou_exei_proskomisei(); BulletedList1.DataSource = myDtr; BulletedList1.DataBind(); Oplitis myOplitis = myBlayer.get_Last_Inserted_Oplitis(); insertDate.Text = myOplitis.eggrafi.ToString(); asm.Text = myOplitis.asm.ToString(); rank.Text = myOplitis.bathmos.ToString(); fname.Text = myOplitis.onoma.ToString(); lname.Text = myOplitis.eponymo.ToString(); loxos.Text = myOplitis.loxos.ToString(); LabelKatigoria.Text = myOplitis.katigoria.ToString(); paratiriseis.Text = myOplitis.paratiriseis.ToString(); katalogisteo.Text = myOplitis.katalogisteo.ToString(); kratiseis.Text = myOplitis.kratiseis.ToString(); pliroteo.Text = myOplitis.pliroteo.ToString(); dx.Text = myOplitis.dXmas.ToString(); dp.Text = myOplitis.dPasxa.ToString(); fdm.Text = myOplitis.fdmDate.ToString(); }
protected void RadioButtonListMisthodType_SelectedIndexChanged(object sender, EventArgs e) { BLayer myBlayer = new BLayer(); PanelAnadromika.Visible = false; if (RadioButtonListMisthodType.SelectedValue == "1") { if (!string.IsNullOrEmpty(katigoria.Text)) { Oplitis anotherOplitis = new Oplitis(); anotherOplitis.id = Convert.ToInt32(aa.Text); Katigoria myKatigoria = new Katigoria(); myKatigoria = myBlayer.get_Katigoria_By_Id(anotherOplitis); posoPliromis.Text = myKatigoria.katPliroteo.ToString(); DateTime mydatetime = new DateTime(); mydatetime = DateTime.Now; priromiDate.Text = mydatetime.Day.ToString() + "/" + mydatetime.Month.ToString() + "/" + mydatetime.Year.ToString(); priromiDate.ReadOnly = true; } } else if (RadioButtonListMisthodType.SelectedValue == "2") { if (!string.IsNullOrEmpty(katigoria.Text)) { int year; Oplitis anotherOplitis = new Oplitis(); anotherOplitis.id = Convert.ToInt32(aa.Text); Katigoria myKatigoria = new Katigoria(); myKatigoria = myBlayer.get_Katigoria_By_Id(anotherOplitis);; posoPliromis.Text = myKatigoria.katDXmas.ToString(); year = DateTime.Now.Year; DateTime mydatetime = new DateTime(year, 12, 16); priromiDate.Text = mydatetime.Day.ToString() + "/" + mydatetime.Month.ToString() + "/" + mydatetime.Year.ToString(); priromiDate.ReadOnly = false; } } else if (RadioButtonListMisthodType.SelectedValue == "3") { if (!string.IsNullOrEmpty(katigoria.Text)) { Oplitis anotherOplitis = new Oplitis(); anotherOplitis.id = Convert.ToInt32(aa.Text); Katigoria myKatigoria = new Katigoria(); myKatigoria = myBlayer.get_Katigoria_By_Id(anotherOplitis);; posoPliromis.Text = myKatigoria.katDPasxa.ToString(); priromiDate.ReadOnly = false; } } else if (RadioButtonListMisthodType.SelectedValue == "4") { PanelAnadromika.Visible = true; error2.Visible = false; priromiDate.ReadOnly = true; try { if (!string.IsNullOrEmpty(katigoria.Text)) { Oplitis myOplitis = new Oplitis(); myOplitis.id = Convert.ToInt32(aa.Text); Katigoria category = myBlayer.get_diafora_posou(myOplitis); currentKatigoria.Text = category.newKatName; oldKatigoria.Text = category.oldKatName; Change myChange = myBlayer.getChangeById(myOplitis); if (myChange.changeId == 0) { isxysKatigorias.Text = string.Empty; metaboliDate.Text = string.Empty; error2.Visible = true; error2.Text = "Ο επιλεγμένος οπλίτης δεν έχει καμία μεταβολή!"; anadromikaCalculate.Visible = false; } else if (currentKatigoria.Text == oldKatigoria.Text) { isxysKatigorias.Text = string.Empty; metaboliDate.Text = string.Empty; error2.Visible = true; error2.Text = "Ο επιλεγμένος οπλίτης δεν δικαιούται αναδρομικά!"; anadromikaCalculate.Visible = false; } else { isxysKatigorias.Text = myChange.changeIsxysDate.ToString(); metaboliDate.Text = myChange.changeDate.ToString(); } } } catch (Exception ex) { error.Visible = true; error.Text = ex.Message.ToString(); } } }