コード例 #1
0
        public ActionResult CreateTest([Bind(Include = "Id")] Test test, string lectureName, int id)
        {
            if (ModelState.IsValid)
            {
                List<Lecture> q = db.Lecture.ToList();
                Lecture neededLect = new Lecture();

                foreach (var i in q)
                {
                    if (i.CourseId == id && i.Name == lectureName)
                    {
                        foreach (var c in db.Test.ToList())
                        {
                            if (c.Lecture.Id == i.Id)
                            {
                                return RedirectToAction("CreateTest", "Tests", new Course { id = id });
                            }
                        }
                        test.Lecture = i;
                        test.LastLectureId = i.Id;
                    }
                }

                db.Test.Add(test);
                db.SaveChanges();
                return RedirectToAction("Details", "Course", new Course { id = id });
            }

            return View(test);
        }
コード例 #2
0
 public bool NewLecture(Lecture _lecture)
 {
     SqlParameter[] Params = new SqlParameter[]
     {
         new SqlParameter("@ModuleCode", _lecture.ModuleCode),
         new SqlParameter("@StaffNumber", _lecture.StaffNumber),
         new SqlParameter("@VenueCode",_lecture.VenueCode),
         new SqlParameter("@TimeSlot", _lecture.TimeSlot)
     };
     return DataAccess.ExecuteNonQuery("sp_InsertLecture", CommandType.StoredProcedure,
         Params);
 }
コード例 #3
0
    /// <summary>
    /// Determines if the lecture list contains the lecture.
    /// </summary>
    /// <returns><c>true</c>, if lecture exists, <c>false</c> otherwise.</returns>
    /// <param name="l">L.</param>
    public bool ContainsLecture(Lecture l)
    {
        bool contains = false;

        for (int i=0; i<mLectures.Count; i++)
        {
            if(mLectures[i].GetID() == l.GetID())
            {
                contains =  true;
                break;
            }
        }

        return contains;
    }
コード例 #4
0
    /// <summary>
    /// Adds the lecture.
    /// </summary>
    /// <returns><c>true</c>, if lecture was added, <c>false</c> otherwise.</returns>
    /// <param name="l">L.</param>
    public bool AddLecture(Lecture l)
    {
        bool added;
        int startSize = mLectures.Count;
        Lecture temp = new Lecture (l);

        if(!this.ContainsLecture(l))
            mLectures.Add(temp);

        if(mLectures.Count > startSize)
            added = true;
        else
            added =false;

        return added;
    }
コード例 #5
0
        public ActionResult Create(Lecture _lecture, FormCollection collector)
        {
            BusinessLogicHandler _gateWay = new BusinessLogicHandler();

            #region Identity

            ApplicationDbContext dataSocket = new ApplicationDbContext();
            UserStore<ApplicationUser> myStore = new UserStore<ApplicationUser>(dataSocket);
            UserManager = new ApplicationUserManager(myStore);
            var user = UserManager.FindByName(HttpContext.User.Identity.Name);

            #endregion

            #region Get Lecturer
            //Lecturer staffMember = new Lecturer();
            //staffMember = _gateWay.GetLecturer(user.Id);
            #endregion

            #region Setting things up
            try
            {
                string[] dateSlice = collector.GetValue("dateHoldhidden").AttemptedValue.Split(' ');
                string timeSlice = collector.GetValue("timeHoldhidden").AttemptedValue;
                _lecture.TimeSlot = dateSlice[0] + " " + timeSlice;
            }
            catch
            {
                return View(_lecture);
            }

            #endregion
            try
            {
                if(_gateWay.InsertLecture(_lecture))
                { return RedirectToAction("Index");}
                else
                { return View(_lecture); }
            }
            catch
            {
                return View(_lecture);
            }
        }
コード例 #6
0
        public Lecture GetLecture(int LUI)
        {
            Lecture _lecture = null;

            SqlParameter[] Params = { new SqlParameter("@LUI", LUI) };
            using (DataTable table = DataAccess.ExecuteParamatizedSelectCommand("sp_GetLecture",
                CommandType.StoredProcedure, Params))
            {
                if (table.Rows.Count == 1)
                {
                    DataRow row = table.Rows[0];
                    _lecture = new Lecture();
                    _lecture.TimeSlot = row["TimeSlot"].ToString();
                    _lecture.ModuleCode = row["ModuleCode"].ToString();
                    _lecture.StaffNumber = row["StaffNumber"].ToString();
                    _lecture.VenueCode = row["VenueCode"].ToString();
                }
            }
            return _lecture;
        }
コード例 #7
0
    /// <summary>
    /// Removes the lecture.
    /// </summary>
    /// <returns><c>true</c>, if lecture was removed, <c>false</c> otherwise.</returns>
    /// <param name="l">L.</param>
    public bool RemoveLecture(Lecture l)
    {
        bool removed;
        int startSize = mLectures.Count;

        for (int i=0; i<mLectures.Count; i++)
        {
            if(mLectures[i].GetID() == l.GetID())
            {
                mLectures.RemoveAt(i);
                break;
            }
        }

        if(mLectures.Count < startSize)
            removed = true;
        else
            removed =false;

        return removed;
    }
コード例 #8
0
        public List<Lecture> GetAllLectures()
        {
            List<Lecture> _lectureList = null;

            using (DataTable table = DataAccess.ExecuteSelectCommand("sp_GetAllLectures",
                CommandType.StoredProcedure))
            {
                if (table.Rows.Count > 0)
                {
                    _lectureList = new List<Lecture>();
                    foreach (DataRow row in table.Rows)
                    {
                        Lecture _lecture = new Lecture();
                        _lecture.TimeSlot = row["TimeSlot"].ToString();
                        _lecture.ModuleCode = row["ModuleCode"].ToString();
                        _lecture.StaffNumber = row["StaffNumber"].ToString();
                        _lecture.VenueCode = row["VenueCode"].ToString();
                        _lectureList.Add(_lecture);
                    }
                }
            }
            return _lectureList;
        }
コード例 #9
0
 public List<Lecture> GetLectureForStaffMemeber(string StaffNumber)
 {
     List<Lecture> _lectureList = null;
     SqlParameter[] Params = { new SqlParameter("@StaffNumber", StaffNumber) };
     using (DataTable table = DataAccess.ExecuteParamatizedSelectCommand("sp_GetLectures4Staff", CommandType.StoredProcedure, Params))
     {
         if (table.Rows.Count > 0)
         {
             _lectureList = new List<Lecture>();
             foreach (DataRow row in table.Rows)
             {
                 Lecture _lecture = new Lecture();
                 _lecture.LUI = Convert.ToInt32(row["LUI"]);
                 _lecture.TimeSlot = row["TimeSlot"].ToString();
                 _lecture.ModuleCode = row["ModuleCode"].ToString();
                 _lecture.StaffNumber = row["StaffNumber"].ToString();
                 _lecture.VenueCode = row["VenueCode"].ToString();
                 _lectureList.Add(_lecture);
             }
         }
     }
     return _lectureList;
 }
コード例 #10
0
 public void SaveLecture(Lecture lecture)
 {
     if (lecture.ID == Guid.Empty)
         _context.Lectures.Add(lecture);
     else
     {
         Lecture dbEntry = _context.Lectures.Find(lecture.ID);
         if (dbEntry != null)
         {
             dbEntry.Homework = lecture.Homework;
             dbEntry.LectureContent = lecture.LectureContent;
             dbEntry.Name = lecture.Name;
             dbEntry.OrderNumber = lecture.OrderNumber;
         }
     }
     _context.SaveChanges();
 }
コード例 #11
0
        public ActionResult ViewAttendees()
        {
            #region Declaring the variables

            BusinessLogicHandler _gateWay = new BusinessLogicHandler();
            List<Student> _studList = new List<Student>();
            Student _student = new Student();
            Lecturer _lecturer = new Lecturer();
            Lecture _lecture = new Lecture();
            CloserViewModel _closer = new CloserViewModel();

            #endregion

            Bridge _bridge = (Bridge)Session["Data"];
            //_lecture = _gateWay.GetLecture(_bridge.Lecture_Id);

            #region Getting The students

            foreach (var item in _bridge.User_Id)
            {
                string[] exString = item.Split('.');
                _student = _gateWay.GetStudent(exString[0]);
                _student.User_Id = item.ToString();
                _studList.Add(_student);
            }
            _closer.Students = _studList;

            #endregion

            #region Getting the lecture details

            _lecture = _gateWay.GetLecture(_bridge.Lecture_Id);
            _closer.Lecture = _lecture;

            #endregion

            #region Setting the date

            _closer.Date = "";
            for (int x = 0; x < 4; x++)
            {
                _closer.Date += _bridge.dateSlice[x] + " ";
            }

            #endregion

            #region Getting Lecturer details

            _lecturer = _gateWay.GetLecturer_StuffNumber(_lecture.StaffNumber);
            _closer.Lecturer = new Lecturer();
            _closer.Lecturer = _lecturer;
            #endregion

            #region Assigning images
            if (_bridge.filePath != null)
                _closer.files = _bridge.filePath;
            #endregion

            return View(_closer);
        }
コード例 #12
0
        public ActionResult TakeAttendance(HttpPostedFileBase zip, HttpPostedFileBase img, FormCollection collector)
        {
            #region Declaring Varibles

            string path = Server.MapPath("~/Uploads/TrainingSet/");
            string haarcascades = HttpContext.Server.MapPath("~/haarcascades/haarcascade_frontalface_default.xml");
            string theePath = "";
            BusinessLogicHandler _gateWay;
            Lecture _mod;
            List<string> User_Id;

            #endregion

            #region getting the modulecode

            _gateWay = new BusinessLogicHandler();
            _mod = new Lecture();
            _mod = _gateWay.GetLecture(Convert.ToInt32(collector.GetValue("Lecture").AttemptedValue));

            #endregion

            #region Checking or Creating the directory

            string newPath = Server.MapPath("~/Uploads/Attendance/");
            if (Directory.Exists(newPath))
            {
                if (Directory.Exists(newPath + _mod.ModuleCode))
                {
                    theePath = newPath + _mod.ModuleCode.Trim() + "/" + _mod.VenueCode.Trim() + "/" + DateTime.Today.ToString("ddMMMMyyyy");
                    if (!Directory.Exists(theePath))
                        Directory.CreateDirectory(theePath);
                }
                else
                {
                    Directory.CreateDirectory(newPath + _mod.ModuleCode);
                    theePath = newPath + _mod.ModuleCode.Trim() + "/" + _mod.VenueCode.Trim() + "/" + DateTime.Today.ToString("ddMMMMyyyy");
                    if (!Directory.Exists(theePath))
                        Directory.CreateDirectory(theePath);
                }
            }
            else
            { Directory.CreateDirectory(newPath); }
            string imgPath = "~/Uploads/Attendance/" + _mod.ModuleCode.Trim() + "/" + _mod.VenueCode.Trim() + "/" + DateTime.Today.ToString("ddMMMMyyyy");

            #endregion

            #region Image not null 
            if (img != null && zip == null)
            {
                User_Id = new List<string>();
                Bitmap _Img = new Bitmap(img.InputStream);

                #region processing the img

                CoreSysFunction _coreFunction = new CoreSysFunction();
                User_Id.AddRange(_coreFunction.DetectAndRecognize(_Img, path, haarcascades));
                Bitmap toSave = _coreFunction.IdentifyAndMark(haarcascades, _Img);
                toSave.Save(theePath +"/"+ _mod.VenueCode.Trim()+".jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
                imgPath += "/" + _mod.VenueCode.Trim() + ".jpg";
                #endregion

                #region object to view page

                Bridge _bridge = new Bridge();
                _bridge.filePath = new List<string>();
                _bridge.filePath.Add( imgPath);
                _bridge.User_Id = new List<string>();
                _bridge.User_Id = User_Id;
                _bridge.dateSlice = collector.GetValue("dateHoldhidden").AttemptedValue.Split(' ');
                _bridge.Lecture_Id = Convert.ToInt32(collector.GetValue("Lecture").AttemptedValue);
                Session["Data"] = _bridge;

                #endregion

                return RedirectToActionPermanent("ViewAttendees");
            }
            #endregion

            #region Image not null and zip not null
            else if (zip != null && img != null)
            {
                User_Id = new List<string>();
                Bridge _bridge = new Bridge();
                List<string> fileNames = new List<string>();
                _bridge.filePath = new List<string>();
                Bitmap _Img = new Bitmap(img.InputStream);

                #region processing the img

                CoreSysFunction _coreFunction = new CoreSysFunction();
                User_Id.AddRange(_coreFunction.DetectAndRecognize(_Img, path, haarcascades));
                Bitmap toSave = _coreFunction.IdentifyAndMark(haarcascades, _Img);
                toSave.Save(theePath + "/" + _mod.VenueCode.Trim() + ".jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
                _bridge.filePath.Add(imgPath +"/" + _mod.VenueCode.Trim() + ".jpg");
                #endregion

                #region Processing zip
                Stream zipStream = zip.InputStream;
                using (var _img = ZipFile.Read(zipStream))
                {
                    foreach (var file in _img.Entries)
                    {
                        file.Extract(theePath, ExtractExistingFileAction.OverwriteSilently);
                        Image bmp = Image.FromFile(theePath + "/" + file.FileName);
                        Bitmap mbmp = new Bitmap(bmp);
                        fileNames.Add(theePath + "/" + file.FileName);
                        User_Id.AddRange(_coreFunction.DetectAndRecognize(mbmp, path, haarcascades));
                        toSave = _coreFunction.IdentifyAndMark(haarcascades, mbmp);
                        try { toSave.Save(imgPath + "/" + file.FileName); _bridge.filePath.Add(imgPath += "/" + file.FileName); }
                        catch (Exception e) {  }
                        
                    }
                }
                #endregion

                #region object to view
                _bridge.User_Id = new List<string>();
                _bridge.User_Id = User_Id.Distinct();
                _bridge.dateSlice = collector.GetValue("dateHoldhidden").AttemptedValue.Split(' ');
                _bridge.Lecture_Id = Convert.ToInt32(collector.GetValue("Lecture").AttemptedValue);
                Session["Data"] = _bridge;

                #endregion

                return RedirectToActionPermanent("ViewAttendees");
            }
            #endregion

            #region Zip not null
            else if (zip != null)
            {
                return RedirectToActionPermanent("ViewAttendees");
            }
            #endregion

            else
            { return RedirectToActionPermanent("Index"); }
        }
コード例 #13
0
 public bool InsertLecture(Lecture _lecture)
 {
     LectureHandler myHandler = new LectureHandler(); return myHandler.NewLecture(_lecture);
 }
コード例 #14
0
        private async void LectureAddButton_Click(object sender, RoutedEventArgs e)
        {
            Semester selectedSemester = SemesterListBox.SelectedItem as Semester;

            if (selectedSemester == null)
                return;

            try
            {
                
                string lectureName = await DialogManager.ShowInputAsync(this, "강의 제목", "");
                if (string.IsNullOrWhiteSpace(lectureName))
                    return;
                Lecture l = new Lecture(lectureName, 3, "A+");
                
                selectedSemester.Add(l);
                selectedSemester.InvokePropertyChanged();
                SelectedUser.Semesters.InvokePropertyChanged();
                SelectedUser.RefreshGradeString();
            }
            catch (Exception ex)
            {
                await DialogManager.ShowMessageAsync(this, "에러", $"Message : {ex.Message}\nStackTrace : {ex.StackTrace}");
                return;
            }
        }
コード例 #15
0
 public void UpdateLectureDuration(Lecture lecture, int duration)
 {
     lecture.UpdateDuration(duration);
 }
コード例 #16
0
ファイル: LectureAPIController.cs プロジェクト: alex-asd/Arms
 public IHttpActionResult UpdateLecture([FromBody] Lecture lecture)
 {
     lecture.Update();
     return(Ok(new ApiCallbackMessage("Success", true)));
 }
コード例 #17
0
 // GET: Lecture/Create
 public ActionResult Create()
 {
     Lecture _lecture = new Lecture();
     return View(_lecture);
 }
コード例 #18
0
        //Uppdaterar föreläsning i datalagret.
        public void UpdateLecture(Lecture Lecture)
        {
            //Skapar och initierar anslutningobjekt
            using (SqlConnection conn = CreateConnection())
            {
                try
                {
                    SqlCommand cmd = new SqlCommand("appSchema.usp_UpdateLecture", conn);
                    cmd.CommandType = CommandType.StoredProcedure;

                    cmd.Parameters.Add("@Date", SqlDbType.Date).Value = Lecture.LectureDate;
                    cmd.Parameters.Add("@TeacherName", SqlDbType.NVarChar, 50).Value = Lecture.TeacherName;
                    cmd.Parameters.Add("@LectureName", SqlDbType.NVarChar, 50).Value = Lecture.LectureName;
                    cmd.Parameters.Add("@CourseName", SqlDbType.NVarChar, 50).Value = Lecture.CourseName;
                    cmd.Parameters.Add("@LectureID", SqlDbType.NVarChar, 50).Value = Lecture.LectureId;
                    cmd.Parameters.Add("@VideoUrl", SqlDbType.NVarChar, 200).Value = Lecture.VideoUrl;

                    conn.Open();

                    cmd.ExecuteNonQuery();

                }
                catch
                {
                    throw new ApplicationException("Problem occured while updating lecture.");
                }
            }
        }
コード例 #19
0
ファイル: Lecture.cs プロジェクト: rLeblancTemp/ProjetZero3
 // Use this for initialization
 void Awake()
 {
     _ParticulSystem = GameObject.Find("PS");
     LectureObject = this;
 }
コード例 #20
0
 public void UpdateLectureTitle(Lecture lecture, string title)
 {
     lecture.UpdateTitle(title);
 }
コード例 #21
0
        static void Main(string[] args)
        {
            Console.WriteLine("Въведете име");
            Console.WriteLine("Въведете години");
            Console.WriteLine("Въведете години трудов стаж :");
            Console.WriteLine("Въведете предмет");
            string name = Console.ReadLine();
            int age = int.Parse(Console.ReadLine());
            int work_exp;
            do
            {
                work_exp = int.Parse(Console.ReadLine());
            } while (work_exp < 0);

            string predmet = Console.ReadLine();
            Teacher teacher = new Teacher(name, age, work_exp, predmet);
            teacher.PrintInfo(null);
            teacher.Hello();
            teacher.Homework();
            teacher.Bye();
            Console.WriteLine();
            //Console.WriteLine(Teacher.activeCount);
            //Console.WriteLine();
            Console.WriteLine("Въведете име");
            Console.WriteLine("Въведете години");
            Console.WriteLine("Въведете години трудов стаж :");
            Console.WriteLine("Въведете университет");
            name = Console.ReadLine();
            age = int.Parse(Console.ReadLine());
            do
            {
                work_exp = int.Parse(Console.ReadLine());
            } while (work_exp < 0);
            string universe = Console.ReadLine();
            Lecture lecture = new Lecture(name, age, work_exp, universe);
            lecture.PrintInfo(null);
            lecture = new Lecture();
            lecture.Hello();
            lecture.Homework();
            lecture.Exercise1("2", "3");
            lecture.Exercise1("1", "2", "3");
            lecture.Exercise1("1");
            Console.WriteLine();
            //Console.WriteLine(Lecture.activeCount);
            //Console.WriteLine();
            Console.WriteLine("Въведете име");
            Console.WriteLine("Въведете години");
            Console.WriteLine("Въведете години трудов стаж :");
            Console.WriteLine("Въведете университет");
            name = Console.ReadLine();
            age = int.Parse(Console.ReadLine());
            do
            {
                work_exp = int.Parse(Console.ReadLine());
            } while (work_exp < 0);
            universe = Console.ReadLine();
            Console.WriteLine("Ако не сте главен асистент въведете No");
            string value1 = Console.ReadLine();
            bool value = true;
            if (value1 == "No")
            {
                value = false;
            }
            Assistant assistant = new Assistant(value, name, age, work_exp, universe);
            assistant.HeadAssis();
            assistant.PrintInfo(null);
            assistant.Homework();
            assistant.CheckExam();
            assistant.Articles();
            Console.WriteLine();
            //Console.WriteLine(Assistant.activeCount);
            //Console.WriteLine();
            Console.WriteLine("Въведете име");
            Console.WriteLine("Въведете години");
            Console.WriteLine("Въведете години трудов стаж :");
            Console.WriteLine("Въведете университет");
            Console.WriteLine("Въведете титла");
            name = Console.ReadLine();
            age = int.Parse(Console.ReadLine());
            do
            {
                work_exp = int.Parse(Console.ReadLine());
            } while (work_exp < 0);
            universe = Console.ReadLine();
            string title = Console.ReadLine();
            Professor professor = new Professor(title, name, age, work_exp, universe);
            professor.PrintInfo(null);
            professor.Title_agework();
            professor.Homework();
            professor.Exam();
            Console.WriteLine();
            //Console.WriteLine(Professor.activeCount);
            //Console.WriteLine();
            Console.WriteLine("Въведете име");
            Console.WriteLine("Въведете години");
            Console.WriteLine("Въведете години трудов стаж :");
            Console.WriteLine("Въведете предмет");
            Console.WriteLine("Въведете инфо за университета");
            name = Console.ReadLine();
            age = int.Parse(Console.ReadLine());
            do
            {
                work_exp = int.Parse(Console.ReadLine());
            } while (work_exp < 0);
            universe = Console.ReadLine();
            string info = Console.ReadLine();
            CollegeTeacher collegeteacher = new CollegeTeacher(info, name, age, work_exp, predmet);
            collegeteacher.PrintInfo(null);
            collegeteacher.Homework();
            Console.WriteLine();
            //Console.WriteLine(CollegeTeacher.activeCount);
            //Console.WriteLine();
            Console.WriteLine("Въведете име");
            Console.WriteLine("Въведете години");
            Console.WriteLine("Въведете години трудов стаж :");
            Console.WriteLine("Въведете предмет");
            Console.WriteLine("Въведете класове,следа като въведете класовете си напишете Stop");
            name = Console.ReadLine();
            age = int.Parse(Console.ReadLine());
            do
            {
                work_exp = int.Parse(Console.ReadLine());
            } while (work_exp < 0);
            predmet = Console.ReadLine();
            List<string> list = new List<string>();
            string value3; int i = 0;
            do
            {
                if (i == 5)
                {
                    value3 = "Stop";
                }
                else
                {
                    value3 = Console.ReadLine();
                    if (value3 != "Stop")
                    {
                        list.Add(value3);
                    }
                }
                i++;
            } while (value3 != "Stop");
            SchoolTeacher schoolteacher1 = new SchoolTeacher(name,age,work_exp,predmet);
            schoolteacher1.PrintInfo(null);
            SchoolTeacher schoolteacher = new SchoolTeacher(list);
            schoolteacher.Homework();
            schoolteacher.Amazing();
            schoolteacher.PrintList();
            Console.WriteLine();
            Console.WriteLine("Създадени са {0} обекта от наследниците на Person", Person.activeCount);
        }
コード例 #22
0
    /// <summary>
    /// Loads the lecture data.
    /// </summary>
    void LoadLectureData()
    {
        Lecture temp;

        //building 245
        temp = new Lecture (8, "ICT167", "Principles of Computer Science", "Tuesday", "13:30", "15:30", "RLT");
        //add lecture to lecture manager
        lm.AddLecture (temp);
        temp = new Lecture (1, "ICT169", "Foundations of Data Communications", "Monday", "14:30", "16:30", "ECL4");
        lm.AddLecture (temp);
        temp = new Lecture (2, "ICT207", "Games Design & Programming", "Monday", "09:30", "11:30", "AMEN2.024");
        lm.AddLecture (temp);
        temp = new Lecture (3, "ICT211", "Web Computing", "Monday", "12:30", "14:30", "VBS3.023");
        lm.AddLecture (temp);
        temp = new Lecture (4, "ICT265", "Knowledge and Information Security", "Monday", "14:30", "16:30", "LBLT");
        lm.AddLecture (temp);
        temp = new Lecture (5, "ICT347", "Advanced Network Design", "Monday", "14:30", "16:30", "SS1.036");
        lm.AddLecture (temp);
        temp = new Lecture (6, "ICT535", "Advanced Business Data Communications", "Monday", "16:30", "18:30", "Law1.103");
        lm.AddLecture (temp);
        temp = new Lecture (7, "ICT619", "Intelligent Systems Applications", "Monday", "16:30", "19:30", "AMEN2.023");
        lm.AddLecture (temp);
        temp = new Lecture (8, "ICT167", "Principles of Computer Science", "Tuesday", "13:30", "15:30", "RLT");
        lm.AddLecture (temp);
        temp = new Lecture (9, "ICT170", "Foundations of Computer Systems", "Tuesday", "08:30", "10:30", "ECL2");
        lm.AddLecture (temp);
        temp = new Lecture (10, "ICT245", "Games Software Production", "Tuesday", "12:30", "14:30", "AMEN2.024");
        lm.AddLecture (temp);
        temp = new Lecture (11, "ICT310", "Op Syst and Syst Program", "Tuesday", "14:30", "16:30", "VBS3.023");
        lm.AddLecture (temp);
        temp = new Lecture (12, "ICT312", "Virtual Env for Games & Simulations", "Tuesday", "16:30", "18:30", "AMEN2.023");
        lm.AddLecture (temp);
        temp = new Lecture (13, "ICT616", "Data Resources Management", "Tuesday", "16:30", "19:30", "AMEN2.024");
        lm.AddLecture (temp);
        temp = new Lecture (14, "ICT218", "Databases", "Wednesday", "14:30", "16:30", "VBS3.024");
        lm.AddLecture (temp);
        temp = new Lecture (15, "ICT219", "Intelligent Systems", "Wednesday", "11:30", "13:30", "VBS3.023");
        lm.AddLecture (temp);
        temp = new Lecture (16, "ICT313", "Games Technology Project", "Wednesday", "08:30", "10:30", "ECL3");
        lm.AddLecture (temp);
        temp = new Lecture (17, "ICT333", "Info Tech Project", "Wednesday", "08:30", "10:30", "ECL3");
        lm.AddLecture (temp);
        temp = new Lecture (18, "ICT158", "Introduction to Information Systems", "Thursday", "09:30", "11:30", "BSLT");
        lm.AddLecture (temp);
        temp = new Lecture (19, "ICT357", "Information Security Management", "Thursday", "13:30", "15:30", "VBS3.023");
        lm.AddLecture (temp);
        temp = new Lecture (20, "ICT622", "Information Technology Strategy", "Thursday", "16:30", "19:30", "BSLT");
        lm.AddLecture (temp);
        temp = new Lecture (21, "ICT264", "Wireless Networks", "Friday", "13:30", "15:30", "ECL3");
        lm.AddLecture (temp);

        //		//Load lecture data here
        //		TextAsset txtfile = Resources.Load("Lectures/lecture_info") as TextAsset;
        //		char[] separators = {'\n'};
        //		string[] linesFromfile = txtfile.text.Split (separators);
        //		string[] tokens;
        //
        //		foreach (string line in linesFromfile)
        //		{
        //			Lecture temp = new Lecture ();
        //			tokens = line.Split (';');
        //
        //			temp.SetID(Int32.Parse(tokens[0]));
        //			temp.SetUnitCode(tokens[1]);
        //			temp.SetUnitName(tokens[2]);
        //			temp.SetDay(tokens[3]);
        //			temp.SetStart(tokens[4]);
        //			temp.SetEnd(tokens[5]);
        //			temp.SetRoom(tokens[6]);
        //
        //			lm.AddLecture(temp); //add lecture to lecture list

            //Debug.Log(temp.GetID() + " " + temp.GetUnitCode() + " " +  temp.GetUnitName() + " " +  temp.GetDay()
            //          + " " +  temp.GetStart() + " " +  temp.GetEnd() + " " +  temp.GetRoom());
        //		}
    }
コード例 #23
0
 public void AddLecture(Lecture lecture)
 {
     this.Lectures.Add(lecture);
 }
コード例 #24
0
        private void updateDetails()
        {
            foreach (ClassRoom classRoom in classRoomList)
            {
                if (classRoom.name.Equals(comboBox.SelectedValue))
                {
                    currentClassId = classRoom._id;
                    List <Lecture> lectureList = connector.getLectures(Manager.getInstance().getToken(), currentClassId);
                    lecture      = lectureList[lectureList.Count - 1];
                    feedbackList = lecture.feedbacks;
                    questionList = lecture.questions;
                    feedbackListView.Items.Clear();
                    questionListView.Items.Clear();
                    badValue.Value     = 0;
                    goodValue.Value    = 0;
                    neutralValue.Value = 0;


                    foreach (Feedback f in feedbackList)
                    {
                        StackPanel l  = new StackPanel();
                        TextBlock  t1 = new TextBlock();
                        TextBlock  t2 = new TextBlock();

                        t1.Text = f.details;
                        t2.Text = f.semantic;

                        l.Children.Add(t2);
                        l.Children.Add(t1);

                        feedbackListView.Items.Add(l);
                        Console.WriteLine(f.semantic);
                        if (f.semantic.Equals("bad"))
                        {
                            badValue.Value += 1;
                        }
                        if (f.semantic.Equals("neutral"))
                        {
                            neutralValue.Value += 1;
                        }
                        if (f.semantic.Equals("good"))
                        {
                            goodValue.Value += 1;
                        }
                    }

                    foreach (Question q in questionList)
                    {
                        if (q.answered)
                        {
                            continue;
                        }
                        Console.WriteLine(q.answers);
                        StackPanel l = new StackPanel();
                        l.Tag = q._id;
                        TextBlock t1 = new TextBlock();
                        t1.FontSize = 15;
                        TextBlock t2 = new TextBlock();

                        t1.Text = q.title;
                        t2.Text = q.details;

                        l.Children.Add(t1);
                        l.Children.Add(t2);

                        questionListView.Items.Add(l);
                    }
                }
            }
        }
コード例 #25
0
        public ActionResult <Lecture> Create(Lecture lect)
        {
            _lectureService.Create(lect);

            return(CreatedAtRoute("GetLecture", new { id = lect.Id.ToString() }, lect));
        }
コード例 #26
0
ファイル: Program.cs プロジェクト: geoInnovators/ilia_uni
 public Schedule(Lecture[] lectures)
 {
     this.Lectures = lectures;
 }
コード例 #27
0
 public void UpdateLectureRepo(Lecture lecture)
 {
     _repo.UpdateLecture(lecture);
 }
コード例 #28
0
ファイル: CoursePage.xaml.cs プロジェクト: ruze00/Apps
 private void StartDownload(Lecture lecture)
 {
     videoLazyBlocks.Add(lecture.Id, new LazyBlock<string>(
         "video location",
         null,
         lecture.VideoUrl,
         _ => false,
         new LazyBlockUI<string>(
             this,
             videoUrl =>
             {
                 ErrorReporting.Log("Queued download");
                 lecture.DownloadInfo.QueueDowload(videoUrl);
             },
             () => false,
             null),
         false,
         null,
         _ => videoLazyBlocks.Remove(lecture.Id),
         null));
 }
コード例 #29
0
        //Lägger till föreläsning i datalagret.
        public void InsertLecture(Lecture Lecture)
        {
            using (var conn = CreateConnection())
            {
                try
                {
                    var cmd = new SqlCommand("appSchema.usp_CreateLecture", conn);
                    cmd.CommandType = CommandType.StoredProcedure;

                    cmd.Parameters.Add("@Date", SqlDbType.Date).Value = Lecture.LectureDate;
                    cmd.Parameters.Add("@Teacher", SqlDbType.NVarChar, 50).Value = Lecture.TeacherName;
                    cmd.Parameters.Add("@LectureName", SqlDbType.NVarChar, 50).Value = Lecture.LectureName;
                    cmd.Parameters.Add("@CourseName", SqlDbType.NVarChar, 50).Value = Lecture.CourseName;
                    cmd.Parameters.Add("@VideoUrl", SqlDbType.NVarChar, 200).Value = Lecture.VideoUrl;

                    conn.Open();

                    cmd.ExecuteNonQuery();
                }
                catch
                {
                    throw new ApplicationException("An error occured while adding lectures to database.");
                }
            }
        }