コード例 #1
0
        public ActionResult RegisterSubject(string Id_Class, string Id_Subject, string Id_Teacher, int Year_Term)
        {
            if (Session["student_subject"] == null)
            {
                var gv            = TeacherAction.GetAll();
                var mh            = SubjectAction.GetAll();
                var lop           = ClassAction.GetAll();
                var nam           = YearTermAction.GetAll();
                var teacher_info  = gv.Find(a => a.id == Id_Teacher);
                var subject_infor = mh.Find(a => a.id == Id_Subject);
                var class_info    = lop.Find(a => a.id == Id_Class);
                var year_info     = nam.Find(a => a.year_term == Year_Term);
                List <Tuple <Subject, YearTerm, Class, Teacher> > lst = new List <Tuple <Subject, YearTerm, Class, Teacher> >();
                Tuple <Subject, YearTerm, Class, Teacher>         tup = new Tuple <Subject, YearTerm, Class, Teacher>(subject_infor, year_info, class_info, teacher_info);
                lst.Add(tup);
                Session["student_subject"] = lst;
            }
            else
            {
                List <Tuple <Subject, YearTerm, Class, Teacher> > lst = (List <Tuple <Subject, YearTerm, Class, Teacher> >)Session["student_subject"];
                var gv            = TeacherAction.GetAll();
                var mh            = SubjectAction.GetAll();
                var lop           = ClassAction.GetAll();
                var nam           = YearTermAction.GetAll();
                var teacher_info  = gv.Find(a => a.id == Id_Teacher);
                var subject_infor = mh.Find(a => a.id == Id_Subject);
                var class_info    = lop.Find(a => a.id == Id_Class);
                var year_info     = nam.Find(a => a.year_term == Year_Term);
                Tuple <Subject, YearTerm, Class, Teacher> tup = new Tuple <Subject, YearTerm, Class, Teacher>(subject_infor, year_info, class_info, teacher_info);
                lst.Add(tup);
                Session["student_subject"] = lst;
            }

            return(Redirect("~/Student/RegisterSubject"));
        }
コード例 #2
0
 public ActionResult CreateSubject()
 {
     if ((string)Session["role"] == "Admin")
     {
         ViewBag.ChuyenNganh = SpecializedAction.GetAll();
         ViewBag.Nganh       = MajorAction.GetAll();
         ViewBag.Lop         = ClassAction.GetAll();
         ViewBag.MH          = SubjectAction.ShowAll();
         ViewBag.GV          = TeacherAction.GetAll();
         ViewBag.YearTerm    = YearTermAction.GetAll();
         return(View());
     }
     else
     {
         return(Redirect("~/Home/Index"));
     }
 }
コード例 #3
0
 public ActionResult GiangVienInfo()
 {
     if ((string)Session["role"] == "Teacher")
     {
         var tmp = TeacherAction.ShowAll();
         for (int i = 0; i < tmp.Count; i++)
         {
             if (tmp[i].Item1.id == (string)Session["id"])
             {
                 ViewBag.Gv = tmp[i];
                 break;
             }
         }
         return(View());
     }
     return(Redirect("~/Home/Index"));
 }
コード例 #4
0
 public ActionResult CreateTeacher()
 {
     if ((string)Session["role"] == "Admin")
     {
         var         teacher  = UserAction.GetAll();
         List <User> lst_user = new List <User>();
         for (int i = 0; i < teacher.Count; i++)
         {
             if (teacher[i].role == "Teacher" && TeacherAction.Find(teacher[i].id_number) == null)
             {
                 lst_user.Add(teacher[i]);
             }
         }
         ViewBag.Account = lst_user;
         ViewBag.Nganh   = MajorAction.GetAll();
         ViewBag.Lop     = ClassAction.GetAll();
         ViewBag.GV      = TeacherAction.ShowAll();
         return(View());
     }
     else
     {
         return(Redirect("~/Home/Index"));
     }
 }
コード例 #5
0
 public ActionResult CreateTeacher(string Id, string First_Name, string Last_Name, string Email, string Phone, string Address, string Date_Of_Birth, string Degree, string Major_Name)
 {
     TeacherAction.Add_Teacher(Id, First_Name, Last_Name, Email, Phone, Date_Of_Birth, Address, Degree, Major_Name);
     return(Redirect("~/Member/CreateTeacher"));
 }
コード例 #6
0
        /// <summary>
        /// 屏幕主菜单
        /// </summary>
        /// <param name="type"></param>
        private void SendAction(TeacherAction type)
        {
            switch (type)
            {
            case TeacherAction.menuClassNamed_Click:
                CallForm frm = new CallForm();
                frm.ShowDialog(this);
                break;

            case TeacherAction.menuExportSign_Click:
                ExportSign();
                break;

            case TeacherAction.menuGroupChat_Click:
                ChatToALL();
                break;

            case TeacherAction.menuTeamCreate_Click:
                TeamDiscuss formTeam = new TeamDiscuss(onlineInfo);
                formTeam.ShowDialog();
                break;

            case TeacherAction.menuViewTeam_Click:
                TeamView teamView = new TeamView();
                teamView.ShowDialog();
                break;

            case TeacherAction.menuSilence_Click:
                if (menuSilence.Text == "屏幕肃静")
                {
                    GlobalVariable.client.Send_Quiet();
                    menuSilence.Text = "解除屏幕肃静";
                }
                else
                {
                    GlobalVariable.client.Send_StopQuiet();
                    menuSilence.Text = "屏幕肃静";
                }
                break;

            case TeacherAction.menuRomoteControl_Click:
                //if (lvOnline.SelectedItems.Count <= 0)
                //{
                //    GlobalVariable.ShowWarnning("请先选择要控制的" + _clientTitle);
                //    return;
                //}
                //string username = lvOnline.SelectedItems[0].SubItems[2].Text;
                GetSelectStudentUserName();
                if (!string.IsNullOrWhiteSpace(actionStuUserName))
                {
                    if (menuRomoteControl.Text == "禁用键鼠")
                    {
                        GlobalVariable.client.Send_LockScreen(actionStuUserName);
                        menuRomoteControl.Text = "解锁";
                    }
                    else
                    {
                        GlobalVariable.client.Send_StopLockScreen(actionStuUserName);
                        menuRomoteControl.Text = "禁用键鼠";
                    }
                }
                break;

            case TeacherAction.menuScreenShare_Click:
                string text = menuScreenShare.Text;
                if (text == "屏幕广播")
                {
                    if (!isPush)
                    {
                        GlobalVariable.client.Send_ScreenInteract();
                        menuScreenShare.Text = "关闭广播";
                        isPush = true;
                    }
                    else
                    {
                        //  showTip();
                        return;
                    }
                }
                else
                {
                    GlobalVariable.client.StopScreenInteract();
                    GlobalVariable.client.Send_StopScreenInteract();
                    menuScreenShare.Text = "屏幕广播";
                    isPush = false;
                }
                break;

            case TeacherAction.menuStudentShow_Click:
                string menuStudentText = menuStudentShow.Text;
                if (!isStudentShowing)
                {
                    GetSelectStudentUserName();
                    if (!string.IsNullOrWhiteSpace(actionStuUserName))
                    {
                        GlobalVariable.client.Send_CallStudentShow(actionStuUserName);
                        menuStudentShow.Text = "关闭演示";
                        isStudentShowing     = true;
                    }
                }
                else
                {
                    if (!string.IsNullOrWhiteSpace(actionStuUserName))
                    {
                        GlobalVariable.client.Send_StopStudentShow(actionStuUserName);
                        actionStuUserName    = null;
                        menuStudentShow.Text = _clientTitle + "演示";
                        isStudentShowing     = false;
                    }
                }
                break;

            case TeacherAction.menuVideoLive_Click:
                string menuVideoLiveText = menuVideoLive.Text;
                if (menuVideoLiveText == "视频直播")
                {
                    if (!isPush)
                    {
                        GlobalVariable.client.Send_VideoInteract();
                        menuVideoLive.Text = "关闭直播";
                        isPush             = true;
                    }
                    else
                    {
                        //  showTip();
                        return;
                    }
                }
                else
                {
                    GlobalVariable.client.StopScreenInteract();
                    GlobalVariable.client.Send_StopScreenInteract();
                    menuVideoLive.Text = "视频直播";
                    isPush             = false;
                }
                break;

            case TeacherAction.menuFileShare_Click:
                ChatToALL();
                chatForm.UploadFileToALL();     // 暂时屏蔽
                break;

            case TeacherAction.menuFileShare2_Click:

                break;

            case TeacherAction.menuAccount_Click:
                break;

            case TeacherAction.menuVideoRecord_Click:

                if (this.menuVideoRecord.Text == "屏幕录制")
                {
                    GlobalVariable.BeginRecordVideo();
                    this.menuVideoRecord.Image = Resources.录制;
                    GlobalVariable.ShowNotifyMessage("正在屏幕录制中...", -1);
                    this.menuVideoRecord.Text = "停止录制";
                }
                else
                {
                    GlobalVariable.EndRecordVideo();
                    GlobalVariable.ShowNotifyMessage("录制完成,视频文件在程序目录的VideoRecord中", -1);
                    this.menuVideoRecord.Image = Resources.未录制;
                    this.menuVideoRecord.Text  = "屏幕录制";
                }
                break;

            default:
                break;
            }
        }