protected void Page_Load(object sender, EventArgs e) { string path = HttpContext.Current.Server.MapPath("~/App_Data/Palautteet.xml"); palautteet teet = new palautteet(); teet = (palautteet)XMLDeserialize(path); for (int i = 0; i < teet.palaute.Count; i++) { TableRow row = new TableRow(); TableCell cell = new TableCell(); TableCell cell1 = new TableCell(); TableCell cell2 = new TableCell(); TableCell cell3 = new TableCell(); TableCell cell4 = new TableCell(); TableCell cell5 = new TableCell(); cell.Text = teet.palaute[i].tekija; cell1.Text = teet.palaute[i].opittu; cell2.Text = teet.palaute[i].haluanoppia; cell3.Text = teet.palaute[i].hyvaa; cell4.Text = teet.palaute[i].parannettavaa; cell5.Text = teet.palaute[i].muuta; row.Cells.Add(cell); row.Cells.Add(cell1); row.Cells.Add(cell2); row.Cells.Add(cell3); row.Cells.Add(cell4); row.Cells.Add(cell5); Table1.Rows.Add(row); } }
protected void Page_Load(object sender, EventArgs e) { string polku = HttpContext.Current.Server.MapPath("~/App_Data/Palautteet.xml"); palautteet pal = new palautteet(); pal = (palautteet)XMLDeserialize(polku); TableRow r = new TableRow(); TableCell c = new TableCell(); TableCell c0 = new TableCell(); TableCell c1 = new TableCell(); TableCell c2 = new TableCell(); TableCell c3 = new TableCell(); TableCell c4 = new TableCell(); TableCell c5 = new TableCell(); c.Text = "Pvm"; c0.Text = "Nimi"; c1.Text = "Opittu"; c2.Text = "Haluan oppia"; c3.Text = "Hyvää"; c4.Text = "Parannettavaa"; c5.Text = "Muuta"; r.Cells.Add(c); r.Cells.Add(c0); r.Cells.Add(c1); r.Cells.Add(c2); r.Cells.Add(c3); r.Cells.Add(c4); r.Cells.Add(c5); tblPalautteet.Rows.Add(r); for (int i = 0; i < pal.palaute.Count; i++) { TableRow row = new TableRow(); TableCell cell = new TableCell(); TableCell cell0 = new TableCell(); TableCell cell1 = new TableCell(); TableCell cell2 = new TableCell(); TableCell cell3 = new TableCell(); TableCell cell4 = new TableCell(); TableCell cell5 = new TableCell(); cell.Text = pal.palaute[i].pvm; cell0.Text = pal.palaute[i].tekija; cell1.Text = pal.palaute[i].opittu; cell2.Text = pal.palaute[i].haluanoppia; cell3.Text = pal.palaute[i].hyvaa; cell4.Text = pal.palaute[i].parannettavaa; cell5.Text = pal.palaute[i].muuta; row.Cells.Add(cell); row.Cells.Add(cell0); row.Cells.Add(cell1); row.Cells.Add(cell2); row.Cells.Add(cell3); row.Cells.Add(cell4); row.Cells.Add(cell5); tblPalautteet.Rows.Add(row); } }
protected void Page_Load(object sender, EventArgs e) { string path = HttpContext.Current.Server.MapPath("~/App_Data/Palautteet.xml"); palautteet teet = new palautteet(); teet = (palautteet)XMLDeserialize(path); for (int i = 0; i < teet.palaute.Count; i++) { TableRow row = new TableRow(); TableCell cell = new TableCell(); TableCell cell1 = new TableCell(); TableCell cell2 = new TableCell(); TableCell cell3 = new TableCell(); TableCell cell4 = new TableCell(); TableCell cell5 = new TableCell(); cell.Text = teet.palaute[i].tekija; cell1.Text = teet.palaute[i].opittu; cell2.Text = teet.palaute[i].haluanoppia; cell3.Text = teet.palaute[i].hyvaa; cell4.Text = teet.palaute[i].parannettavaa; cell5.Text = teet.palaute[i].muuta; row.Cells.Add(cell); row.Cells.Add(cell1); row.Cells.Add(cell2); row.Cells.Add(cell3); row.Cells.Add(cell4); row.Cells.Add(cell5); Table1.Rows.Add(row); } }
public static palautteet XMLDeserialize(string filename) { XmlSerializer ser = null; FileStream fs = null; palautteet teet = new palautteet(); ser = new XmlSerializer(typeof(palautteet)); fs = new FileStream(filename, FileMode.Open); teet = (palautteet)ser.Deserialize(fs); if (fs != null) fs.Close(); return teet; }
public static palautteet XMLDeserialize(string filename) { XmlSerializer xs = null; FileStream fs = null; palautteet pal = new palautteet(); xs = new XmlSerializer(typeof(palautteet)); fs = new FileStream(filename, FileMode.Open); pal = (palautteet)xs.Deserialize(fs); if (fs != null) fs.Close(); return pal; }
public static palautteet XMLDeserialize(string filename) { XmlSerializer ser = null; FileStream fs = null; palautteet teet = new palautteet(); ser = new XmlSerializer(typeof(palautteet)); fs = new FileStream(filename, FileMode.Open); teet = (palautteet)ser.Deserialize(fs); if (fs != null) { fs.Close(); } return(teet); }
protected void Page_Load(object sender, EventArgs e) { string polku = HttpContext.Current.Server.MapPath("~/App_Data/Palautteet.xml"); palautteet pal = new palautteet(); pal = (palautteet)XMLDeserialize(polku); TableRow r = new TableRow(); TableCell c = new TableCell(); TableCell c0 = new TableCell(); TableCell c1 = new TableCell(); TableCell c2 = new TableCell(); TableCell c3 = new TableCell(); TableCell c4 = new TableCell(); TableCell c5 = new TableCell(); c.Text = "Pvm"; c0.Text = "Nimi"; c1.Text = "Opittu"; c2.Text = "Haluan oppia"; c3.Text = "Hyvää"; c4.Text = "Parannettavaa"; c5.Text = "Muuta"; r.Cells.Add(c); r.Cells.Add(c0); r.Cells.Add(c1); r.Cells.Add(c2); r.Cells.Add(c3); r.Cells.Add(c4); r.Cells.Add(c5); tblPalautteet.Rows.Add(r); for (int i = 0; i < pal.palaute.Count; i++) { TableRow row = new TableRow(); TableCell cell = new TableCell(); TableCell cell0 = new TableCell(); TableCell cell1 = new TableCell(); TableCell cell2 = new TableCell(); TableCell cell3 = new TableCell(); TableCell cell4 = new TableCell(); TableCell cell5 = new TableCell(); cell.Text = pal.palaute[i].pvm; cell0.Text = pal.palaute[i].tekija; cell1.Text = pal.palaute[i].opittu; cell2.Text = pal.palaute[i].haluanoppia; cell3.Text = pal.palaute[i].hyvaa; cell4.Text = pal.palaute[i].parannettavaa; cell5.Text = pal.palaute[i].muuta; row.Cells.Add(cell); row.Cells.Add(cell0); row.Cells.Add(cell1); row.Cells.Add(cell2); row.Cells.Add(cell3); row.Cells.Add(cell4); row.Cells.Add(cell5); tblPalautteet.Rows.Add(row); } }