public List <string> GetCourseIdNameSectionsBySemester2(string Semester) { string query = "SELECT * from CourseTable WHERE Semester = '" + Semester + "'"; List <string> cList = new List <string>(); DatabaseConnectionClass dcc = new DatabaseConnectionClass(); dcc.ConnectWithDB(); SqlDataReader sdr = dcc.GetData(query); while (sdr.Read()) { Course c = new Course(); c.CourseId = sdr["CourseId"].ToString(); c.Name = sdr["Name"].ToString(); c.Semester = sdr["Semester"].ToString(); c.Department = sdr["Department"].ToString(); c.Section = sdr["Section"].ToString(); c.MaxStudent = Convert.ToInt32(sdr["MaxStudent"]); c.CurrentStudent = Convert.ToInt32(sdr["CurrentStudent"]); c.Credit = Convert.ToInt32(sdr["Credit"]); c.Schedule = sdr["Schedule"].ToString(); cList.Add(c.CourseId + " " + c.Name + " [" + c.Section + "]"); } dcc.CloseConnection(); return(cList); }
public List <Course> GetCourseIdStudent(string course, string semester, string section) { string query = "SELECT * from CourseTable WHERE Name= '" + course + "' AND Semester ='" + semester + "' AND Section='" + section + "'"; List <Course> cList = new List <Course>(); DatabaseConnectionClass dcc = new DatabaseConnectionClass(); dcc.ConnectWithDB(); SqlDataReader sdr = dcc.GetData(query); while (sdr.Read()) { Course c = new Course(); c.CourseId = sdr["CourseId"].ToString(); c.Name = sdr["Name"].ToString(); c.Semester = sdr["Semester"].ToString(); c.Department = sdr["Department"].ToString(); c.Section = sdr["Section"].ToString(); c.MaxStudent = Convert.ToInt32(sdr["MaxStudent"]); c.CurrentStudent = Convert.ToInt32(sdr["CurrentStudent"]); c.Credit = Convert.ToDouble(sdr["Credit"]); c.Schedule = sdr["Schedule"].ToString(); cList.Add(c); } dcc.CloseConnection(); return(cList); }
public bool CheckCourseIdAndSemesterName2(Course s) { string query = "SELECT * from CourseTable WHERE CourseId = '" + s.CourseId + "' AND Semester = '" + s.Semester + "'"; Course c = null; DatabaseConnectionClass dcc = new DatabaseConnectionClass(); dcc.ConnectWithDB(); SqlDataReader sdr = dcc.GetData(query); if (sdr.Read()) { c = new Course(); c.CourseId = sdr["CourseId"].ToString(); c.Name = sdr["Name"].ToString(); c.Semester = sdr["Semester"].ToString(); c.Department = sdr["Department"].ToString(); c.Section = sdr["Section"].ToString(); c.MaxStudent = Convert.ToInt32(sdr["MaxStudent"]); c.CurrentStudent = Convert.ToInt32(sdr["CurrentStudent"]); c.Credit = Convert.ToInt32(sdr["Credit"]); c.Schedule = sdr["Schedule"].ToString(); return(true); } dcc.CloseConnection(); return(false); }
public Course GetCourseId(string courseName, string semester, string section) { string query = "SELECT * from CourseTable WHERE Name= '" + courseName + "' AND Semester ='" + semester + "' AND Section='" + section + "'"; Course a = null; DatabaseConnectionClass dcc = new DatabaseConnectionClass(); dcc.ConnectWithDB(); SqlDataReader sdr = dcc.GetData(query); if (sdr.Read()) { a = new Course(); a.CourseId = sdr["CourseId"].ToString(); a.Name = sdr["Name"].ToString(); a.Semester = sdr["Semester"].ToString(); a.Department = sdr["Department"].ToString(); a.Section = sdr["Section"].ToString(); a.MaxStudent = Convert.ToInt32(sdr["MaxStudent"]); a.CurrentStudent = Convert.ToInt32(sdr["CurrentStudent"]); a.Credit = Convert.ToInt32(sdr["Credit"]); a.Schedule = sdr["Schedule"].ToString(); } dcc.CloseConnection(); return(a); }
public bool Update2(Teacher a) { try { string query = "UPDATE TeacherTable SET WeekHour = " + a.WeekHour + ", Status='" + a.Status + "', Salary=" + a.Salary + " WHERE AccountId= '" + a.AccountId + "'"; DatabaseConnectionClass dcc = new DatabaseConnectionClass(); dcc.ConnectWithDB(); int x = dcc.ExecuteSQL(query); dcc.CloseConnection(); return(true); } catch { return(false); } }
public bool Insert2(Teacher a) { try { string query = "INSERT into TeacherTable VALUES ('" + a.AccountId + "', " + a.WeekHour + ",'" + a.Status + "', " + a.Salary + ")"; DatabaseConnectionClass dcc = new DatabaseConnectionClass(); dcc.ConnectWithDB(); int x = dcc.ExecuteSQL(query); dcc.CloseConnection(); return(true); } catch { return(false); } }
public bool Insert2(CourseAssign s) { try { string query = "INSERT into CourseAssignTable VALUES ('" + s.AccountId + "', '" + s.AssignedCourse + "', '" + s.Semester + "', '" + s.Section + "')"; DatabaseConnectionClass dcc = new DatabaseConnectionClass(); dcc.ConnectWithDB(); int x = dcc.ExecuteSQL(query); dcc.CloseConnection(); return(true); } catch { return(false); } }
public bool UpdateInvalide2(StudentBalance s) { try { string query = "UPDATE StudentBalanceTable SET Validation = 'Valid', Balance = '" + s.Balance + "' WHERE AccountId = '" + s.AccountId + "'"; DatabaseConnectionClass dcc = new DatabaseConnectionClass(); dcc.ConnectWithDB(); int x = dcc.ExecuteSQL(query); dcc.CloseConnection(); return(true); } catch { return(false); } }
public float GetBalance(string AccountId) { string query = "SELECT * from StudentBalanceTable WHERE AccountId= '" + AccountId + "'"; DatabaseConnectionClass dcc = new DatabaseConnectionClass(); dcc.ConnectWithDB(); SqlDataReader sdr = dcc.GetData(query); float Balance = 0; if (sdr.Read()) { Balance = float.Parse(sdr["Balance"].ToString()); } dcc.CloseConnection(); return(Balance); }
public int Update2(Semester a, string newId) { try { string query = "UPDATE SemesterTable SET Name = '" + a.Name + "', SemesterId = '" + newId + "' WHERE SemesterId= '" + a.SemesterId + "'"; DatabaseConnectionClass dcc = new DatabaseConnectionClass(); dcc.ConnectWithDB(); int x = dcc.ExecuteSQL(query); dcc.CloseConnection(); return(x); } catch { return(0); } }
public bool Insert2(Exam e) { try { string query = "INSERT into ExamTable VALUES ('" + e.CourseId + "', '" + e.Semester + "', '" + e.Day + "', '" + e.Slot + "', '" + e.Room + "', '" + e.AssignedFacultyId + "')"; DatabaseConnectionClass dcc = new DatabaseConnectionClass(); dcc.ConnectWithDB(); int x = dcc.ExecuteSQL(query); dcc.CloseConnection(); return(true); } catch { return(false); } }
public bool UpdateTermMark(CourseResults a) { try { string query = "UPDATE CourseResultsTable SET Term= '" + a.Term + "' , FinalMark = '" + a.FinalMark + "' , Grade='" + a.Grade + "' WHERE AccountId= '" + a.AccountId + "' AND CourseName = '" + a.CourseName + "' AND Section='" + a.Section + "' AND Semester='" + a.Semester + "'"; DatabaseConnectionClass dcc = new DatabaseConnectionClass(); dcc.ConnectWithDB(); int x = dcc.ExecuteSQL(query); dcc.CloseConnection(); return(true); } catch { return(false); } }
public bool DoReg(string ID, string courseId, string semester, string section, string courseName) { try { string query = "INSERT INTO CourseResultsTable (Semester, Section, AccountId, CourseName, Status) VALUES ('" + semester + "', '" + section + "', '" + ID + "', '" + courseName + "', 'Active')"; DatabaseConnectionClass dcc = new DatabaseConnectionClass(); dcc.ConnectWithDB(); int x = dcc.ExecuteSQL(query); dcc.CloseConnection(); return(true); } catch { return(false); } }
public bool UpdateStatus(CourseResults c) { try { string query = "UPDATE CourseResultsTable SET Status = '" + c.Status + "' WHERE AccountId= '" + c.AccountId + "' AND CourseName = '" + c.CourseName + "' AND Section='" + c.Section + "' AND Semester='" + c.Semester + "'"; DatabaseConnectionClass dcc = new DatabaseConnectionClass(); dcc.ConnectWithDB(); int x = dcc.ExecuteSQL(query); dcc.CloseConnection(); return(true); } catch { return(false); } }
public double GetQuizMark(CourseResults cr) { string query = "SELECT * from CourseResultsTable WHERE AccountId= '" + cr.AccountId + "' AND CourseName='" + cr.CourseName + "' AND Semester='" + cr.Semester + "' AND Section='" + cr.Section + "'"; double quizMark = 0; DatabaseConnectionClass dcc = new DatabaseConnectionClass(); dcc.ConnectWithDB(); SqlDataReader sdr = dcc.GetData(query); if (sdr.Read()) { quizMark = Convert.ToDouble(sdr["Quiz"]); } dcc.CloseConnection(); return(quizMark); }
public int UpdateRegistrationStatus2(string semesterId, string status) { try { string query = "UPDATE SemesterTable SET RegistrationStatus = '" + status + "' WHERE SemesterId = '" + semesterId + "'"; DatabaseConnectionClass dcc = new DatabaseConnectionClass(); dcc.ConnectWithDB(); int x = dcc.ExecuteSQL(query); dcc.CloseConnection(); return(x); } catch { return(0); } }
public bool Insert2(Semester s) { try { string query = "INSERT into SemesterTable VALUES ('" + s.SemesterId + "', '" + s.Name + "', '" + s.RegistrationStatus + "')"; DatabaseConnectionClass dcc = new DatabaseConnectionClass(); dcc.ConnectWithDB(); int x = dcc.ExecuteSQL(query); dcc.CloseConnection(); return(true); } catch { return(false); } }
public bool Update2(Exam e) { try { string query = " UPDATE ExamTable SET Semester = '" + e.Semester + "', Day = '" + e.Day + "', Slot = '" + e.Slot + "', Room = '" + e.Room + "', AssignedFacultyId = '" + e.AssignedFacultyId + "' WHERE CourseId = '" + e.CourseId + "' "; DatabaseConnectionClass dcc = new DatabaseConnectionClass(); dcc.ConnectWithDB(); int x = dcc.ExecuteSQL(query); dcc.CloseConnection(); return(true); } catch { return(false); } }
public bool Insert2(StudentBalance a) { try { string query = "INSERT into StudentBalanceTable VALUES ('" + a.AccountId + "', '" + a.Semester + "','" + a.Scholarship + "', " + a.Balance + ",'" + a.Validation + "')"; DatabaseConnectionClass dcc = new DatabaseConnectionClass(); dcc.ConnectWithDB(); int x = dcc.ExecuteSQL(query); dcc.CloseConnection(); return(true); } catch { return(false); } }
public bool Delete(string AId) { try { string query = "DELETE From Admin WHERE AId='" + AId + "'"; DatabaseConnectionClass dcc = new DatabaseConnectionClass(); dcc.ConnectWithDB(); int x = dcc.ExecuteSQL(query); dcc.CloseConnection(); return(true); } catch (Exception ex) { return(false); } }
public bool UpdateScholarshipEligible2(StudentBalance s) { try { string query = "UPDATE StudentBalanceTable SET Scholarship = '" + s.Scholarship + "' WHERE AccountId= '" + s.AccountId + "'"; DatabaseConnectionClass dcc = new DatabaseConnectionClass(); dcc.ConnectWithDB(); int x = dcc.ExecuteSQL(query); dcc.CloseConnection(); return(true); } catch { return(false); } }
public bool Update(Admin ad) { try { string query = "UPDATE Admin SET AName = '" + ad.AName + "', ASal =" + ad.ASal + ", APhone = '" + ad.APhone + "WHERE AId = '" + ad.AId + "'"; DatabaseConnectionClass dcc = new DatabaseConnectionClass(); dcc.ConnectWithDB(); int x = dcc.ExecuteSQL(query); dcc.CloseConnection(); return(true); } catch (Exception ex) { return(false); } }
public bool Insert(Notice a) { try { string query = "INSERT into NoticeTable VALUES ('" + a.CourseId + "','" + a.Section + "','" + a.Semester + "','" + a.Noticee + "','" + a.Date + "')"; DatabaseConnectionClass dcc = new DatabaseConnectionClass(); dcc.ConnectWithDB(); int x = dcc.ExecuteSQL(query); dcc.CloseConnection(); return(true); } catch { return(false); } }
public bool Insert2(Account a) { try { string query = "INSERT into AccountTable VALUES ('" + a.AccountId + "', '" + a.Password + "', '" + a.Name + "', '" + a.DOB + "', '" + a.BloodGroup + "', '" + a.Gender + "', '" + a.Address + "', '" + a.AccountType + "')"; DatabaseConnectionClass dcc = new DatabaseConnectionClass(); dcc.ConnectWithDB(); int x = dcc.ExecuteSQL(query); dcc.CloseConnection(); return(true); } catch { return(false); } }
public bool UpdateStatusShovon(string accountId, string status, int weekhour) { try { string query = "UPDATE TeacherTable SET Status = '" + status + "',WeekHour=" + weekhour + " WHERE AccountId='" + accountId + "'"; DatabaseConnectionClass dcc = new DatabaseConnectionClass(); dcc.ConnectWithDB(); int x = dcc.ExecuteSQL(query); dcc.CloseConnection(); return(true); } catch { return(false); } }
public string GetAccountType2(string AccountId) { string query = "SELECT * from AccountTable WHERE AccountId= '" + AccountId + "'"; DatabaseConnectionClass dcc = new DatabaseConnectionClass(); dcc.ConnectWithDB(); SqlDataReader sdr = dcc.GetData(query); string AccountType = ""; if (sdr.Read()) { AccountType = sdr["AccountType"].ToString(); } dcc.CloseConnection(); return(AccountType); }
public bool Update2(string AccountId, double salary) { try { string query = " UPDATE TeacherTable SET Salary = '" + salary + "' WHERE AccountId = '" + AccountId + "' "; DatabaseConnectionClass dcc = new DatabaseConnectionClass(); dcc.ConnectWithDB(); int x = dcc.ExecuteSQL(query); dcc.CloseConnection(); return(true); } catch { return(false); } }
public bool SendMsg(string ID, string id, string msg, string User) { try { string query = "INSERT INTO ChatTable (AccountId, Msg) VALUES ('" + id + "', '" + User + " : " + msg + "')"; DatabaseConnectionClass dcc = new DatabaseConnectionClass(); dcc.ConnectWithDB(); int x = dcc.ExecuteSQL(query); dcc.CloseConnection(); return(true); } catch { return(false); } }
public bool UpdateStatusNadim(string accountId) { try { string query = "UPDATE TeacherTable SET Status = 'Vacation Applied' WHERE AccountId='" + accountId + "'"; DatabaseConnectionClass dcc = new DatabaseConnectionClass(); dcc.ConnectWithDB(); int x = dcc.ExecuteSQL(query); dcc.CloseConnection(); return(true); } catch { return(false); } }
public int Delete2(string SemesterId) { try { string query = "DELETE from SemesterTable WHERE SemesterId = '" + SemesterId + "'"; DatabaseConnectionClass dcc = new DatabaseConnectionClass(); dcc.ConnectWithDB(); int x = dcc.ExecuteSQL(query); dcc.CloseConnection(); return(x); } catch { return(0); } }