public DataTable GetCourseFee(TeacherDetailsEntryDao teacherDetailsDao)
        {
            DataTable       dt         = new DataTable();
            ConnectionClass connection = new ConnectionClass();
            string          query      = "Select *from CourseManagement_T Where Course_Name='" + teacherDetailsDao.Subject + "'";

            try
            {
                SqlDataAdapter da = new SqlDataAdapter(query, connection.GetOpen());
                da.Fill(dt);
            }
            catch
            {
                dt = null;
            }
            finally
            {
                connection.GetClose();
            }
            return(dt);
        }
Esempio n. 2
0
        public DataTable IsExistTeacherSubQualiDB(TeacherDetailsEntryDao teacherDetailsEntryDao)
        {
            DataTable       dt         = new DataTable();
            ConnectionClass connection = new ConnectionClass();
            string          query      = "select *from TeacherManagement_T where Teacher_Name='" + teacherDetailsEntryDao.TeacherName + "' and Subject='" + teacherDetailsEntryDao.Subject + "' and Qualification='" + teacherDetailsEntryDao.Qualification + "'";

            try
            {
                SqlDataAdapter da = new SqlDataAdapter(query, connection.GetOpen());
                da.Fill(dt);
            }
            catch
            {
                dt = null;
            }
            finally
            {
                connection.GetClose();
            }
            return(dt);
        }
Esempio n. 3
0
        public DataTable IsExistCourseNameInDB(CourseDetailsEntryDao courseDetailsEntryDao)
        {
            DataTable       dt         = new DataTable();
            ConnectionClass connection = new ConnectionClass();
            string          qurery     = "select *from CourseManagement_T where Course_Name='" + courseDetailsEntryDao.CourseName + "'";

            try
            {
                SqlDataAdapter da = new SqlDataAdapter(qurery, connection.GetOpen());
                da.Fill(dt);
            }
            catch
            {
                dt = null;
            }
            finally
            {
                connection.GetClose();
            }
            return(dt);
        }
        public DataTable GetUserMatchOnDB(RegistrationFormEntryDao registrationFormEntryDao)
        {
            DataTable       dt         = new DataTable();
            ConnectionClass connection = new ConnectionClass();
            string          query      = "select *from User_T where User_Name='" + registrationFormEntryDao.UserName + "' and Password='******'";

            try
            {
                SqlDataAdapter da = new SqlDataAdapter(query, connection.GetOpen());
                da.Fill(dt);
            }
            catch
            {
                dt = null;
            }
            finally
            {
                connection.GetClose();
            }
            return(dt);
        }
Esempio n. 5
0
        public DataTable GetAllCourseNameDB()
        {
            DataTable       dt         = new DataTable();
            ConnectionClass connection = new ConnectionClass();
            string          query      = "select *from CourseManagement_T";

            try
            {
                SqlDataAdapter da = new SqlDataAdapter(query, connection.GetOpen());
                da.Fill(dt);
            }
            catch
            {
                dt = null;
            }
            finally
            {
                connection.GetClose();
            }
            return(dt);
        }
Esempio n. 6
0
        public DataTable GetStudentByCourseName(CourseDetailsEntryDao courseDetailsEntryDao)
        {
            DataTable       dt         = new DataTable();
            ConnectionClass connection = new ConnectionClass();
            string          query      = "Select *from StudentManagement_T Where Selected_Course='" + courseDetailsEntryDao.CourseName + "'";

            try
            {
                SqlDataAdapter da = new SqlDataAdapter(query, connection.GetOpen());
                da.Fill(dt);
            }
            catch
            {
                dt = null;
            }
            finally
            {
                connection.GetClose();
            }
            return(dt);
        }
Esempio n. 7
0
        public DataTable ShowAllTeacherDetailsInGrid()
        {
            DataTable       dt         = new DataTable();
            ConnectionClass connection = new ConnectionClass();
            string          query      = "Select *from TeacherManagement_T";

            try
            {
                SqlDataAdapter da = new SqlDataAdapter(query, connection.GetOpen());
                da.Fill(dt);
            }
            catch
            {
                dt = null;
            }
            finally
            {
                connection.GetClose();
            }
            return(dt);
        }
Esempio n. 8
0
        public DataTable StudentSearchByRegistrationNoDB(AddStudentEntryDao addStudentEntryDao)
        {
            DataTable       dt         = new DataTable();
            ConnectionClass connection = new ConnectionClass();
            string          query      = "Select *from StudentManagement_T Where Registration_No='" + addStudentEntryDao.RegistraionNo + "'";

            try
            {
                SqlDataAdapter da = new SqlDataAdapter(query, connection.GetOpen());
                da.Fill(dt);
            }
            catch
            {
                dt = null;
            }
            finally
            {
                connection.GetClose();
            }
            return(dt);
        }
        public string GetCourseUpdatedByvalue(CourseDetailsEntryDao courseDetailsEntryDao)
        {
            string          isUpdate   = "";
            ConnectionClass connection = new ConnectionClass();
            string          query      = "update CourseManagement_T set Course_Name='" + courseDetailsEntryDao.CourseName + "', Course_Fee='" + courseDetailsEntryDao.CourseFee + "',Duration='" + courseDetailsEntryDao.Duration + "' where id='" + courseDetailsEntryDao.Id + "'";

            try
            {
                SqlCommand cmd = new SqlCommand(query, connection.GetOpen());
                cmd.ExecuteNonQuery();
                isUpdate = "Update Successful.";
            }
            catch
            {
                isUpdate = "Update Fialed!";
            }
            finally
            {
                connection.GetClose();
            }
            return(isUpdate);
        }
        public string GetInsertOnDB(RegistrationFormEntryDao registrationFormEntryDao)
        {
            string          isSuccess  = "";
            ConnectionClass connection = new ConnectionClass();
            string          query      = "Insert Into User_T values('" + registrationFormEntryDao.UserName + "','" + registrationFormEntryDao.Password + "')";

            try
            {
                SqlCommand cmd = new SqlCommand(query, connection.GetOpen());
                cmd.ExecuteNonQuery();
                isSuccess = "Save Successful.";
            }
            catch
            {
                isSuccess = "Not Saved!";
            }
            finally
            {
                connection.GetClose();
            }
            return(isSuccess);
        }
        public string GetUpdateStudentByValue(AddStudentEntryDao addStudentEntryDao)
        {
            string          isUpdate   = "";
            ConnectionClass connection = new ConnectionClass();
            string          query      = "update StudentManagement_T set Student_Name='" + addStudentEntryDao.StudentName + "', Address='" + addStudentEntryDao.Address + "',Email='" + addStudentEntryDao.Email + "' where id='" + addStudentEntryDao.Id + "'";

            try
            {
                SqlCommand cmd = new SqlCommand(query, connection.GetOpen());
                cmd.ExecuteNonQuery();
                isUpdate = "Update Successful.";
            }
            catch
            {
                isUpdate = "Update Fialed!";
            }
            finally
            {
                connection.GetClose();
            }
            return(isUpdate);
        }
Esempio n. 12
0
        public string GetInsertTeacherDetailsDB(TeacherDetailsEntryDao teacherDetailsEntryDao)
        {
            string          isSuccess  = "";
            ConnectionClass connection = new ConnectionClass();
            string          query      = "Insert Into TeacherManagement_T values('" + teacherDetailsEntryDao.TeacherName + "','" + teacherDetailsEntryDao.Subject + "','" + teacherDetailsEntryDao.Qualification + "')";

            try
            {
                SqlCommand cmd = new SqlCommand(query, connection.GetOpen());
                cmd.ExecuteNonQuery();
                isSuccess = "Save Successful.";
            }
            catch
            {
                isSuccess = "Not Saved!";
            }
            finally
            {
                connection.GetClose();
            }
            return(isSuccess);
        }
        public string GetUpdateTeachersRowByValue(TeacherDetailsEntryDao teacherDetailsEntryDao)
        {
            string          isUpdate   = "";
            ConnectionClass connection = new ConnectionClass();
            string          query      = "update TeacherManagement_T set Teacher_Name='" + teacherDetailsEntryDao.TeacherName + "', Subject='" + teacherDetailsEntryDao.Subject + "',Qualification='" + teacherDetailsEntryDao.Qualification + "' where id='" + teacherDetailsEntryDao.Id + "'";

            try
            {
                SqlCommand cmd = new SqlCommand(query, connection.GetOpen());
                cmd.ExecuteNonQuery();
                isUpdate = "Update Successful.";
            }
            catch
            {
                isUpdate = "Update Fialed!";
            }
            finally
            {
                connection.GetClose();
            }
            return(isUpdate);
        }
Esempio n. 14
0
        public string AddstudentDB(AddStudentEntryDao addStudentEntryDao)
        {
            string          isSuccess  = "";
            ConnectionClass connection = new ConnectionClass();
            string          query      = "Insert Into StudentManagement_T (Student_Name,Address,Email,Date,Selected_Course,Course_Fee,Selected_Teacher,Registration_No) values('" + addStudentEntryDao.StudentName + "','" + addStudentEntryDao.Address + "','" + addStudentEntryDao.Email + "','" + addStudentEntryDao.Date + "','" + addStudentEntryDao.SelectedCourse + "','" + addStudentEntryDao.CourseFee + "','" + addStudentEntryDao.SelectedTeacher + "','" + addStudentEntryDao.RegistraionNo + "')";

            try
            {
                SqlCommand cmd = new SqlCommand(query, connection.GetOpen());
                cmd.ExecuteNonQuery();
                isSuccess = "Save Successful.";
            }
            catch
            {
                isSuccess = "Not Saved!";
            }
            finally
            {
                connection.GetClose();
            }
            return(isSuccess);
        }
        public string GetDeleteById(CourseDetailsEntryDao courseDetailsEntryDao)
        {
            string          isDelete   = "";
            ConnectionClass connection = new ConnectionClass();
            string          query      = "delete from CourseManagement_T where id=" + courseDetailsEntryDao.Id + "";

            try
            {
                SqlCommand cmd = new SqlCommand(query, connection.GetOpen());
                cmd.ExecuteNonQuery();
                isDelete = "Delete Successful.";
            }
            catch (Exception r)
            {
                isDelete = "Delete Failed!";
            }
            finally
            {
                connection.GetClose();
            }
            return(isDelete);
        }
        public string GetInsertInDb(CourseDetailsEntryDao courseDetailsEntryDao)
        {
            string          isSuccess  = "";
            ConnectionClass connection = new ConnectionClass();
            string          query      = "Insert Into CourseManagement_T values('" + courseDetailsEntryDao.CourseName + "','" + courseDetailsEntryDao.CourseFee + "','" + courseDetailsEntryDao.Duration + "')";

            try
            {
                SqlCommand cmd = new SqlCommand(query, connection.GetOpen());
                cmd.ExecuteNonQuery();
                isSuccess = "Save Success.";
            }
            catch
            {
                isSuccess = "Not Saved!";
            }
            finally
            {
                connection.GetClose();
            }
            return(isSuccess);
        }
        public string GetUpdateStudentFeeDB(AddStudentEntryDao addStudentEntryDao)
        {
            string          isSuccess  = "";
            ConnectionClass connection = new ConnectionClass();
            string          query      = "Update StudentManagement_T Set Paid_Fee='" + addStudentEntryDao.PaidFee + "',Remaining_Fee='" + addStudentEntryDao.RemainingFee + "' Where Registration_No='" + addStudentEntryDao.RegistraionNo + "'";

            try
            {
                SqlCommand cmd = new SqlCommand(query, connection.GetOpen());
                cmd.ExecuteNonQuery();
                isSuccess = "Upate Successful.";
            }
            catch
            {
                isSuccess = "Update Failed!";
            }
            finally
            {
                connection.GetClose();
            }
            return(isSuccess);
        }