public void SetQuestion(int x) { SaveOpenedFiles.ClosePowerPoint(); proID = x; ppt = ClientControl.GetOfficePowerPoint(proID); this.Question.Text = ppt.problem; this.filename = "f" + proID.ToString() + ".ppt"; }
public static void AddOfficePowerPoint(OfficePowerPoint ppt) { paper.Add(ppt); }
public List<OfficePowerPoint> FindOfficePowerPointByPID(int PID) { List<OfficePowerPoint> result = new List<OfficePowerPoint>(); List<Office> tmp = new List<Office>(); try { tmp = FindOfficeByPID(PID); } catch (SqlException ex) { Console.WriteLine(ex.ToString()); } foreach (Office prob in tmp) { OfficePowerPoint op = new OfficePowerPoint(); op.Plevel = prob.Plevel; op.problem = prob.problem; op.problemId = prob.problemId; op.type = prob.type; op.unit = prob.unit; result.Add(op); } return result; }
private List<OfficePowerPoint> DataSetToListOfficePowerPoint(DataSet Ds) { DataTable p_Data = Ds.Tables[0]; // 返回值初始化 List<OfficePowerPoint> powerPoint = new List<OfficePowerPoint>(); for (int j = 0; j < p_Data.Rows.Count; j++) { OfficePowerPoint problem = new OfficePowerPoint(); problem.problemId = Convert.ToInt32(p_Data.Rows[j]["PID"]); problem.problem = p_Data.Rows[j]["PContent"].ToString(); problem.unit.UnitId = Convert.ToInt32(p_Data.Rows[j]["Unit"]); problem.unit.UnitName = p_Data.Rows[j]["UnitName"].ToString(); problem.Plevel = Convert.ToInt32(p_Data.Rows[j]["PLevel"]); powerPoint.Add(problem); } return powerPoint; }
private List<Office> DataSetToListOffice(DataSet Ds) { DataTable p_Data = Ds.Tables[0]; List<Office> office = new List<Office>(); for (int j = 0; j < p_Data.Rows.Count; j++) { Office problem = new Office(); switch ((Office.OfficeType)Convert.ToInt32(p_Data.Rows[j]["Type"])) { case Office.OfficeType.Word: { problem=new OfficeWord(); problem.type=ProblemType.Word; break; } case Office.OfficeType.Excel: { problem = new OfficeExcel(); problem.type = ProblemType.Excel; break; } case Office.OfficeType.PowerPoint: { problem = new OfficePowerPoint(); problem.type = ProblemType.PowerPoint; break; } } problem.problemId = Convert.ToInt32(p_Data.Rows[j]["PID"]); problem.problem = p_Data.Rows[j]["PContent"].ToString(); problem.unit.UnitId = Convert.ToInt32(p_Data.Rows[j]["Unit"]); problem.unit.UnitName = p_Data.Rows[j]["UnitName"].ToString(); problem.Plevel = Convert.ToInt32(p_Data.Rows[j]["PLevel"]); office.Add(problem); } return office; }
public List<OfficePowerPoint> GetPowerPointProbelm() { List<OfficePowerPoint> list = new List<OfficePowerPoint>(); foreach (XmlNode xnn in xd.ChildNodes.Item(1).ChildNodes) { if (xnn.Name == "PowerPoint") { OfficePowerPoint c = new OfficePowerPoint(); c.problemId = Convert.ToInt32(xnn.Attributes["ProblemId"].Value); c.orderId = Convert.ToInt32(xnn.Attributes["OrderId"].Value); foreach (XmlNode option in xnn.ChildNodes) { if (option.ChildNodes.Item(0) != null) { switch (option.Name) { case "Problem": c.problem = option.ChildNodes.Item(0).Value; break; } } } list.Add(c); } } return list; }