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(); } }