Beispiel #1
0
            public async Task <string> Handle(Query request, CancellationToken cancellationToken)
            {
                var student = _context.Students.Where(x => x.Name.Equals(request.Name));

                if (student.Count() <= 0)
                {
                    var err = new DataObjectNotFoundException(nameof(student));

                    LogMethods.LogError("Student not found", err, request.Logger);

                    throw err;
                }

                var report = new StudentReport()
                {
                    StudentName = student.First().Name,
                    YearGrade   = student.First().Grade
                };

                using (var stream = new MemoryStream())
                {
                    await JsonSerializer.SerializeAsync(stream, report);

                    stream.Position  = 0;
                    using var reader = new StreamReader(stream);
                    return(await reader.ReadToEndAsync());
                }
            }
    // Methods
    public SchoolYearScoreReportNew()
    {
        string reportName = "學年成績單(新制)";
        string reportPath = "成績相關報表";

        this.buttonStudent          = new ButtonAdapter();
        this.buttonStudent.Text     = reportName;
        this.buttonStudent.Path     = reportPath;
        this.buttonStudent.OnClick += new EventHandler(this.buttonStudent_OnClick);
        this.buttonClass            = new ButtonAdapter();
        this.buttonClass.Text       = reportName;
        this.buttonClass.Path       = reportPath;
        this.buttonClass.OnClick   += new EventHandler(this.buttonClass_OnClick);
        StudentReport.AddReport(this.buttonStudent);
        ClassReport.AddReport(this.buttonClass);

        string        Student = "SHEvaluation.SchoolYearScoreReportNew.Student";
        string        Class   = "SHEvaluation.SchoolYearScoreReportNew.Class";
        RibbonBarItem item1   = FISCA.Presentation.MotherForm.RibbonBarItems["學生", "資料統計"];

        item1["報表"][reportPath][reportName].Enable = FISCA.Permission.UserAcl.Current[Student].Executable;
        RibbonBarItem item2 = FISCA.Presentation.MotherForm.RibbonBarItems["班級", "資料統計"];

        item2["報表"][reportPath][reportName].Enable = FISCA.Permission.UserAcl.Current[Class].Executable;

        //權限設定
        Catalog permission1 = RoleAclSource.Instance["學生"]["報表"];

        permission1.Add(new RibbonFeature(Student, reportName));
        Catalog permission2 = RoleAclSource.Instance["班級"]["報表"];

        permission2.Add(new RibbonFeature(Class, reportName));
    }
Beispiel #3
0
        public ActionResult Report(Student student)
        {
            StudentReport studentReport = new StudentReport();

            byte[] abytes = studentReport.PrepareReport(GetStudents());
            return(File(abytes, "application/pdf"));
        }
Beispiel #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            this.connetionString = "Data Source = whitesnow.database.windows.net; Initial Catalog = Mazal; Integrated Security = False; User ID = Grimm; Password = #!7Dwarfs; Connect Timeout = 15; Encrypt = False; TrustServerCertificate = True; ApplicationIntent = ReadWrite; MultiSubnetFailover = False";
            this.sqlcon          = new SqlConnection(connetionString);

            SqlCommand cmd = new SqlCommand("select ID,F_name,L_name,Telephone,Email from person where Permission='Teaching_Assistant' OR Permission='Lecturer' ", sqlcon);


            try
            {
                SqlDataAdapter sda = new SqlDataAdapter();
                sda.SelectCommand = cmd;
                DataTable dbdataset = new DataTable();
                sda.Fill(dbdataset);
                BindingSource bsource = new BindingSource();
                //Paint headers
                StudentReport.EnableHeadersVisualStyles = false;
                StudentReport.GridColor = Utility.HeaderBackColor;
                StudentReport.ColumnHeadersDefaultCellStyle.BackColor = Utility.HeaderBackColor;
                StudentReport.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
                StudentReport.AutoResizeColumns();
                StudentReport.AutoSizeColumnsMode         = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
                StudentReport.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;


                bsource.DataSource       = dbdataset;
                StudentReport.DataSource = bsource;
                sda.Update(dbdataset);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
 private void Report_Load(object sender, EventArgs e)
 {
     if (str == "Student")
     {
         StudentReport sr = new StudentReport();
         sr.SetDataSource(dss);
         crystalReportViewer1.ReportSource = sr;
     }
     else if (str == "Staff")
     {
         StaffReport sr2 = new StaffReport();
         sr2.SetDataSource(dss);
         crystalReportViewer1.ReportSource = sr2;
     }
     else if (str == "User")
     {
         UserReport sr2 = new UserReport();
         sr2.SetDataSource(dss);
         crystalReportViewer1.ReportSource = sr2;
     }
     else if (str == "Class")
     {
         ClassReport cr = new ClassReport();
         cr.SetDataSource(dss);
         crystalReportViewer1.ReportSource = cr;
     }
 }
Beispiel #6
0
        // GET: StudentReports/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            StudentReport studentReport = _db.StudentReports.Find(id);

            if (studentReport == null)
            {
                return(HttpNotFound());
            }

            var viewModel = new AddEditStudentReportViewModel();

            List <SelectListItem> studentList = new List <SelectListItem>();

            foreach (Student student in _db.Students)
            {
                if (studentReport.Student.Id == student.Id)
                {
                    studentList.Add(new SelectListItem {
                        Text = student.FirstName, Value = student.Id.ToString(), Selected = true
                    });
                }
                else
                {
                    studentList.Add(new SelectListItem {
                        Text = student.FirstName, Value = student.Id.ToString(), Selected = false
                    });
                }
            }

            List <SelectListItem> documentTypeList = new List <SelectListItem>();

            foreach (DocumentType documentType in _db.DocumentTypes)
            {
                if (studentReport.DocumentType.Id == documentType.Id)
                {
                    documentTypeList.Add(new SelectListItem {
                        Text = documentType.Name, Value = documentType.Id.ToString(), Selected = true
                    });
                }
                else
                {
                    documentTypeList.Add(new SelectListItem {
                        Text = documentType.Name, Value = documentType.Id.ToString(), Selected = false
                    });
                }
            }
            viewModel.Id            = studentReport.Id;
            viewModel.Student       = studentReport.Student;
            viewModel.Comments      = studentReport.Comments;
            viewModel.DocumentType  = studentReport.DocumentType;
            viewModel.DocumentDate  = studentReport.DocumentDate;
            viewModel.DocumentLink  = studentReport.DocumentLink;
            viewModel.DocumentTypes = documentTypeList;
            viewModel.Students      = studentList;
            return(View(viewModel));
        }
        public ActionResult ResultReport(string Str)
        {
            string UsertypeId = Session["UserTypeId"].ToString();

            DataTable dtYearList    = new DataTable();
            DataTable dtStudentList = new DataTable();
            DataTable dtSchoolList  = new DataTable();
            DataTable dtProductList = new DataTable();

            dtYearList       = StudentCon.ApplicationYearList();
            ViewBag.YearList = ToSelectList(dtYearList, "Name");

            dtStudentList       = StudentCon.StudentList(UsertypeId);
            ViewBag.StudentList = ToSelectList(dtStudentList, "Name");

            dtSchoolList       = StudentCon.SchoolList();
            ViewBag.SchoolList = ToSelectList(dtSchoolList, "Name");

            dtProductList       = StudentCon.ProductList();
            ViewBag.ProductList = ToSelectListWithValues(dtProductList, "Id", "Name");

            if (Str == null)
            {
                Str = "And 1=1";
            }
            DataTable dt = new DataTable();

            dt = StudentReport.GetStudentReport(Str, UsertypeId);

            return(View(dt));
        }
        public void DataInsert()
        {
            var dataSession = new DataSession();
            var uowFactory  = new UnitOfWorkFactory(dataSession);
            var uow         = uowFactory.CreateUnitOfWork();

            var user = new BursifyUser()
            {
            };

            user.Email              = "*****@*****.**";
            user.PasswordHash       = "password123";
            user.PasswordSalt       = "passwordSalt";
            user.AccountStatus      = "Active";
            user.UserType           = "Student";
            user.RegistrationDate   = DateTime.Today;
            user.Biography          = "Bio stuff";
            user.CellphoneNumber    = "0840924299";
            user.TelephoneNumber    = "0123456789";
            user.ProfilePicturePath = "somewhereSafe";

            var report = new StudentReport()
            {
                StudentId         = 1,
                Average           = 75,
                ReportInstitution = "UJ Test",
                ReportPeriod      = "Semester 1",
                ReportLevel       = "Second Year",
                Subjects          = new List <Subject>()
                {
                    new Subject()
                    {
                        Name         = "Informatics",
                        MarkAcquired = 75
                    },

                    new Subject()
                    {
                        Name         = "Maths",
                        MarkAcquired = 75
                    },

                    new Subject()
                    {
                        Name         = "Linear",
                        MarkAcquired = 75
                    }
                }
            };


            //uow.Context.Set<BursifyUser>().Add(user);
            uow.Context.Set <StudentReport>().Add(report);

            //uow.Context.Set<Subject>().Add(subject);

            uow.Context.SaveChanges();
            uow.Commit();
        }
Beispiel #9
0
        public ActionResult AdminStudentReport()
        {
            StudentReport studentReport = new StudentReport
            {
                studentList = db.Students.ToList()
            };

            return(View(studentReport));
        }
Beispiel #10
0
        public ActionResult StudentReports(string studentID)
        {
            List <Enrollment> enrollment    = db.Enrollments.Where(c => c.StudentID == studentID).ToList();
            StudentReport     studentReport = new StudentReport
            {
                selectedstudent = db.Students.Find(studentID),
                NumOfCourses    = enrollment.Count,
                enrollments     = enrollment
            };

            return(View(studentReport));
        }
Beispiel #11
0
        public ActionResult Index(StudentResult studentResult)
        {
            // ViewBag.departments = db.RegisterStudents.ToList();
            //var studentResults = db.StudentResults.Include(s => s.Course).Include(s => s.GradeLetter).Include(s => s.RegisterStudent);
            // return View(studentResults.ToList());
            //report(studentResult);
            StudentReport studentReport = new StudentReport();
            var           student       = studentResult1(studentResult);

            byte[] abytes = studentReport.PrePareReport(student, studentResult);
            return(File(abytes, "application/pdf"));
            // return View();
        }
Beispiel #12
0
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            var student = new StudentReport
            {
                Name     = txtBoxName.Text,
                LastName = txtBoxLastName.Text,
                TestDate = datePicker.SelectedDate?.Date ?? DateTime.Now,
                TestName = txtBoxTestName.Text,
                Raiting  = (int)comboBoxRaiting.SelectedValue
            };

            App.Manager.Add(student);
            Close();
        }
Beispiel #13
0
        // GET: StudentReports/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            StudentReport studentReport = _db.StudentReports.Find(id);

            if (studentReport == null)
            {
                return(HttpNotFound());
            }
            return(View(studentReport));
        }
        public StudentReportViewModel MapSingleReport(StudentReport report)
        {
            ID                = report.ID;
            StudentId         = report.StudentId;
            Average           = report.Average;
            ReportYear        = report.ReportYear;
            ReportLevel       = report.ReportLevel;
            ReportPeriod      = report.ReportPeriod;
            ReportInstitution = report.ReportInstitution;
            ReportFilePath    = report.ReportFilePath;
            Subjects          = SubjectViewModel.ReverseMapSubjects((List <Subject>)report.Subjects);

            return(this);
        }
        // GET: Attendance/Details/5
        public async Task <ActionResult> Details(StudentReport data)
        {
            if (data == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            List <StudentReport> report = await _reportRepo.StudentReport(data);

            if (report == null)
            {
                return(HttpNotFound());
            }
            return(View(report));
        }
        public ActionResult PrintStudent(int param)
        {
            List <Student> oStudentds = new List <Student>();

            for (int i = 1; i <= 10; i++)
            {
                Student oStudent = new Student();
                oStudent.Id      = i;
                oStudent.Name    = "Student" + i;
                oStudent.Address = "Address" + i;
                oStudentds.Add(oStudent);
            }

            StudentReport rpt = new StudentReport(_oHostEnvironment);

            return(File(rpt.Report(oStudentds), "application/pdf"));
        }
Beispiel #17
0
        public ActionResult Get()
        {
            List <Student> students = new List <Student>();

            for (int i = 0; i < 100; i++)
            {
                Student student = new Student();
                student.Id      = i;
                student.Name    = "Student សិស្សសាលារៀន " + i;
                student.Address = "Address អាសយដ្ឋាន " + i;
                students.Add(student);
            }

            StudentReport rpt = new StudentReport(_webHostEnviroment);

            return(File(rpt.Report(students), "application/pdf"));
        }
Beispiel #18
0
        public IActionResult PrintStudent(int param)
        {
            List <Student> students = new List <Student>();

            for (int i = 1; i <= 9; i++)
            {
                students.Add(new Student()
                {
                    StudentId = i,
                    Name      = "Stu" + i,
                    Roll      = "100" + i
                });
            }

            StudentReport rpt = new StudentReport(_oHostEnvironment);

            return(File(rpt.Report(students), "application/pdf"));
        }
Beispiel #19
0
        public static void RegistryFeature()
        {
            SemesterScoreReportNew semsScoreReport = new SemesterScoreReportNew();

            string reportName = "學期成績單(新制)";
            string path       = "成績相關報表";

            semsScoreReport.button          = new SecureButtonAdapter("Report0055");
            semsScoreReport.button.Text     = reportName;
            semsScoreReport.button.Path     = path;
            semsScoreReport.button.OnClick += new EventHandler(semsScoreReport.button_OnClick);
            StudentReport.AddReport(semsScoreReport.button);

            semsScoreReport.button2          = new SecureButtonAdapter("Report0155");
            semsScoreReport.button2.Text     = reportName;
            semsScoreReport.button2.Path     = path;
            semsScoreReport.button2.OnClick += new EventHandler(semsScoreReport.button2_OnClick);
            ClassReport.AddReport(semsScoreReport.button2);
        }
Beispiel #20
0
        public ActionResult Create([Bind(Include = "DocumentDate,Comments,Student,DocumentType,DocumentLink,PostedFile")] AddEditStudentReportViewModel model)
        {
            if (ModelState.IsValid)
            {
                StudentReport studentReport = new StudentReport
                {
                    DocumentDate = model.DocumentDate,
                    Comments     = model.Comments,
                    DocumentLink = Settings.Default.DocumentStoragePath + model.DocumentLink,
                    DocumentType = (from d in _db.DocumentTypes where d.Id == model.DocumentType.Id select d).Single(),
                    Student      = (from s in _db.Students where s.Id == model.Student.Id select s).Single()
                };

                _db.StudentReports.Add(studentReport);
                _db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            return(View(model));
        }
        public SemesterScoreReport()
        {
            string reportName = "學期成績單";
            string path       = "成績相關報表";

            _ErrorMessage = new StringBuilder();

            button          = new SecureButtonAdapter("Report0050");
            button.Text     = reportName;
            button.Path     = path;
            button.OnClick += new EventHandler(button_OnClick);
            StudentReport.AddReport(button);

            button2          = new SecureButtonAdapter("Report0150");
            button2.Text     = reportName;
            button2.Path     = path;
            button2.OnClick += new EventHandler(button2_OnClick);
            ClassReport.AddReport(button2);
        }
Beispiel #22
0
        public async Task <List <StudentReport> > StudentReport(StudentReport param)
        {
            string qry = @"select s.id as studentId, s.name as StudentName , s.RollNumber, s.AcademicYear, s.EnrollDate
								, m.id as moduleId, m.Name as moduleName
								, c.Id as courseId, c.Name as courseName
								, sem.id as semesterId, sem.Name as semesterName
							from student s
								inner join StudentModuleMapping SMM ON SMM.StudentId = s.id
								inner join module m on m.id = smm.id
								inner join course c on c.Id = m.CourseId
								inner join semester sem on sem.id = m.SemesterId
							where m.courseId = case when @courseId <> -1  then @courseid else m.courseid end	
							order by EnrollDate asc"                            ;

            List <SqlParam> collection = new List <SqlParam> {
                new SqlParam("@courseId", SqlDbType.VarChar, param.CourseId)
            };

            return(await _dao.FetchListAsync <StudentReport>(qry, collection));
        }
Beispiel #23
0
        public List <StudentReport> GetFilteredStudent(StudentReport objSR)
        {
            List <SqlParameter> sqlParameterList = new List <SqlParameter>();

            sqlParameterList.Add(new SqlParameter("@SessionID", !string.IsNullOrEmpty(objSR.SessionID)? objSR.SessionID:null));
            sqlParameterList.Add(new SqlParameter("@StreamID", objSR.StreamID != null ? objSR.StreamID.Length > 0 ? string.Join(",", objSR.StreamID) : string.Empty : string.Empty));
            sqlParameterList.Add(new SqlParameter("@CourseID", objSR.CourseID != null ? objSR.CourseID.Length > 0 ? string.Join(",", objSR.CourseID) : string.Empty : string.Empty));
            sqlParameterList.Add(new SqlParameter("@BatchID", objSR.BatchID != null & objSR.CourseID != null ? objSR.BatchID.Length > 0 & objSR.CourseID.Length > 0 ? string.Join(",", objSR.BatchID) : string.Empty : string.Empty));

            DataTable dt = DGeneric.RunSP_ReturnDataSet("sp_GetFilterStudent", sqlParameterList, null).Tables[0];

            if (dt.Rows.Count > 0)
            {
                return(DGeneric.BindDataList <StudentReport>(dt));
            }
            else
            {
                return(new List <StudentReport>());
            }
        }
        private void GetStudentDetailsByClassReport()
        {
            btnViewReport.Enabled = false;
            lblPleaseWait.Visible = true;
            try
            {
                _studentReport = new StudentReport();

                short?  classID         = Convert.ToInt16(ddlClass.SelectedValue);
                short?  sectionID       = Convert.ToInt16(ddlSection.SelectedValue) == 0 ? null : (short?)Convert.ToInt16(ddlSection.SelectedValue);
                DataSet dsStudentReport = _studentReport.GetStudentDetailsByClass(classID, sectionID);

                if (dsStudentReport != null && dsStudentReport.Tables[1].Rows.Count > 0)
                {
                    dsStudentReport.Tables[0].TableName = "School";
                    dsStudentReport.Tables[1].TableName = "StudentDetailsByClassDT";

                    ReportDocument rdoc = new ReportDocument();
                    rdoc.Load(_appPath + "Reports\\StudentDetailsByClassReport.rpt");
                    rdoc.SetDataSource(dsStudentReport);
                    crystalReportViewer.ReportSource = rdoc;
                    rdoc.Refresh();
                    crystalReportViewer.Refresh();
                    crystalReportViewer.Show();
                    crystalReportViewer.Visible = true;

                    btnViewReport.Enabled = true;
                    lblPleaseWait.Visible = false;
                }
                else
                {
                    crystalReportViewer.Visible = false;
                    MessageBox.Show("No Result Found.", "No Record Found", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    btnViewReport.Enabled = true;
                    lblPleaseWait.Visible = false;
                }
            }
            catch (Exception ex)
            {
            }
        }
        public IEnumerable <StudentReport> getStudents()
        {
            var s = _ctx.StudentSlabs
                    .Include(a => a.Slab)
                    .Include(z => z.Student.CreatedBy)
                    .Include(a => a.Student).ThenInclude(i => i.StudentUser)
                    .ToList();
            var studentList = new List <StudentReport>();

            foreach (var student in s)
            {
                // mpsUser u = student.Student.StudentUser;
                var studentVM = new StudentReport
                {
                    isActive      = student.Student.isActive,
                    StudentId     = student.Student.StudentId,
                    Address1      = student.Student.StudentUser.Address1,
                    Address2      = student.Student.StudentUser.Address2,
                    FirstName     = student.Student.StudentUser.FirstName,
                    MiddleName    = student.Student.StudentUser.MiddleName,
                    LastName      = student.Student.StudentUser.LastName,
                    DOB           = student.Student.StudentUser.DOB,
                    Email         = student.Student.StudentUser.Email,
                    UserName      = student.Student.StudentUser.UserName,
                    TotalFees     = student.Slab.TotalFee,
                    AdmissionDate = student.Student.AdmissionDate,
                    // TotalPaidFees = student.TotalPaidFees,
                    // PaidDate = student.PaidDate.Value.ToShortDateString(),
                    // FeesStartDate = student.FeesStartDate.ToShortDateString(),
                    // FeesEndDate = student.FeesEndDate.ToShortDateString(),
                    AcademicYear     = student.AcademicYear,
                    SlabName         = student.Slab.SlabName,
                    Grade            = student.Slab.Grade,
                    Phone            = student.Student.StudentUser.PhoneNumber,
                    StudentCreatedBy = student.CreatedBy.UserName
                };
                studentList.Add(studentVM);
            }
            return(studentList);
        }
Beispiel #26
0
        public ActionResult DeleteConfirmed(int id)
        {
            StudentReport studentReport = _db.StudentReports.Find(id);

            if (studentReport != null)
            {
                _db.StudentReports.Remove(studentReport);
                _db.SaveChanges();

                CloudStorageAccount storageAccount =
                    CloudStorageAccount.Parse(Settings.Default.StorageConnectionString);
                CloudBlobClient    blobClient = storageAccount.CreateCloudBlobClient();
                CloudBlobContainer container  = blobClient.GetContainerReference("studentreports");
                CloudBlockBlob     blob       = container.GetBlockBlobReference(studentReport.DocumentLink);
                if (blob.Exists())
                {
                    blob.Delete();
                }
            }

            return(RedirectToAction("Index"));
        }
Beispiel #27
0
        private void button2_Click(object sender, EventArgs e)
        {
            this.connetionString = "Data Source = whitesnow.database.windows.net; Initial Catalog = Mazal; Integrated Security = False; User ID = Grimm; Password = #!7Dwarfs; Connect Timeout = 15; Encrypt = False; TrustServerCertificate = True; ApplicationIntent = ReadWrite; MultiSubnetFailover = False";
            this.sqlcon          = new SqlConnection(connetionString);
            try
            {
                SqlCommand cmd = new SqlCommand("select stud_Id, final_grade from Student_Courses where final_grade <= 56 and course_id='" + CourseID.Text + "'", sqlcon);
                StudentReport.Visible = true;
                SqlDataAdapter sda = new SqlDataAdapter();
                sda.SelectCommand = cmd;
                DataTable dbdataset = new DataTable();
                sda.Fill(dbdataset);
                BindingSource bsource = new BindingSource();

                //Paint headers
                StudentReport.EnableHeadersVisualStyles = false;
                StudentReport.GridColor = Utility.HeaderBackColor;
                StudentReport.ColumnHeadersDefaultCellStyle.BackColor = Utility.HeaderBackColor;
                StudentReport.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
                StudentReport.AutoResizeColumns();
                StudentReport.AutoSizeColumnsMode         = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
                StudentReport.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;


                bsource.DataSource       = dbdataset;
                StudentReport.DataSource = bsource;
                sda.Update(dbdataset);
            }
            catch (SqlException ex)
            {
                CourseID.Text = "";
                MessageBox.Show("Error selecting course id, try again!!\n" + ex.ToString());
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Beispiel #28
0
        public Response <List <StudentReport> > GetFilteredStudent(StudentReport objSR)
        {
            var studentData = _iDStudent.GetFilteredStudent(objSR);

            if (studentData != null)
            {
                return(new Response <List <StudentReport> >
                {
                    IsSuccessful = true,
                    Object = studentData,
                    Message = "Success"
                });
            }
            else
            {
                return(new Response <List <StudentReport> >
                {
                    IsSuccessful = false,
                    Message = "error",
                    Object = null
                });
            }
        }
Beispiel #29
0
        public async Task <List <AttendanceReport> > AttendanceReport(StudentReport param)
        {
            string qry = @"select s.id as StudentId, s.RollNumber as RollNumber, s.Name as StudentName
								,sum(case when ad.[Status] = 'P' then 1 else 0 end) as PresentDays
								,sum(case when ad.[Status] = 'L' then 1 else 0 end) as LateDays
								,sum(case when ad.[Status] = 'A' then 1 else 0 end) as AbsentDays
							from attendanceDetl ad
								inner join attendanceMast am on ad.MastId = am.Id
								inner join student s on ad.StudentId = s.Id
							where am.AttendanceDate between @from_date and @to_date
								and am.ModuleId = @moduleId
								and s.Id = case when @studentId <> -1 then @studentId else s.Id end
							group by s.id, s.RollNumber, s.Name"                            ;

            List <SqlParam> collection = new List <SqlParam> {
                new SqlParam("@from_date", SqlDbType.VarChar, param.FromDate),
                new SqlParam("@to_date", SqlDbType.VarChar, param.ToDate),
                new SqlParam("@moduleId", SqlDbType.VarChar, param.ModuleId),
                new SqlParam("@studentId", SqlDbType.VarChar, param.StudentId),
            };

            return(await _dao.FetchListAsync <AttendanceReport>(qry, collection));
        }
        public MultiSemesterScore()
        {
            string report_name = "多學期成績單";
            string report_path = "成績相關報表";

            //_student_button = new ButtonAdapter();
            //_student_button.Text = report_name;
            //_student_button.Path = report_path;
            //_student_button.OnClick += new EventHandler(studentButton_OnClick);
            //StudentReport.AddReport(_student_button);

            _class_button          = new SecureButtonAdapter("Report0170");
            _class_button.Text     = report_name;
            _class_button.Path     = report_path;
            _class_button.OnClick += new EventHandler(classButton_OnClick);
            ClassReport.AddReport(_class_button);

            ButtonAdapter _student_button = new SecureButtonAdapter("Report0060");

            _student_button.Text     = report_name;
            _student_button.Path     = report_path;
            _student_button.OnClick += new EventHandler(_student_button_OnClick);
            StudentReport.AddReport(_student_button);
        }
 internal IEnumerable<StudentReport> StudentReports()
 {
     var rv = new List<StudentReport>();
     var gradesByQuarter = _studentRow.GetGradeRows().GroupBy(g => g.CourseRow.Quarter);
     foreach (var kvp in gradesByQuarter)
     {
         var i = new StudentReport();
         var mp = MarkingPeriods.Singleton.Find(MarkingPeriodKey.Parse(kvp.Key));
         i.Quarter = mp.ToString();
         i.NumberOfClasses = kvp.Count();
         i.Gpa = Gpa(mp);
         i.Stage = (ApprovalStage) kvp.Max(g => (int) Enum.Parse(typeof(ApprovalStage), g.ApprovalStage));
         i.HonorRoll = HonorRoll(mp);
         i.DaysAbsent = DaysAttendance(mp, AttendanceStatus.Absent);
         i.DaysTardy = DaysAttendance(mp, AttendanceStatus.Tardy);
         i.DaysPresent = mp.DaysIn - i.DaysAbsent - i.DaysTardy;
         rv.Add(i);
     }
     return rv;
 }