Ejemplo n.º 1
0
        public ActionResult ExportCoursesDeadline(string check)
        {
            string searchCheck = check.Split('^')[0];
            string Course_Name = check.Split('^')[1];
            string Semester_ID = check.Split('^')[2];

            Course_Name = Course_Name == "2" ? "" : Course_Name;
            Semester_ID = Semester_ID == "3" ? "" : Semester_ID;
            List <Cour_dealine> list = new List <Cour_dealine>();

            if (searchCheck != "1")
            {
                list = unitOfWork.DeadLine.GetPageList(Course_Name, Semester_ID);
            }
            var myExport = new CSVExport();

            foreach (var course in list)
            {
                myExport.AddRow();
                myExport[""]            = course.groupRowNo;
                myExport["Subject ID"]  = course.Subject_ID;
                myExport["Course Name"] = course.Courses_Name;
                myExport["Deadline"]    = course.deadlineString;
                myExport["Semester"]    = course.Semester_Name;
            }

            return(File(myExport.ExportToBytes(), "text/csv", "Courses-Deadline.csv"));
        }
Ejemplo n.º 2
0
        public ActionResult ExportCoursera(string check)
        {
            string searchCheck = check.Split('^')[0];
            string Email       = check.Split('^')[1];
            string Semester_ID = check.Split('^')[2];
            string Campus_ID   = check.Split('^')[3];

            var students = unitOfWork.Students.GetAll();

            if (searchCheck != "1")
            {
                if (Email != "2")
                {
                    students = students.Where(s => s.Email.Trim().ToUpper().Contains(Email.Trim().ToUpper())).ToList();
                }
                if (Semester_ID != "3")
                {
                    students = students.Where(s => s.Semester_ID.Trim() == Semester_ID.Trim()).ToList();
                }
                if (Campus_ID != "4")
                {
                    students = students.Where(s => s.Campus_ID.Trim() == Campus_ID.Trim()).ToList();
                }
            }
            var myExport = new CSVExport();

            foreach (var student in students)
            {
                myExport.AddRow();
                myExport["Full Name"] = student.Full_Name;
                myExport["Email"]     = student.Email;
                var subject = unitOfWork.SubjectStudent.getListSubject(student.Roll + "^" + student.Semester_ID).ToString();
                myExport["External ID"] = subject + "@" + student.Campus_ID + "-" + student.Roll;
            }

            return(File(myExport.ExportToBytes(), "text/csv", "Coursera-Invitation.csv"));
        }
Ejemplo n.º 3
0
        public ActionResult Export(string check)
        {
            string searchCheck = check.Split('^')[0];
            string Email       = check.Split('^')[1];
            string Semester_ID = check.Split('^')[2];
            string Campus_ID   = check.Split('^')[3];

            var students = unitOfWork.Students.GetAll();

            if (searchCheck != "1")
            {
                if (Email != "2")
                {
                    students = students.Where(s => s.Email.Trim().ToUpper().Contains(Email.Trim().ToUpper())).ToList();
                }
                if (Semester_ID != "3")
                {
                    students = students.Where(s => s.Semester_ID.Trim() == Semester_ID.Trim()).ToList();
                }
                if (Campus_ID != "4")
                {
                    students = students.Where(s => s.Campus_ID.Trim() == Campus_ID.Trim()).ToList();
                }
            }
            var myExport = new CSVExport();

            foreach (var student in students)
            {
                myExport.AddRow();
                myExport["Roll Number"] = student.Roll;
                myExport["Full Name"]   = student.Full_Name;
                myExport["Email"]       = student.Email;
            }

            return(File(myExport.ExportToBytes(), "text/csv", "Student.csv"));
        }
Ejemplo n.º 4
0
        public ActionResult Export()
        {
            var myExport = new CSVExport();

            myExport.AddRow();
            myExport["Roll Number"] = "SE0001";
            myExport["Full Name"]   = "Full name";
            myExport["Email"]       = "*****@*****.**";
            myExport["Subject"]     = "PMG201c";

            myExport.AddRow();
            myExport["Roll Number"] = "SE0002";
            myExport["Full Name"]   = "Full name";
            myExport["Email"]       = "*****@*****.**";
            myExport["Subject"]     = "PMG201c";

            myExport.AddRow();
            myExport["Roll Number"] = "SE0003";
            myExport["Full Name"]   = "Full name";
            myExport["Email"]       = "*****@*****.**";
            myExport["Subject"]     = "PMG201c";

            return(File(myExport.ExportToBytes(), "text/csv", "StudentTemplate.csv"));
        }