private void LoadData()
        {
            if (ClassList.Items.Count > 0)
            {
                ClassList.Items.Clear();
            }

            SortedList list = new SortedList();

            foreach (MetaClass mc in DataContext.Current.MetaModel.MetaClasses)
            {
                if (!mc.IsBridge && !mc.IsCard && !String.IsNullOrEmpty(mc.TitleFieldName))
                {
                    string name         = mc.Name;
                    string friendlyName = CHelper.GetResFileString(mc.FriendlyName);
                    string text         = name;

                    if (name != friendlyName)
                    {
                        text = String.Format(CultureInfo.InvariantCulture, "{0} ({1})", friendlyName, name);
                    }

                    list.Add(text, name);
                }
            }

            ClassList.DataSource     = list;
            ClassList.DataTextField  = "key";
            ClassList.DataValueField = "value";
            ClassList.DataBind();
        }
Beispiel #2
0
        public static void WriteRegister(List <student> StudentList)
        {
            for (int i = 0; i < StudentList.Count(); i++)
            {
                string Name      = StudentList[i].Name;
                string Surname   = StudentList[i].Surname;
                string Birthdate = StudentList[i].BirthDate;
                string c1        = StudentList[i].address.City;
                string s1        = StudentList[i].address.Street;
                string c2        = StudentList[i].tempAddress.City;
                string s2        = StudentList[i].tempAddress.Street;
                Console.WriteLine("{0} {1}, Birthdate: {2}", Name, Surname, Birthdate);
                Console.WriteLine("Address: {0}, {1}; Temporary Address: {2}, {3}", c1, s1, c2, s2);
                Console.WriteLine("Classes:");
                WriteClasses(StudentList[i].classes.AllClasses);
                Console.Write("\n");
            }

            void WriteClasses(List <SingleClass> ClassList)
            {
                for (int i = 0; i < ClassList.Count(); i++)
                {
                    string Name  = ClassList[i].Name;
                    float  Grade = ClassList[i].Grade;
                    Console.WriteLine("{0}, Grade: {1}", Name, Grade);
                }
            }
        }
Beispiel #3
0
        /// <summary>
        ///     Generate C# code for all POCO classes in the model
        /// </summary>
        /// <returns></returns>
        public string GeneratePoco()
        {
            List <string> ns = ClassList.Select(x => x.NameSpace).Distinct()
                               .OrderBy(x => x).ToList();
            var template = new FluentCsTextTemplate {
                Header = Header
            };

            template.WriteLine(UsingAssembly(ns));
            foreach (var s in ns)
            {
                //Use a user supplied namespace prefix combined with the schema namepace or just the schema namespace

                var namespc = PrefixNamespace(s);
                template.StartNamespace(namespc);
                var pocoModel = ClassList.Where(x => x.NameSpace == s);
                foreach (var item in pocoModel)
                {
                    template.WriteLine(ClassToString(item));
                }
                template.EndNamespace();
            }

            return(template.ToString());
        }
Beispiel #4
0
        private void Show()
        {
            table.Items.Clear();
            ListInterface a = new ClassList();

            a.ShowRecord(table);
        }
Beispiel #5
0
        /// <summary>
        /// 新增排班表 ClassList
        /// </summary>
        /// <returns></returns>
        public JsonResult ClassListSave()
        {
            AjaxStatusModel ajax = new AjaxStatusModel(); //功能操作类的返回类型都是AjaxStatusModel,数据放到AjaxStatusModel.data中,前台获取json后加载

            ajax.status = EnumAjaxStatus.Error;           //默认失败
            ajax.msg    = "新增失败!";                        //前台获取,用于显示提示信息
            //var TIme = Request["Date"];//获取前台传递的数据,主要序列化
            var data = Request["data"];                   //获取前台传递的数据,主要序列化

            if (string.IsNullOrEmpty(data))
            {
                return(Json(ajax));
            }

            Weekday   Weekday = (Weekday)(JsonConvert.DeserializeObject(data.ToString(), typeof(Weekday)));     //星期
            Classes   Classes = (Classes)(JsonConvert.DeserializeObject(data.ToString(), typeof(Classes)));     //班级
            Date      Date    = (Date)(JsonConvert.DeserializeObject(data.ToString(), typeof(Date)));           //时间
            ClassList Clas    = (ClassList)(JsonConvert.DeserializeObject(data.ToString(), typeof(ClassList))); //排课表
            var       v       = Date.Start_Date;

            Clas.StateID    = 1;                                          //状态
            Clas.CreateTIme = DateTime.Now;                               //创建时间
            Clas.CreatorId  = UserSession.userid;                         //创建人

            if (ClassListData.AddClassList(Clas, Date, Classes, Weekday)) //注意时间类型,而且需要在前台把所有的值
            {
                ajax.msg    = "新增成功!";
                ajax.status = EnumAjaxStatus.Success;
            }
            return(Json(ajax));
        }
Beispiel #6
0
        public void TestAddClass()
        {
            var f = new ClassList();

            f.addClass("Z100", "40", "0", 0, 0);
            Assert.IsTrue(GlobalItems.checkItemsInDB("classes", "name", "Z100"));
        }
 /// <inheritdoc />
 protected override string GetComponentCssClass()
 {
     return(ClassList.Create()
            .Add("rz-calendar-inline", Inline)
            .Add(FieldIdentifier, EditContext)
            .ToString());
 }
Beispiel #8
0
        private void SelfParse()
        {
            string comment = "";

            for (int index = 0; index < TextData.Count; index++)
            {
                var line = TextData[index];
                if (line.TrimStart().StartsWith("///"))
                {
                    comment += line;
                    continue;
                }
                var match = RegexHelpers.ClassHeaderRegex.Match(line);
                if (match.Success)
                {
                    var lst      = new List <string>();
                    int brackets = line.Count(x => x == '{') - line.Count(x => x == '}');
                    int j        = index + 1;
                    do
                    {
                        line      = TextData[j];
                        brackets += line.Count(x => x == '{');
                        brackets -= line.Count(x => x == '}');
                        lst.Add(TextData[j]);
                        j++;
                    } while (j < TextData.Count && brackets > 0);
                    index = j;
                    var data = new ClassData(Name, match.Value, lst, comment);
                    ClassList.Add(data);
                    comment = "";
                }
            }
            TextData = null;
        }
Beispiel #9
0
 /// <summary>
 /// Display the Activity workspace form.
 /// </summary>
 /// <param name="type"></param>
 public void ShowActivityWorkspace(string type)
 {
     if (type == "Student")
     {
         RegistrationController registerController = new RegistrationController(this.db, this);
         List <Class>           classes            = db.GetClasses();
         RegisterForClassForm   registerForm       = new RegisterForClassForm(this, registerController, classes);
         registerController.registerForm = registerForm;
         ClassWorksheet classWorksheet = new ClassWorksheet((StudentAccount)this.GetLoggedInUser());
         registerController.classWorksheet = classWorksheet;
         RegisterForClass activityWindow = new RegisterForClass(this, registerController, registerForm, classWorksheet);
         activityWindow.Text = "Register for class";
         activityWindow.Show();
     }
     else if (type == "Administrator")
     {
         ClassController createClassControl = new ClassController(this.db, this);
         ClassList       classList          = new ClassList(db.GetClasses());
         createClassControl.classList = classList;
         CreateClassForm createClassForm = new CreateClassForm(createClassControl);
         createClassControl.createClassForm = createClassForm;
         CreateClass activityWindow = new CreateClass(this, createClassControl, classList, createClassForm);
         activityWindow.Text = "Create class Activity Window";
         activityWindow.Show();
     }
     else
     {
         ActivityWindow activityWindow = new ActivityWindow(this);
         activityWindow.Text = "Avtivity Window";
         activityWindow.Show();
     }
 }
Beispiel #10
0
        public void StartInfo()
        {
            try
            {
                _imagePath = _user.PicturePath;
                SkillsList.Items.Clear();
                NameField.Text    = _user.Name;
                SurNameField.Text = _user.LastName;
                EmailField.Text   = _user.RegMail;
                ClassList.Items.Clear();
                foreach (var clas in TeamBuildingEntities.Classes)
                {
                    ClassList.Items.Add(clas.ClassName);
                }
                for (int i = 0; i < _user.Classes.Count; i++)
                {
                    ClassList.SetItemChecked(_user.Classes.ToList()[i].ClassId - 1, true);
                }
                foreach (var VARIABLE in _user.Skills)
                {
                    SkillsList.Items.Add(VARIABLE.SklName);
                }
                Picture.Image = new Bitmap(@"Pictures\" + _user.PicturePath);
            }

            catch (Exception exception)
            {
                MessageBox.Show(exception.ToString());
            }
        }
 /// <inheritdoc />
 protected override string GetComponentCssClass()
 {
     return(ClassList.Create("header")
            .Add("rz-header")
            .Add("fixed", Layout == null)
            .ToString());
 }
Beispiel #12
0
        public void OnGet()
        {
            var list = new ClassList();

            studentClassList       = list.getStudentClassList();
            studentSecondClassList = list.getStudentSecondClassList();
        }
Beispiel #13
0
        public void TestClassList()
        {
            ClassList classList = new ClassList("races");

            classList.AddClass(new Class("dwarf",
                                         new AttributeModifier(AttributeModifier.AttributeModifierOptions.SET, "use_hammer"),
                                         new AttributeModifier(AttributeModifier.AttributeModifierOptions.FORBID, "use_bow")
                                         ));

            classList.AddClass(new Class("elf",
                                         new AttributeModifier(AttributeModifier.AttributeModifierOptions.SET, "use_bow")
                                         ));

            Assert.IsTrue(classList.IsClassExisting("dwarf"));
            Assert.IsTrue(classList.IsClassExisting("elf"));
            Assert.IsFalse(classList.IsClassExisting("human"));

            Class dwarf = classList.GetClassByName("dwarf");
            Class elf   = classList.GetClassByName("elf");

            Assert.IsTrue(dwarf.ContainsAttributeModifier("use_hammer"));
            Assert.IsTrue(dwarf.ContainsAttributeModifier("use_bow"));

            Assert.AreEqual(dwarf.GetAttributeModifier("use_bow").Option, AttributeModifier.AttributeModifierOptions.FORBID);
        }
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if (specComboBox.Text == "")
     {
         a1.Visibility = Visibility.Visible;
         p.Visibility  = Visibility.Visible;
         if (semester.Text == "")
         {
             a2.Visibility = Visibility.Visible;
         }
     }
     else
     {
         if (semester.Text == "")
         {
             a2.Visibility = Visibility.Visible;
             p.Visibility  = Visibility.Visible;
         }
         else
         {
             ListInterface a = new ClassList();
             tableDiscipline.Items.Clear();
             a.ShowSemester(tableDiscipline, specComboBox.Text, semester.Text);
         }
     }
 }
Beispiel #15
0
        /// <summary>
        /// Handles the <see cref="ButtonBase.Click"/> event for the "Build Only" <see
        /// cref="Button"/>.</summary>
        /// <param name="sender">
        /// The <see cref="Object"/> where the event handler is attached.</param>
        /// <param name="args">
        /// A <see cref="RoutedEventArgs"/> object containing event data.</param>
        /// <remarks>
        /// <b>OnClassBuildOnly</b> issues a <see cref="BuildCommand"/> for the selected item in the
        /// "Entity Class" list view, if any, and updates all dialog controls to reflect the changed
        /// entity and resource counts.</remarks>

        private void OnClassBuildOnly(object sender, RoutedEventArgs args)
        {
            args.Handled = true;

            // retrieve selected item, if any
            int           index = ClassList.SelectedIndex;
            BuildListItem item  = (index < 0 ? null : (BuildListItem)ClassList.Items[index]);

            // quit if nothing to build
            if (item == null || item.BuildCount <= 0)
            {
                return;
            }

            // issue Build command
            Debug.Assert(item.EntityClass != null);
            AsyncAction.BeginRun(delegate {
                Session.Instance.Executor.ExecuteBuild(this._worldState, item.EntityClass.Id, 1);

                AsyncAction.BeginInvoke(delegate {
                    // show new entity and build counts
                    ShowClassCounts();

                    // reselect item to update dialog
                    ClassList.SelectedIndex = -1;
                    ClassList.SelectAndShow(index);

                    AsyncAction.EndRun();
                });
            });
        }
Beispiel #16
0
 private void Button_Click_3(object sender, RoutedEventArgs e)
 {
     if (type1.Text == "")
     {
         a3.Visibility = Visibility.Visible;
         p2.Visibility = Visibility.Visible;
         if (teacher.Text == "")
         {
             a4.Visibility = Visibility.Visible;
         }
     }
     else
     {
         if (teacher.Text == "")
         {
             a4.Visibility = Visibility.Visible;
             p2.Visibility = Visibility.Visible;
         }
         else
         {
             tableList.Items.Clear();
             ListInterface a = new ClassList();
             a.ShowTeacherList(tableList, type1.Text, teacher.Text);
         }
     }
 }
        private string MakeNode(DataType item, string classText)
        {
            StringBuilder outputText = new StringBuilder();

            foreach (var property in item.Properties)
            {
                classText += property.Name + " : " + property.DataTypeName;
                if (!string.IsNullOrWhiteSpace(property.MinCardinality) && !string.IsNullOrWhiteSpace(property.MaxCardinality))
                {
                    classText += "[" + property.MinCardinality + "..." + property.MaxCardinality + "] ";
                }
                classText += "\\l";
                if (ClassList.Contains(property.DataType))
                {
                    outputText.Append("edge[ arrowhead = \"none\" headlabel = \"0...*\" taillabel = \"0...*\"] ");
                    outputText.Append(item.Name + " -> " + property.DataTypeName + "[ label = \"" + property.Name + "\"] ");
                }
                if (ReusableList.Contains(property.DataType) && ShowReusables)
                {
                    return(MakeCluster(item, property.DataType));
                }
            }
            if (!string.IsNullOrWhiteSpace(item.ExtendsTypeName) && Inheritance)
            {
                outputText.Append("edge [arrowhead = \"empty\" headlabel = \"\" taillabel = \"\"] ");
                outputText.Append(item.Name + "->" + item.ExtendsTypeName + " ");
            }
            outputText.Append(classText + "}\"] ");
            return(outputText.ToString());
        }
 public void MakeGraphTopic(CogsModel model, string header)
 {
     foreach (var topic in model.TopicIndices)
     {
         var output             = new StringBuilder(header);
         Stack <DataType> stack = new Stack <DataType>();
         List <string>    seen  = new List <string>();
         foreach (var item in topic.ItemTypes)
         {
             stack.Push(item);
         }
         while (stack.Count > 0)
         {
             var item = stack.Pop();
             seen.Add(item.Name);
             if (Inheritance && !String.IsNullOrWhiteSpace(item.ExtendsTypeName))
             {
                 output.Append($"{item.Name} -> {item.ExtendsTypeName} [ arrowhead = \"empty\"]");
             }
             foreach (var property in item.Properties)
             {
                 if (ClassList.Contains(property.DataType) && !seen.Contains(property.DataTypeName))
                 {
                     output.Append(item.Name + " -> " + property.DataTypeName + " ");
                     stack.Push(property.DataType);
                 }
             }
         }
         output.Append("}");
         GenerateOutput(topic.Name, output.ToString());
     }
 }
Beispiel #19
0
        /// <summary>
        /// 保存考勤
        /// </summary>
        /// <returns></returns>
        public JsonResult saveStudentAttendance()
        {
            AjaxStatusModel ajax = new AjaxStatusModel(); //功能操作类的返回类型都是AjaxStatusModel,数据放到AjaxStatusModel.data中,前台获取json后加载

            ajax.status = EnumAjaxStatus.Error;           //默认失败
            ajax.msg    = "保存考勤失败!";                      //前台获取,用于显示提示信息
            var data = Request["data"];                   //获取前台传递的数据,主要序列化

            if (string.IsNullOrEmpty(data))
            {
                return(Json(ajax));
            }
            List <AttendanceRecord> cls = (List <AttendanceRecord>)(JsonConvert.DeserializeObject(data.ToString(), typeof(List <AttendanceRecord>)));

            cls = cls.Where(t => t != null && t.AttendanceTypeID != 1).ToList();
            if (cls.Count() > 0)
            {
                string    _classid    = cls.FirstOrDefault().ClassID;
                int       _classindex = cls.FirstOrDefault().ClassIndex;
                ClassList cl          = ClassListData.GetOneByid(_classid, _classindex);
                if (cl.ClassDate.Date > DateTime.Now.Date)
                {
                    ajax.msg = "你要处理的考勤时间还未发生!";
                    return(Json(ajax));
                }
            }
            if (AttendaceData.saveStudentAttendance(cls, UserSession.userid))
            {
                ajax.status = EnumAjaxStatus.Success;
                ajax.msg    = "保存考勤成功";
            }

            return(Json(ajax));
        }
Beispiel #20
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // 在此处放置用户代码以初始化页面
        string  ST_cmd_sql  = "select top 10 * from ST_news where ST_n_iscmd=1 order by ST_n_date desc";
        string  ST_top_sql  = "select top 10 * from ST_news order by ST_n_hit desc";
        string  personindex = "select top 10* from ST_news order by ST_n_id desc";
        string  TitleClass  = "select ST_c_id, ST_c_name from ST_class order by ST_date desc";
        DataSet ST_classds  = myobj.GetDataSet(TitleClass, "ST_class");
        DataSet ST_cmdds    = myobj.GetDataSet(ST_cmd_sql, "ST_news");
        DataSet ST_topds    = myobj.GetDataSet(ST_top_sql, "ST_news");
        DataSet mypersonds  = myobj.GetDataSet(personindex, "ST_class");

        //绑定博客文章类型列表
        ClassList.DataSource = new DataView(ST_classds.Tables[0]);
        ClassList.DataBind();

        //绑定推荐文章列表
        CmdList.DataSource = new DataView(ST_cmdds.Tables[0]);
        CmdList.DataBind();

        //绑定热点文章列表
        TopList.DataSource = new DataView(ST_topds.Tables[0]);
        TopList.DataBind();


        //绑定最新个人最新发表的博客文章
        ClassList0.DataSource = new DataView(mypersonds.Tables[0]);
        ClassList0.DataBind();
        if (Request.QueryString["c_id"] == null)
        {
            person_BindData();
        }
        else
        {
            NewsBlogList_Bind();
        }


        if (Request.Cookies["colors"] != null)
        {
            string   ST_test      = Request.Cookies["colors"].Value;
            String[] ST_colorList = ST_test.Split(new[] { ',' });
            ST_bgcolor = ST_colorList[0];
            ST_tcolor  = ST_colorList[1];
        }
        else
        {
            ST_bgcolor = "#FFFFFF";
            ST_tcolor  = "#cccccc";
        }
        Page.DataBind();
        string rd = DateTime.Now.Ticks.ToString();

        str = "imgFile/1.jpg?rd=" + rd + "|imgFile/2.jpg?rd=" + rd + "|imgFile/3.jpg?rd=" + rd + "|imgFile/4.jpg?rd=" +
              rd + "";
        string path = Server.MapPath("./") + "imgFile/LoopId.txt";

        loopId = File.ReadAllText(path);
        loopId = loopId.Replace(',', '|');
    }
Beispiel #21
0
        private void type_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (group.Text != "" && semester.Text != "")
            {
                Discipline.SelectedItem = null;
                ListInterface a = new ClassList();
                switch (type.SelectedIndex)
                {
                case 0: Discipline.ItemsSource = a.GetDisciplineGroup(group.Text, "Зачет", semester.Text); break;

                case 1: Discipline.ItemsSource = a.GetDisciplineGroup(group.Text, "Экзамен", semester.Text); break;

                case 2: Discipline.ItemsSource = a.GetDisciplineGroup(group.Text, "Дифференцированный зачет", semester.Text); break;
                }
            }
            mark.SelectedItem = null;
            if (type.SelectedIndex == 0)
            {
                string[] mas = { "зачтено", "не зачтено" };
                mark.ItemsSource = mas;
            }
            else
            {
                string[] mas = { "отлично", "хорошо", "удовлетворительно", "неудовлетворительно" };
                mark.ItemsSource = mas;
            }
            a2.Visibility = Visibility.Hidden;
            if (semester.Text != "" && group.Text != "" && Discipline.Text != "" && student.Text != "" && mark.Text != "")
            {
                p.Visibility = Visibility.Hidden;
            }
        }
Beispiel #22
0
        protected void GetShift(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                string shift = ShiftList.SelectedItem.ToString();
                Session["Shift"] = shift;
                string currentyear = DateTime.Now.Year.ToString();
                ClassErr.Visible   = false;
                CourseErr.Visible  = false;
                TeacherErr.Visible = false;
                using (SqlConnection con = new SqlConnection(conString))
                {
                    con.Open();
                    string         query = "Select * from ClassTable where DId='" + Session["AccountId"].ToString() + "'  and Year='" + currentyear + "' and Shift='" + Session["Shift"] + "'";
                    SqlDataAdapter sda   = new SqlDataAdapter(query, con);
                    DataTable      dt    = new DataTable();
                    sda.Fill(dt);
                    ClassList.DataSource = dt;
                    ClassList.DataBind();
                    ClassList.DataTextField  = "ClassName";
                    ClassList.DataValueField = "ClassId";
                    ClassList.DataBind();

                    ClassList.Items.Insert(0, new ListItem("Select", "NA"));
                    Section.Text = dt.Rows[0][2].ToString();

                    con.Close();
                }
            }
        }
Beispiel #23
0
        // GET: Class
        public ActionResult Index()
        {
            ClassList     Classlist = new ClassList();
            List <_class> obj       = Classlist.getClass(string.Empty);

            return(View(obj));
        }
Beispiel #24
0
        private void Show()
        {
            tableList.Items.Clear();
            ListInterface a = new ClassList();

            a.Show(tableList);
        }
        private void Show()
        {
            tableDiscipline.Items.Clear();
            ListInterface a = new ClassList();

            a.ShowDisciplines(tableDiscipline);
        }
        // GET: ApplicationUser/ListStudents/17
        public async Task <IActionResult> ListStudents(int?id)
        {
            //The list is to be for a course and id is key for the course
            if (id == null)
            {
                return(NotFound());
            }

            var course = await _context.Course.FindAsync(id);

            if (course == null)
            {
                return(NotFound());
            }

            var listOfUsers = await _userManager.Users
                              .Where(u => u.CourseId == course.Id)
                              .OrderBy(u => u.LmsName)
                              .ToListAsync();

            var cl = new ClassList {
                CourseId = course.Id, CourseName = course.Name, Students = listOfUsers
            };

            return(View("ClassList", cl));
        }
Beispiel #27
0
        private void BackGrid_Tapped(object sender, TappedRoutedEventArgs e)
        {
            Debug.WriteLine("前" + KBCLassFlyoutPivot.Items.Count.ToString());
            do
            {
                KBCLassFlyoutPivot.Items.RemoveAt(0);
            }while (KBCLassFlyoutPivot.Items.Count.ToString() != "0");
            Debug.WriteLine("删除" + KBCLassFlyoutPivot.Items.Count.ToString());
            Grid g = sender as Grid;

            Debug.WriteLine(g.GetValue(Grid.ColumnProperty));
            Debug.WriteLine(g.GetValue(Grid.RowProperty));
            string[] temp = classtime[Int32.Parse(g.GetValue(Grid.ColumnProperty).ToString()), Int32.Parse(g.GetValue(Grid.RowProperty).ToString()) / 2];
            for (int i = 0; i < temp.Length; i++)
            {
                ClassList c = classList.Find(p => p._Id.Equals(temp[i]));

                PivotItem pi = new PivotItem();
                TextBlock HeaderTextBlock = new TextBlock();
                HeaderTextBlock.Text     = c.Course;
                HeaderTextBlock.FontSize = 25;
                pi.Header = HeaderTextBlock;
                ListView lv = new ListView();
                lv.ItemTemplate = KBCLassFlyoutListView.ItemTemplate;
                List <ClassList> cc = new List <ClassList>();
                cc.Add(c);
                lv.ItemsSource = cc;
                pi.Content     = lv;
                KBCLassFlyoutPivot.Items.Add(pi);
                Debug.WriteLine("后" + KBCLassFlyoutPivot.Items.Count.ToString());
            }
            KBCLassFlyout.ShowAt(page);
        }
Beispiel #28
0
        public override object VisitClassListName([NotNull] classlist_langParser.ClassListNameContext context)
        {
            //check if classlist already exists

            bool exists = false;

            foreach (var classList in classLists)
            {
                if (classList.Name == context.GetText())
                {
                    Errors.Add(new ErrorDescriptor("Classlist '" + classList.Name + "' already exists", context.Start.Line, context.Start.Column, context.Start.StartIndex, context.Start.StopIndex));
                    exists = true;
                    break;
                }
            }

            if (!exists)
            {
                ClassList classList = new ClassList();
                classList.Name = context.GetText();
                classLists.Add(classList);
                currentClassList = classList;
            }

            return(base.VisitClassListName(context));
        }
Beispiel #29
0
 public static void Init(Stream classes)
 {
     using (StreamReader sr = new StreamReader(classes))
     {
         string tmp = sr.ReadToEnd();
         _classList = JsonConvert.DeserializeObject <ClassList>(tmp);
     }
 }
Beispiel #30
0
        /// <inheritdoc />
        protected override string GetComponentCssClass()
        {
            var classList = ClassList.Create("rz-body")
                            .Add("body")
                            .Add("body-expanded", Expanded);

            return(classList.ToString());
        }
Beispiel #31
0
		public static void UploadInfoToXDD(string gardenID, string gardenName, DataTable data)
		{
			string url = "http://xdd.xindoudou.cn/2/partner/sync";
			if (data.Rows.Count > 0)
			{
				string key = "76e8e4411055443c9def688b969c9ac6";
				Hashtable ht = new Hashtable();
				foreach(DataRow dr in data.Rows)
				{
					string classNumber = dr["info_machineAddr"].ToString();
					if (classNumber != null && classNumber != string.Empty)
					{
						Class @class = null;
						if (!ht.ContainsKey(classNumber))
						{
							@class = new Class();
							@class.id = dr["info_machineAddr"].ToString();
							@class.name = dr["info_className"].ToString();
							@class.students = new ArrayList();
							ht[classNumber] = @class;
						}
						else
						{
							@class = ht[classNumber] as Class;
						}
						student stu = new student();
						stu.id = dr["info_stuID"].ToString();
						stu.name = dr["info_stuName"].ToString();
						@class.students.Add(stu);
					}
				}

				ClassList list = new ClassList();
				list.List = new ArrayList();
				foreach(Class @class in ht.Values)
				{
					list.List.Add(@class);
				}
				
				HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest;
				request.Method = "POST";
				request.ContentType = "application/x-www-form-urlencoded";
				request.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)";

				StringBuilder sb = new StringBuilder();
				sb.Append(key);
				sb.Append("city=");
				sb.Append("&province=");
				sb.Append(string.Format("&school_id={0}", gardenID));
				sb.Append(string.Format("&school_name={0}", gardenName));

				byte[] hash = MD5.Create().ComputeHash(Encoding.UTF8.GetBytes(sb.ToString()));
				sb = new StringBuilder();
				foreach(byte b in hash)
				{
					sb.Append(b.ToString("x2"));
				}

				string json = AjaxPro.JavaScriptSerializer.Serialize(list);
				json = json.Substring(8, json.Length - 9);
				byte[] val = Encoding.UTF8.GetBytes(string.Format("key={0}&school_id={1}&school_name={2}&province={3}&city={4}&md5={5}&classes={6}",
					key, gardenID, gardenName, string.Empty, string.Empty, sb.ToString(), json));


				using (Stream stream = request.GetRequestStream())  
				{
					stream.Write(val, 0, val.Length);  
				}

				WebResponse response = request.GetResponse();
				using(StreamReader reader = new StreamReader(response.GetResponseStream()))
				{
					string s = reader.ReadToEnd();
				}
			}
		}
Beispiel #32
0
 public void OnButtonClick()
 {
     m_List = new ClassList(m_UIParent, m_TextPrefab);
 }