public Oplitis get_last_updated_oplitis() { Dal myDal = new Dal(); Oplitis myOplitis = new Oplitis(); DataTable dt = new DataTable(); SqlDataReader dr = myDal.getLastUpdatedOplitis(); if (dr.HasRows) { dt.Load(dr); } foreach (DataRow row in dt.Rows) { myOplitis.id = Convert.ToInt32(row["op_id"].ToString()); myOplitis.katigoria = row["kat_name"].ToString(); myOplitis.bathmos = row["r_perigrafi"].ToString(); myOplitis.eponymo = row["op_eponymo"].ToString(); myOplitis.onoma = row["op_onoma"].ToString(); myOplitis.asm = Convert.ToInt32(row["op_asm"].ToString()); myOplitis.loxos = row["op_loxos"].ToString(); myOplitis.paratiriseis = row["op_paratiriseis"].ToString(); myOplitis.katalogisteo = Convert.ToDecimal(row["kat_katalogisteo"].ToString()); myOplitis.kratiseis = Convert.ToDecimal(row["kat_kratiseis"].ToString()); myOplitis.pliroteo = Convert.ToDecimal(row["kat_pliroteo"].ToString()); myOplitis.dXmas = Convert.ToDecimal(row["kat_dx"].ToString()); myOplitis.dPasxa = Convert.ToDecimal(row["kat_dp"].ToString()); myOplitis.metaboli = Convert.ToDateTime(row["op_metaboli"].ToString()); myOplitis.isxysDate = Convert.ToDateTime(row["c_isxys_date"].ToString()); } return(myOplitis); }