Exemplo n.º 1
0
        public int BacklogCourseSave(BacklogRegistration aBacklogRegistration)
        {
            Query = "INSERT INTO BacklogRegistration VALUES (@sid,@cid, @batch)";

            Command = new SqlCommand(Query, Connection);

            Command.Parameters.Clear();

            Command.Parameters.Add("sid", SqlDbType.VarChar);
            Command.Parameters["sid"].Value = aBacklogRegistration.StudentId;

            Command.Parameters.Add("cid", SqlDbType.Int);
            Command.Parameters["cid"].Value = aBacklogRegistration.CourseId;

            Command.Parameters.Add("batch", SqlDbType.VarChar);
            Command.Parameters["batch"].Value = aBacklogRegistration.BacklogBatch;

            Connection.Open();

            int rowAffected = Command.ExecuteNonQuery();

            Connection.Close();

            return(rowAffected);
        }
Exemplo n.º 2
0
        public List <BacklogRegistration> ShowBacklogRegistrationbyStudentId(string studentId)
        {
            Query = "SELECT * FROM BacklogRegistration,Course WHERE BacklogRegistration.StudentId='" + studentId + "' AND Course.CourseId=BacklogRegistration.courseid";

            Command = new SqlCommand(Query, Connection);

            Connection.Open();

            Reader = Command.ExecuteReader();

            List <BacklogRegistration> backlogInformation = new List <BacklogRegistration>();

            while (Reader.Read())
            {
                BacklogRegistration aBacklogStudentInformation = new BacklogRegistration();

                aBacklogStudentInformation.BacklogRegistrationId = (int)Reader["BacklogRegistrationId"];
                aBacklogStudentInformation.StudentId             = Reader["StudentId"].ToString();
                aBacklogStudentInformation.CourseId     = (int)Reader["courseid"];
                aBacklogStudentInformation.BacklogBatch = Reader["BacklogBatch"].ToString();
                aBacklogStudentInformation.CourseCode   = Reader["CourseCode"].ToString();
                aBacklogStudentInformation.CourseName   = Reader["CourseName"].ToString();
                aBacklogStudentInformation.CourseCredit = Convert.ToDouble(Reader["CourseCredit"]);

                backlogInformation.Add(aBacklogStudentInformation);
            }

            Reader.Close();
            Connection.Close();

            return(backlogInformation);
        }
Exemplo n.º 3
0
        public List <BacklogRegistration> StudentEnrollinParticularCourse(int courseId, string batch)
        {
            Query = "SELECT * FROM BacklogRegistration,StudentInformation  WHERE courseid='" + courseId + "' AND BacklogBatch='" + batch + "' AND BacklogRegistration.StudentId=StudentInformation.StudentId";

            Command = new SqlCommand(Query, Connection);


            Connection.Open();

            Reader = Command.ExecuteReader();

            List <BacklogRegistration> aBacklogRegistrations = new List <BacklogRegistration>();

            while (Reader.Read())
            {
                BacklogRegistration aBacklogRegistration = new BacklogRegistration();

                aBacklogRegistration.StudentId   = Reader["StudentId"].ToString();
                aBacklogRegistration.StudentName = Reader["StudentName"].ToString();

                aBacklogRegistrations.Add(aBacklogRegistration);
            }

            Reader.Close();
            Connection.Close();

            return(aBacklogRegistrations);
        }
Exemplo n.º 4
0
        public string BacklogCourseSave(BacklogRegistration aBacklogRegistration)
        {
            bool isExist = aBacklogGateway.IsStudentExists(aBacklogRegistration);

            if (isExist)
            {
                int updateCTAttendance = aBacklogGateway.UpdateCTAttendanceStatus(aBacklogRegistration);

                int rowAffected = aBacklogGateway.BacklogCourseSave(aBacklogRegistration);

                if (rowAffected > 0)
                {
                    return("You have Successfully Registered with the Course");
                }
                else
                {
                    return("Sorry Your Registration have failed.");
                }
            }
            else
            {
                return
                    ("Sorry Your Registration have failed.You may not be Enrolled this Course Before.So Enroll New Registration.");
            }
        }
Exemplo n.º 5
0
        public int UpdateCTAttendanceStatus(BacklogRegistration aBacklogRegistration)
        {
            Query = "UPDATE InputCTAttendence SET CT1='0',CT2='0',CT3='0',CT4='0',CT5='0',Attendence='0' WHERE InputCTAttendence.courseid='" + aBacklogRegistration.CourseId + "' AND InputCTAttendence.StudentId='" + aBacklogRegistration.StudentId + "'";

            Command = new SqlCommand(Query, Connection);


            Connection.Open();

            int rowAffected = Command.ExecuteNonQuery();

            Connection.Close();

            return(rowAffected);
        }
Exemplo n.º 6
0
        public bool IsStudentExists(BacklogRegistration aBacklogRegistration)
        {
            Query = "SELECT * FROM EnrollCourse WHERE EnrollCourse.StudentId='" + aBacklogRegistration.StudentId +
                    "' AND EnrollCourse.courseid='" + aBacklogRegistration.CourseId + "'";


            Command = new SqlCommand(Query, Connection);

            Connection.Open();

            Reader = Command.ExecuteReader();

            bool isExist = Reader.HasRows;

            Reader.Close();
            Connection.Close();

            return(isExist);
        }
 public ActionResult BacklogRegistration(BacklogRegistration aBacklogRegistration)
 {
     ViewBag.message   = aBacklogManager.BacklogCourseSave(aBacklogRegistration);
     ViewBag.getCourse = aCourseManager.GetAllCourses().ToList();
     return(View());
 }