public Change getChangeById(Oplitis myOplitis) { Dal myDal = new Dal(); Change myChange = new Change(); SqlDataReader dr = myDal.getChangeById(myOplitis); DataTable dt = new DataTable(); if (dr.HasRows) { dt.Load(dr); } foreach (DataRow row in dt.Rows) { myChange.changeId = Convert.ToInt32(row["c_id"].ToString()); myChange.changeDate = Convert.ToDateTime(row["c_date"].ToString()); myChange.changeOldKatid = Convert.ToInt32(row["kat_id_old"].ToString()); myChange.changeOpid = Convert.ToInt32(row["c_opid"].ToString()); myChange.changeIsxysDate = Convert.ToDateTime(row["c_isxysDate"].ToString()); } return(myChange); }