Ejemplo n.º 1
0
 public static void AddOfficeWord(OfficeWord word)
 {
     paper.Add(word);
 }
Ejemplo n.º 2
0
 public List<OfficeWord> FindOfficeWordByPID(int PID)
 {
     List<OfficeWord> result = new List<OfficeWord>();
     List<Office> tmp = new List<Office>();
     try
     {
         tmp = FindOfficeByPID(PID);
     }
     catch (SqlException ex)
     {
         Console.WriteLine(ex.ToString());
     }
     foreach (Office prob in tmp)
     {
         OfficeWord ow = new OfficeWord();
         ow.Plevel = prob.Plevel;
         ow.problem = prob.problem;
         ow.problemId = prob.problemId;
         ow.type = prob.type;
         ow.unit = prob.unit;
         result.Add(ow);
     }
     return result;
 }
Ejemplo n.º 3
0
        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;
        }
Ejemplo n.º 4
0
        private List<OfficeWord> DataSetToListOfficeWord(DataSet Ds)
        {
            DataTable p_Data = Ds.Tables[0];
            // 返回值初始化
            List<OfficeWord> word = new List<OfficeWord>();
            for (int j = 0; j < p_Data.Rows.Count; j++)
            {
                OfficeWord problem = new OfficeWord();
                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"]);

                word.Add(problem);
            }
            return word;
        }
Ejemplo n.º 5
0
 public List<OfficeWord> GetWordProbelm()
 {
     List<OfficeWord> list = new List<OfficeWord>();
     foreach (XmlNode xnn in xd.ChildNodes.Item(1).ChildNodes)
     {
         if (xnn.Name == "Word")
         {
             OfficeWord c = new OfficeWord();
             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;
 }