public RemarkController()
 {
     rb = new RemarkBll();
     pb = new ProjectBll();
     sb = new StudentBll();
     cb = new ClassBll();
 }
        /// <summary>
        /// 查询学生是否已经选题
        /// </summary>
        /// <returns></returns>
        public ActionResult QueryWhetherChooseThesis()
        {
            string sno  = Session["account"].ToString();
            bool   flag = new StudentBll().HasChooseThesis(sno);

            return(Json(new { isChoose = flag }));
        }
        public StudentEditPresenter(StudentEditView studentEditView, StudentBll studentBll)
        {
            this._studentEditView = studentEditView;
            _studentBll           = studentBll;

            UpdateForm();
        }
        private void ViewStudentReport()
        {
            StudentBll     studentBll = new StudentBll();
            List <Student> list       = studentBll.GetStudents();

            var student = new DataTable("Students");

            student.Columns.Add("Id");
            student.Columns.Add("Name");
            student.Columns.Add("RollNo");
            student.Columns.Add("Address");
            student.Columns.Add("Username");
            student.Columns.Add("Password");
            foreach (Student c in list)
            {
                DataRow dr = student.NewRow();
                dr["Id"]       = c.Id;
                dr["Name"]     = c.Name;
                dr["RollNo"]   = c.RollNumber;
                dr["Address"]  = c.Address;
                dr["Username"] = c.UserName;
                dr["Password"] = c.Password;
                student.Rows.Add(dr);
            }
            ReportViewer.LocalReport.DataSources.Clear();

            ReportViewer.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("StudentReportDataSet", student));

            ReportViewer.LocalReport.ReportPath = @"C:\Users\M.Jahangeer\documents\visual studio 2013\Projects\TeacherFacilitationSystem\TeacherFacilitationSystem\StudentReport.rdlc";

            ReportViewer.LocalReport.EnableExternalImages = true;

            ReportViewer.RefreshReport();
        }
Exemplo n.º 5
0
        private void Btn_FindStudent(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(TextBox1.Text) && string.IsNullOrEmpty(TextBox2.Text))
            {
                MessageBox.Show("Search fields, Name or RollNo is empty.");
                return;
            }

            var     studentBll = new StudentBll();
            Student student    = studentBll.GetStudentData(TextBox1.Text, TextBox2.Text);

            if (student == null)
            {
                MessageBox.Show("No such student exists.");
                return;
            }

            TextBox1.Text = student.Name;
            TextBox2.Text = student.RollNumber;
            TextBox3.Text = student.Address;
            TextBox4.Text = student.UserName;
            TextBox5.Text = student.Password;

            rollnumber = student.RollNumber;
        }
Exemplo n.º 6
0
        private void Btn_Update_Detail(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(TextBox1.Text) ||
                string.IsNullOrEmpty(TextBox2.Text) ||
                string.IsNullOrEmpty(TextBox3.Text) ||
                string.IsNullOrEmpty(TextBox4.Text) ||
                string.IsNullOrEmpty(TextBox5.Text))
            {
                MessageBox.Show("One of fields are empty.");
                return;
            }

            var student = new Student
            {
                Name       = TextBox1.Text,
                Address    = TextBox3.Text,
                UserName   = TextBox4.Text,
                Password   = TextBox5.Text,
                RollNumber = rollnumber
            };
            var studentBll = new StudentBll();

            if (studentBll.UpdateStudent(student))
            {
                MessageBox.Show("Record Updated");
                Close();
            }
            else
            {
                MessageBox.Show("Some thing went wrong.");
                Close();
            }
        }
        /// <summary>
        /// 查询毕业年份为x,审核通过的教师拟定的论题
        /// </summary>
        /// <returns></returns>
        public ActionResult QueryTeacherThesis()
        {
            int usingYear  = Convert.ToInt32(HttpContext.Application["userYear"]);
            var thesisList = new StudentBll().QueryTeacherThesisBll(usingYear);

            return(Json(thesisList, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 8
0
        public MarkBll EditMark(StudentBll student, int grade, TeachersWorkloadBll teachersWorkload)
        {
            Student          stud = mapper.Map <Student>(student);
            TeachersWorkload tw   = mapper.Map <TeachersWorkload>(teachersWorkload);
            Mark             mark = db.Marks.Get(m => (m.Student.Id == student.Id) && (m.TeachersWorkload.Id == teachersWorkload.Id)).SingleOrDefault();
            MarkBll          markBll;

            if (mark == null)
            {
                try
                {
                    markBll = AddMark(grade, stud, tw, true);
                }
                catch
                {
                    return(null);
                }
            }
            else
            {
                try
                {
                    markBll = EditMark(mark, grade);
                }
                catch
                {
                    return(null);
                }
            }
            return(markBll);
        }
Exemplo n.º 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //TODO 改成从session里获取值
            student = (Student)Session["loginuser"];
            StudentBll sbll = new StudentBll();
            string     op   = Request.QueryString["op"];

            try
            {
                student = sbll.GetModel(student.StuAccount);
                if (op == "update")
                {
                    string     phone   = Context.Request["phone"].ToString();
                    string     Email   = Context.Request["Email"].ToString();
                    Student    newStu  = new Student();
                    College    college = new College();
                    Profession pro     = new Profession();
                    newStu.StuAccount = student.StuAccount;
                    newStu.RealName   = student.RealName;
                    newStu.StuPwd     = student.StuPwd;
                    newStu.Sex        = student.Sex;
                    newStu.college    = student.college;
                    newStu.profession = student.profession;
                    newStu.Phone      = phone;
                    newStu.Email      = Email;
                    updata(newStu);
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(this.GetType(), ex);
            }
        }
 public StudentFormController(StudentForm studentForm, StudentBll studentBll, CourseBll courseBll)
 {
     _studentForm = studentForm;
     _studentBll  = studentBll;
     _courseBll   = courseBll;
     UpdateForm();
 }
Exemplo n.º 11
0
        private void GetData()
        {
            var            studentBll = new StudentBll();
            List <Student> list       = studentBll.GetStudents();

            StudentDataGrid.ItemsSource = list;
        }
Exemplo n.º 12
0
        public GradeBook GetMyMarks()
        {
            var userName = userService.GetCurrentUserId();

            if (string.IsNullOrEmpty(userName))
            {
                throw new ArgumentNullException("userName is not available", userName);
            }
            Student student = db.Students.Get(s => s.Identity.UserName == userName).SingleOrDefault();

            if (student == null)
            {
                throw new ArgumentException("This student does not exists", userName);
            }
            var                   st           = mapper.Map <StudentBll>(student);
            var                   gr           = db.Groups.Get(gro => gro.Id == student.GroupId).SingleOrDefault();
            StudentBll            studentBll   = mapper.Map <StudentBll>(student);
            IEnumerable <MarkBll> studentMarks = markService.GetAllMarks(studentBll);
            var                   marks        = new List <MarkBll>(studentMarks);
            GradeBook             gradeBook    = new GradeBook()
            {
                Student = studentBll,
                Marks   = studentMarks
            };

            return(gradeBook);
        }
Exemplo n.º 13
0
        private void GetStudents()
        {
            site = new DBSite();
            StudentBll stBll = new StudentBll();

            string classIDs = ddlPresentClass.SelectedValue;



            //try
            {
                // List<StudentBll.StudenEntity>  students = stBll.GetStudents(site);
                List <StudentBll.StudenEntity> students = stBll.GetStudentsByClass(site, "", classIDs);
                //total_records = students.Count;
                gridView1.DataSource = students;
                gridView1.DataBind();
            }
            //catch (Exception exception)
            //{
            //    util.HandleExpception(exception, Response);
            //}
            //finally
            //{
            //    site.Close();
            //}
        }
Exemplo n.º 14
0
        public TeacherFormPresenter(TeacherEditView teacherEditView, StudentBll studentBll, TeacherBll teacherBll)
        {
            _teacherEditView = teacherEditView;
            _studentBll      = studentBll;
            _teacherBll      = teacherBll;

            UpdateForm();
        }
Exemplo n.º 15
0
        protected void GetStudents()
        {
            StudentBll sBll = new StudentBll();
            //StudentBll.StudenEntity st = sBll.GetStudents(site, util.CheckNullInt(lblStudentMasterId.Text));
            List <StudentBll.StudenEntity> st = sBll.GetStudentsByClass(site, "", GetSelectedIds(gridView2, 1));

            gridView1.DataSource = st;
            gridView1.DataBind();
        }
Exemplo n.º 16
0
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            site = new DBSite();
            StudentBll stBll = new StudentBll();

            List <string> student_id_list = new List <string>();

            try
            {
                foreach (GridViewRow gr in gridView1.Rows)
                {
                    CheckBox cb = (CheckBox)gr.Cells[0].FindControl("myCheckBox");
                    if (cb.Checked)
                    {
                        //if (stBll.IsStudentPresentInAttendance(site, util.CheckNullInt(gr.Cells[2].Text)))
                        //{
                        //    lblError.Text = "Can't Delete Record:'" + gr.Cells[4].Text + "' This Student is being entered in Attendance Entry.";
                        //    lblError.Visible = true;
                        //    ClearSuccessMessage();
                        //    return;
                        //}

                        student_id_list.Add(gr.Cells[3].Text);
                    }
                }


                if (student_id_list.Count < 1)
                {
                    lblError.Text    = "Can't Delete Records. Select at least one Record  ";
                    lblError.Visible = true;
                    ClearSuccessMessage();
                    return;
                }

                string st_ids = util.ConvertListToCommaSeparatedString(student_id_list);


                site.BeginTrans();
                stBll.DeleteStudent(site, st_ids);
                site.Commit();

                lblMessage.Text    = " [ " + student_id_list.Count + "] Record Deleted ";
                lblMessage.Visible = true;
                ClearErrorMessage();
            }
            catch (Exception del_exception)
            {
                site.RollBack();
                util.HandleExpception(del_exception, Response);
            }
            finally
            {
                site.Close();
            }
            GetStudents();
        }
Exemplo n.º 17
0
        public Quiz()
        {
            InitializeComponent();
            //_count++;
            var stBll = new StudentBll();

            _list = stBll.GetQuestionsList();
            ShowQuestion();
        }
Exemplo n.º 18
0
        /// <summary>
        /// 实现分页
        /// </summary>
        /// <param name="strWhere">搜索条件</param>
        public void getdata(String strWhere)
        {
            string currentPage = Request.QueryString["currentPage"];

            if (currentPage == null || currentPage.Length <= 0)
            {
                currentPage = "1";
            }
            string userType    = Session["state"].ToString();
            string userCollege = "";

            //usertype=2 为分院管理员登录
            if (userType == "2")
            {
                Teacher tea           = (Teacher)Session["user"];
                int     userCollegeId = tea.college.ColID;
                if (strWhere == null || strWhere == "")
                {
                    userCollege = "collegeId=" + "'" + userCollegeId + "'";
                }
                else
                {
                    userCollege = "collegeId=" + "'" + userCollegeId + "'" + "and" + "(" + strWhere + ")";
                }
                StudentBll   pro       = new StudentBll();
                TableBuilder tabuilder = new TableBuilder()
                {
                    StrTable      = "V_Student",
                    StrWhere      = userCollege,
                    IntColType    = 0,
                    IntOrder      = 0,
                    IntPageNum    = int.Parse(currentPage),
                    IntPageSize   = pagesize,
                    StrColumn     = "stuAccount",
                    StrColumnlist = "*"
                };
                getCurrentPage = int.Parse(currentPage);
                ds             = pro.SelectBypage(tabuilder, out count);
            }
            else
            {
                StudentBll   pro       = new StudentBll();
                TableBuilder tabuilder = new TableBuilder()
                {
                    StrTable      = "V_Student",
                    StrWhere      = strWhere == null ? "" : strWhere,
                    IntColType    = 0,
                    IntOrder      = 0,
                    IntPageNum    = int.Parse(currentPage),
                    IntPageSize   = pagesize,
                    StrColumn     = "stuAccount",
                    StrColumnlist = "*"
                };
                getCurrentPage = int.Parse(currentPage);
                ds             = pro.SelectBypage(tabuilder, out count);
            }
        }
Exemplo n.º 19
0
        public static void Run()
        {
            Console.WriteLine($"开始运行{nameof(Demo1)}");
            StudentBll            studentBll = new StudentBll();
            IEnumerable <Student> students   = studentBll.GetStudents();

            foreach (Student student in students)
            {
                Console.WriteLine(student);
            }
            Console.WriteLine($"结束运行{nameof(Demo1)}");
        }
Exemplo n.º 20
0
        public static void Run()
        {
            Console.WriteLine($"开始运行{nameof(Demo1)}");
            var studentBll = new StudentBll();
            var students   = studentBll.GetStudents();

            foreach (var student in students)
            {
                Console.WriteLine(student);
            }
            Console.WriteLine($"结束运行{nameof(Demo1)}");
        }
Exemplo n.º 21
0
        IEnumerable <MarkBll> IMarkService.GetAllMarks(StudentBll student)
        {
            IEnumerable <Mark> marks = db.Marks.Get(m => m.StudentId == student.Id);

            if (marks == null)
            {
                return(null);
            }
            IEnumerable <MarkBll> marksbll = mapper.Map <IEnumerable <MarkBll> >(marks);

            return(marksbll);
        }
Exemplo n.º 22
0
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            site = new DBSite();
            StudentBll stBll = new StudentBll();

            // 777
            List <StudentBll.StudenEntity> students = stBll.SearchStudents(site, txtSearch.Text);

            // total_records = students.Count;
            gridView1.DataSource = students;
            gridView1.DataBind();
        }
Exemplo n.º 23
0
        //student see the teacher content
        public ActionResult StudentView()
        {
            if (StudentSessionControl())
            {
                try
                {
                    int Id = Convert.ToInt32(Session["StudentId"]);

                    var _Student = db.Students.FirstOrDefault(x => x.Id == Id);
                    var _Batch   = db.Batchs.FirstOrDefault(x => x.Id == _Student.BatchId);

                    var _Content = _ShareContentBll.StudentContentShowViewModels(_Student, _Batch);

                    if (_Content != null)
                    {
                        StudentBll _StudentBll = new StudentBll();
                        RoutineBll _RoutineBll = new RoutineBll();
                        //list of course
                        int UserId             = Convert.ToInt32(Session["StudentId"]);
                        var StudentInfo        = db.Students.Where(s => s.Id == UserId).FirstOrDefault();
                        var ListOfAssignCourse = _RoutineBll.CourseDepartments(StudentInfo);
                        //room assign list
                        var RoomAssingList = _RoutineBll.RoomAssignViewModels(StudentInfo);
                        ViewBag.RoomAssignList         = RoomAssingList;
                        ViewBag.CourseAssignForStudent = ListOfAssignCourse;
                        //classmates
                        var StudentId = db.Students.Where(s => s.Id == UserId).FirstOrDefault();
                        ViewBag.StudentsList = _StudentBll.StudentsListForStudentShow(StudentId);
                        //Course list all
                        ViewBag.CourseListAll = db.Courses.Where(w => w.DepartmentId == StudentInfo.DepartmentId).ToList().OrderBy(x => x.Semester);
                        //post content
                        ViewBag.Content = _Content;
                    }
                    else
                    {
                        ViewBag.Content = null;
                    }
                    //get comments list
                    var CommentsList = _ShareContentBll.AllShareCommentViewModels();
                    ViewBag.Comments = CommentsList;
                    //get Thanks list
                    var ThanksList = db.ThanksButtons.ToList();
                    ViewBag.Thanks = ThanksList;
                    return(View());
                }
                catch (Exception)
                {
                    RedirectToAction("Login", "Students");
                }
            }
            return(StudentLoginFaild());
        }
Exemplo n.º 24
0
        protected void GetStudentsByClass()
        {
            ddlStudent.Items.Clear();

            site = new DBSite();
            StudentBll stBLL = new StudentBll();
            List <StudentBll.StudenEntity> studentList = stBLL.GetStudentsByClass(site, "", ddlClass.SelectedValue);

            foreach (StudentBll.StudenEntity st in studentList)
            {
                ddlStudent.Items.Add(new ListItem(st.StudentName, st.StudentMasterId.ToString()));
            }
        }
        private void GetData()
        {
            StudentBll studentBll = new StudentBll();

            list = studentBll.GetAnnouncements();
            AnnouncementComboBox.DataContext = list;
            for (int i = 0; i < list.Count; i++)
            {
                ComboBoxItem item = new ComboBoxItem();
                item.Content = list[i].Title;
                AnnouncementComboBox.Items.Add(item);
            }
        }
Exemplo n.º 26
0
        private void saveButton_Click(object sender, EventArgs e)
        {
            Student aStudent = new Student();

            aStudent.RegistationNumber = regNoTextBox.Text;
            aStudent.Email             = emailTextBox.Text;
            aStudent.Address           = addressTextBox.Text;

            StudentBll aStudentBll = new StudentBll();
            string     msg         = aStudentBll.SaveIntoDataBase(aStudent);

            MessageBox.Show(msg);
        }
Exemplo n.º 27
0
        public bool IsDuplicateCardNo(DBSite site, string cardNo, int studentId)
        {
            StudentBll sBll = new StudentBll();

            if (sBll.IsDuplicateCard(site, cardNo, studentId))
            {
                lblError.Visible = true;
                lblError.Text    = "Id Card No '" + cardNo + "' already exists in our System.";
                txtIdCardNo.Focus();

                return(true);
            }
            return(false);
        }
Exemplo n.º 28
0
        /// <summary>
        /// 分页
        /// </summary>
        /// <param name="strWhere"></param>
        public void getdata(String strWhere)
        {
            loginUser   = (Teacher)Session["user"];
            collegeName = loginUser.college.ColName.ToString();
            string currentPage = Request.QueryString["currentPage"];

            if (currentPage == null || currentPage.Length <= 0)
            {
                currentPage = "1";
            }
            BLL.StudentBll sdao    = new StudentBll();
            StudentBll     pro     = new StudentBll();
            string         account = "collegeName = '" + collegeName + "'";
            string         Account = "collegeName = '" + collegeName + "' and ";
            int            state   = int.Parse(Session["state"].ToString());

            if (state == 2)
            {
                TableBuilder tabuilder = new TableBuilder()
                {
                    StrTable      = "V_Plan",
                    StrWhere      = strWhere == null || strWhere == "" ? account : Account + strWhere,
                    IntColType    = 0,
                    IntOrder      = 0,
                    IntPageNum    = int.Parse(currentPage),
                    IntPageSize   = pagesize,
                    StrColumn     = "planId",
                    StrColumnlist = "*"
                };
                getCurrentPage = int.Parse(currentPage);
                plands         = pro.SelectBypage(tabuilder, out count);
            }
            else
            {
                TableBuilder tabuilder = new TableBuilder()
                {
                    StrTable      = "V_Plan",
                    StrWhere      = strWhere == null || strWhere == "" ? "" : strWhere,
                    IntColType    = 0,
                    IntOrder      = 0,
                    IntPageNum    = int.Parse(currentPage),
                    IntPageSize   = pagesize,
                    StrColumn     = "planId",
                    StrColumnlist = "*"
                };
                getCurrentPage = int.Parse(currentPage);
                plands         = pro.SelectBypage(tabuilder, out count);
            }
        }
Exemplo n.º 29
0
        public void RefreshStudentRecentSubjectTest()
        {
            StudentBll bll        = new StudentBll();
            List <int> subjectIds = new List <int>();

            subjectIds.Add(10208);
            subjectIds.Add(10004);
            //for (int index = 1; index <= 2; index++)
            //{
            //    subjectIds.Add(10205 + index);

            //}

            bll.RefreshStudentRecentSubject(10000, subjectIds);
        }
Exemplo n.º 30
0
        /// <summary>
        /// 实现分页
        /// </summary>
        /// <param name="strWhere">搜索条件</param>
        ///
        public void getdata(String strWhere)
        {
            DefenceGroup defenceGroup = defenceBll.SelectGroup(Convert.ToInt32(Session["defenGroupId"]));

            if (defenceGroup != null)
            {
                leaderAccount = defenceGroup.leader;
                memberAccount = defenceGroup.member;
                recordAccount = defenceGroup.recorder;
                string currentPage = Request.QueryString["currentPage"];
                if (currentPage == null || currentPage.Length <= 0)
                {
                    currentPage = "1";
                }
                string userType    = Session["state"].ToString();
                string userCollege = "";
                //usertype=2 为分院管理员登录
                if (userType == "2")
                {
                    int userCollegeId = tea.college.ColID;
                    if (strWhere == null || strWhere == "")
                    {
                        userCollege = @"collegeId = " + userCollegeId + " and teaAccount not like " + leaderAccount + " and teaAccount not like " + memberAccount + " and teaAccount not like " + recordAccount
                                      + " and crossTea not like " + leaderAccount + " and crossTea not like " + memberAccount + " and crossTea not like " + recordAccount + " and state=0";
                    }
                    else
                    {
                        userCollege = @"collegeId = " + userCollegeId + " and teaAccount not like " + leaderAccount + " and teaAccount not like " + memberAccount + " and teaAccount not like " + recordAccount
                                      + " and crossTea not like " + leaderAccount + " and crossTea not like " + memberAccount + " and crossTea not like " + recordAccount + " and state=0 and " + strWhere;
                    }
                    StudentBll   pro       = new StudentBll();
                    TableBuilder tabuilder = new TableBuilder()
                    {
                        StrTable      = "V_DefenAndStudent",
                        StrWhere      = userCollege,
                        IntColType    = 0,
                        IntOrder      = 0,
                        IntPageNum    = int.Parse(currentPage),
                        IntPageSize   = pagesize,
                        StrColumn     = "titleRecordId",
                        StrColumnlist = "titleRecordId,collegeName,proName,stuAccount,realName"
                    };
                    getCurrentPage = int.Parse(currentPage);
                    ds             = pro.SelectBypage(tabuilder, out count);
                }
            }
        }