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 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); }
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); }
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 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); }