Пример #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="registrationDate"></param>
 public void RenewUsercontrol(DateTime registrationDate)
 {
     //wifi auto 載入  取掛號資訊清單 Registration
     RegistrationSetting();
     ComboBoxItemInfo = RegistrationsList.Where(w => w.DisplayName == registrationDate.ToString("yyyy/MM/dd")).First();
 }
Пример #2
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            using (WebClient client = new WebClient())
            {
                client.Headers.Add("user-agent", "Mozilla / 5.0(Windows NT 10.0; WOW64; Trident / 7.0; rv: 11.0) like Gecko");
                //client.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
                client.Headers.Add("Authorization", "SNAeoB88JTmAXfNTAfpR");

                try
                {
                    string response = client.DownloadString("https://sandbox.apply-for-teacher-training.service.gov.uk/api/v1");
                }
                catch (Exception e2)
                {
                    string s5455 = e2.ToString();
                    s5455 = e2.InnerException.ToString();
                }
            }

            return;


            ISAMS_ExamStudentAccessList list44 = new ISAMS_ExamStudentAccessList();

            list44.load(18);


            ISAMS_ExamSeatingPlan_List list33 = new ISAMS_ExamSeatingPlan_List();

            list33.Load(18);

            // ISAMS_Set_PTOList Leena = new ISAMS_Set_PTOList();
            // Leena.load(12);



            return;



            ExamComponentResultList ecrl1 = new ExamComponentResultList();

            ecrl1.Load_OptionStudent(new Guid("d22c0f3e-38ff-4a81-9c00-dc7892548f68"), new Guid("fbbd073f-b4cd-4fb1-a12f-e3a755e7cc63"));
            string s = "";

            foreach (ExamComponentResult r in ecrl1.m_list)
            {
                s = r.ComponentStatus;
            }
            Response.Redirect("../studentinformation/ComponentResults.aspx?StudentId=fbbd073f-b4cd-4fb1-a12f-e3a755e7cc63 &OptionId=d22c0f3e-38ff-4a81-9c00-dc7892548f68");



            TT_compare(); return;

            //call from button..
            RegistrationsList r1 = new RegistrationsList();

            r1.Get_Recent_Registrations("6368");
            foreach (Registrations r in r1.Registrations)
            {
                TextBox1.Text += r.m_date.ToString() + "  " + r.m_staff + Environment.NewLine;
            }

            return;


            List <string> test3 = Get_Registrations("6368");

            foreach (string s4 in test3)
            {
                TextBox1.Text += s4 + Environment.NewLine;
            }
            return;

            IntPtr token     = IntPtr.Zero;
            string adno      = "6368";
            bool   isSuccess = LogonUser("test-staff", "challoners", "123Password",
                                         LOGON32_LOGON_NEW_CREDENTIALS,
                                         LOGON32_PROVIDER_DEFAULT, ref token);

            using (WindowsImpersonationContext person = new WindowsIdentity(token).Impersonate())
            {
                string path1 = @"\\registration.challoners.net\STEARsoft\Reg\data\cc\testfile.txt";
                //StreamReader sr1 = new StreamReader(path1);

                //string s = sr1.ReadLine();
                //Label4.Text = s;
                //s = s;
                int      i = 0; s = ""; int imax = 0; string sfile = "";
                string[] fileEntries = Directory.GetFiles(@"\\registration.challoners.net\STEARsoft\Reg\data", "attend*.csv");
                foreach (string fileName in fileEntries)
                {
                    //find last one!
                    s = fileName.Substring(fileName.IndexOf("log"));
                    try
                    {
                        s = s.Substring(3, 2);
                        i = System.Convert.ToInt32(s);
                        if (i > imax)
                        {
                            imax = i; sfile = fileName;
                        }
                    }
                    catch
                    {
                        try
                        {
                            s = s.Substring(3, 3);
                            i = System.Convert.ToInt32(s);
                            if (i > imax)
                            {
                                imax = i; sfile = fileName;
                            }
                        }
                        catch { }
                    }
                }
                if (imax > 0)
                {
                    string s1 = "";
                    Label4.Text = sfile;

                    StreamReader sr1 = new StreamReader(sfile);
                    while (!sr1.EndOfStream)
                    {
                        s = sr1.ReadLine();
                        string[] fred = s.Split((char)(','));

                        if (fred[4] == adno)
                        {
                            s1 = fred[11];
                        }
                    }
                }


                person.Undo();
            }



            return;



            //adno	first name	surname	StudentId	CourseId	StaffId	CommentType     poliyID	text
            Cerval_Library.TextReader text1 = new Cerval_Library.TextReader();
            Cerval_Library.TextRecord t     = new TextRecord();
            string     path = Server.MapPath(@"../App_Data/test.txt");
            FileStream f    = new FileStream(path, FileMode.Open);

            text1.ReadTextLine(f, ref t);//header row

            while (text1.ReadTextLine(f, ref t) == Cerval_Library.TextReader.READ_LINE_STATUS.VALID)
            {
                ReportComment r = new ReportComment();
                r.m_studentId                = new Guid(t.field[3]);
                r.m_courseId                 = new Guid(t.field[4]);
                r.m_staffId                  = new Guid(t.field[5]);
                r.m_commentType              = System.Convert.ToInt32(t.field[6]);
                r.m_dateCreated              = DateTime.Now;
                r.m_dateModified             = r.m_dateCreated;
                r.m_collectionOutputPolicyId = new Guid(t.field[7]);
                r.m_content                  = t.field[8];
                r.Save();
            }
            f.Close();
        }
Пример #3
0
        private void Display()
        {
            if (NameList.Items.Count == 0)
            {
                return;
            }
            string studentFullName = NameList.SelectedItem.Text;
            string studentID       = NameList.SelectedItem.Value;

            StudentDetail1.StudentId             = new Guid(NameList.SelectedValue);
            ReportCommentControl1.StudentId      = StudentDetail1.StudentId;
            MedicalDetailsControl1.StudentId     = StudentDetail1.StudentId;
            StudentDevelopmentControl1.StudentId = StudentDetail1.StudentId;
            TimetableControl1.BaseId             = StudentDetail1.StudentId;
            TimetableControl1.type = TT_writer.TimetableType.Student;
            StudentDetail1.Visible = Display_List.Items.FindByValue("Details").Selected;
            StudentDetail1.emailcontrol1.Visible = false;
            TextBox_Registrations.Visible        = false;
            TimetableControl1.Visible            = Display_List.Items.FindByValue("Timetable").Selected;
            ReportCommentControl1.Visible        = Display_List.Items.FindByValue("ReportComments").Selected;
            RadioButtonList_reports.Visible      = Display_List.Items.FindByValue("ReportComments").Selected;
            string s1 = RadioButtonList_reports.SelectedItem.Value;

            switch (s1)
            {
            case ("1"): ReportCommentControl1.CommentType = ReportCommentControl.ReportCommentType.ImprovementPoints; break;

            case ("2"): ReportCommentControl1.CommentType = ReportCommentControl.ReportCommentType.Comments; break;
            }

            ResultGrid1.Visible                = false;
            IncidentConrol1.Visible            = false;
            StudentDevelopmentControl1.Visible = false;



            TextBox_EditMedical.Visible = false;
            e1.Visible   = false;
            e2.Visible   = false;
            e1.StudentId = StudentDetail1.StudentId;
            e2.StudentId = StudentDetail1.StudentId;
            IncidentConrol1.StudentId            = StudentDetail1.StudentId;
            StudentDevelopmentControl1.StudentId = StudentDetail1.StudentId;
            ResultGrid1.StudentId            = studentID;
            TextBox_EditMedical.Visible      = Display_List.Items.FindByValue("Medical").Selected;
            Button_SaveMedical.Visible       = Display_List.Items.FindByValue("Medical").Selected;
            MedicalDetailsControl1.Visible   = Display_List.Items.FindByValue("Medical").Selected;
            Button_CreateNewIncident.Visible = Display_List.Items.FindByValue("Incident Log").Selected;
            Button_EditIncident.Visible      = Display_List.Items.FindByValue("Incident Log").Selected;

            Button_EditStudentDevelopment.Visible      = Display_List.Items.FindByValue("StudentDevelopment Log").Selected;
            Button_CreateNewStudentDevelopment.Visible = Display_List.Items.FindByValue("StudentDevelopment Log").Selected;


            if (Display_List.Items.FindByValue("Recent Registrations").Selected)
            {
                TextBox_Registrations.Visible = true;
                Utility           u = new Utility(); int adno = u.GetAdmissionNumber(studentID);
                RegistrationsList rl1 = new RegistrationsList(); rl1.Get_Recent_Registrations(adno.ToString());
                string            s   = "Date/Time" + (char)(0x09) + (char)(0x09) + "Staff" + (char)(0x09) + "Period" + (char)(0x09) + "Status" + Environment.NewLine;
                foreach (Registrations r in rl1.Registrations)
                {
                    s += r.m_date.ToString() + (char)(0x09) + r.m_staff + (char)(0x09) + r.m_period + (char)(0x09) + r.status + Environment.NewLine;
                }
                TextBox_Registrations.Text = s; TextBox_Registrations.Height = 200;
            }

            if (Display_List.Items.FindByValue("Medical").Selected)
            {
                StudentMedical sm1 = new StudentMedical();
                sm1.Load(NameList.SelectedValue);
                TextBox_EditMedical.Text = sm1.m_MedicalNotes;
            }
            if (Display_List.Items.FindByValue("External Results").Selected)
            {
                ResultGrid1.Visible     = true;
                ResultGrid1.DisplayType = ResultGrid.GridDisplayType.External;
            }
            if (Display_List.Items.FindByValue("Module Results").Selected)
            {
                ResultGrid1.Visible     = true;
                ResultGrid1.DisplayType = ResultGrid.GridDisplayType.Module;
            }
            if (Display_List.Items.FindByValue("Internal Results").Selected)
            {
                ResultGrid1.Visible     = true;
                ResultGrid1.DisplayType = ResultGrid.GridDisplayType.Internal;
            }
            if (Display_List.Items.FindByValue("Incident Log").Selected)
            {
                IncidentConrol1.Visible = true;
                Utility u = new Utility();
                Button_EditIncident.Visible = u.CheckStaffInConfigGroup(Context, "EditIncidents");
            }


            if (Display_List.Items.FindByValue("StudentDevelopment Log").Selected)
            {
                Utility u = new Utility();
                StudentDevelopmentControl1.Visible = u.CheckStaffInConfigGroup(Context, "EditStudentDevelopment");

                Button_EditStudentDevelopment.Visible = u.CheckStaffInConfigGroup(Context, "EditStudentDevelopment");
            }


            ///
            if (Display_List.Items.FindByValue("Exams").Selected)
            {
                string season = "6";
                int    year   = DateTime.Now.Year;
                if (DateTime.Now.Month > 9)
                {
                    season = "1"; year++;
                }
                if (DateTime.Now.Month == 1)
                {
                    season = "1";
                }
                string s = "ExamsSubjectList.aspx?ExamYear=" + year.ToString() + "&ExamSeason=" + season + "&Task=Student&StudentID=" + studentID;
                Server.Transfer(s);
            }
            if (Display_List.Items.FindByValue("Academic Profile").Selected)
            {
                string s = "PupilAcademicProfile.aspx?Id=" + StudentDetail1.StudentId.ToString();
                Server.Transfer(s);
            }
        }