protected void Button_test3_Click(object sender, EventArgs e) { //remake 9year or whatever string YearGroup = TextBox_YearGroup.Text; string GroupName = YearGroup + "Year"; int year = DateTime.Now.Year; int month = DateTime.Now.Month; if (month > 8) { year++; //so } DateTime EndDate = new DateTime(year, 7, 31); DateTime StartDate = new DateTime(year - 1, 9, 4); GroupList gl1 = new GroupList(); Utility u = new Utility(); Group g2 = new Group(); g2.Load(GroupName, DateTime.Now); if (!g2._valid) { g2._GroupCode = GroupName; g2._StartDate = StartDate; g2._EndDate = EndDate; g2._GroupName = GroupName; g2._CourseID = new Guid("f0e6828f-c6e1-4105-988c-83e350a39cc4"); g2._GroupRegistrationType = 3; g2._GroupRegistrationYear = System.Convert.ToInt32(YearGroup); g2._GroupPrimaryAdministrative = false; g2._GroupManagedBy = Guid.Empty; g2.Save(); } gl1.LoadList(DateTime.Now, GroupList.GroupListOrder.GroupName); foreach (Group g in gl1._groups) { if (g._GroupCode.ToUpper().Trim() == GroupName.ToUpper()) { //going to delete all gm here StudentGroupMembershipList sgml0 = new StudentGroupMembershipList(); sgml0.LoadList_Group(g._GroupID, DateTime.Now); foreach (StudentGroupMembership sg in sgml0.m_list) { sg.Delete(); } foreach (Group g1 in gl1._groups) { if (g1._GroupCode.Contains("RG") && (g1._GroupCode.StartsWith(YearGroup))) { StudentGroupMembershipList sgml1 = new StudentGroupMembershipList(); sgml1.LoadList_Group(g1._GroupID, DateTime.Now); foreach (StudentGroupMembership sg in sgml1.m_list) { StudentGroupMembership sm1 = new StudentGroupMembership(); sm1.m_Groupid = g._GroupID; sm1.m_Studentid = sg.m_Studentid; sm1.m_ValidFrom = StartDate; sm1.m_ValidTo = EndDate; sm1.Save(); } } } break; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { VAResultsList va1 = new VAResultsList(); va1.LoadCourse(new Guid("cf07a783-1a83-49cd-af92-4623c88c15eb")); //va1.LoadGroup(new Guid("cf07a783-1a83-49cd-af92-4623c88c15eb"), new Guid("1904046f-4532-4a82-9091-1ce43c2c6489")); CourseList cl1 = new CourseList(0); GroupList gl1 = new GroupList(); gl1.LoadList(new DateTime(2018, 4, 1), GroupList.GroupListOrder.GroupName); Chart8.Titles.Add("A-level VA from Alis model"); Chart8.Titles[0].Font = new Font("Verdana", 16, System.Drawing.FontStyle.Bold); Chart8.ChartAreas["ChartArea1"].AxisX.Interval = 1; LabelStyle ls1 = new LabelStyle(); ls1.Font = new Font("Verdana", 16, System.Drawing.FontStyle.Bold); ls1.Angle = 90; Chart8.ChartAreas["ChartArea1"].AxisX.LabelAutoFitStyle = LabelAutoFitStyles.None; // Chart8.ChartAreas["ChartArea1"].AxisX.TextOrientation = TextOrientation.Rotated90; ls1.ForeColor = Color.Red; Chart8.ChartAreas["ChartArea1"].AxisX.LabelStyle = ls1; Series s1 = new Series("test"); s1.XValueType = ChartValueType.String; s1.ChartType = System.Web.UI.DataVisualization.Charting.SeriesChartType.Column; s1.YValueType = new ChartValueType(); s1.YValueType = System.Web.UI.DataVisualization.Charting.ChartValueType.Int32; Chart8.Series.Add(s1); Chart8.Series["test"]["PixelPointWidth"] = "40"; Chart8.Series["test"].IsXValueIndexed = true; Chart8.Series["test"].Font = new Font("Arial", 12, System.Drawing.FontStyle.Bold); int i = 0; foreach (ValueAddedResult r in va1.m_list) { if (r.DateOutpuResult.Year == 2018) { string s = "X"; //find course foreach (Course c in cl1._courses) { if (c._CourseID == r.CourseId) { s = c.CourseName; break; } } //fid Group //foreach(Group g in gl1._groups) //{ // if (g._GroupID == r.GroupId) { s = g._GroupName; break; } // } DataPoint d = new DataPoint(); d.AxisLabel = s; d.SetValueY(r.OutputResultValue - r.VAResultValue); d.Label = "#VALY"; s1.Points.Add(d); } i++; } // s1.MarkerSize = 30; // s1.MarkerStyle = System.Web.UI.DataVisualization.Charting.MarkerStyle.Cross; // s1.BorderWidth = 5; } }