public CourseRegistration GetCourse2(string CourseId)
        {
            string                  query = "SELECT * from CourseTable WHERE CourseId = '" + CourseId + "'";
            CourseRegistration      c     = null;
            DatabaseConnectionClass dcc   = new DatabaseConnectionClass();

            dcc.ConnectWithDB();
            SqlDataReader sdr = dcc.GetData(query);

            if (sdr.Read())
            {
                c            = new CourseRegistration();
                c.CourseId   = sdr["CourseId"].ToString();
                c.CourseName = sdr["Name"].ToString();
                c.Semester   = sdr["Semester"].ToString();
                c.Section    = sdr["Section"].ToString();
            }
            dcc.CloseConnection();
            return(c);
        }
        public List <Note> GetAllNotes(string semester, string courseName)
        {
            string                  query = "SELECT * from NoteTable WHERE Semester= '" + semester + "' AND CourseName= '" + courseName + "'";
            List <Note>             nList = new List <Note>();
            DatabaseConnectionClass dcc   = new DatabaseConnectionClass();

            dcc.ConnectWithDB();
            SqlDataReader sdr = dcc.GetData(query);

            while (sdr.Read())
            {
                Note n = new Note();
                n.CourseName = sdr["CourseName"].ToString();
                n.NotePath   = sdr["NotePath"].ToString();
                n.Semester   = sdr["Semester"].ToString();
                n.Section    = sdr["Section"].ToString();
                nList.Add(n);
            }
            dcc.CloseConnection();
            return(nList);
        }
        public List <CourseAssign> GetAllAssignedCourses2()
        {
            string query = "SELECT * from CourseAssignTable";
            List <CourseAssign>     sList = new List <CourseAssign>();
            DatabaseConnectionClass dcc   = new DatabaseConnectionClass();

            dcc.ConnectWithDB();
            SqlDataReader sdr = dcc.GetData(query);

            while (sdr.Read())
            {
                CourseAssign s = new CourseAssign();
                s.AccountId      = sdr["AccountId"].ToString();
                s.AssignedCourse = sdr["AssignedCourse"].ToString();
                s.Semester       = sdr["Semester"].ToString();
                s.Section        = sdr["Section"].ToString();
                sList.Add(s);
            }
            dcc.CloseConnection();
            return(sList);
        }
        /*public bool UpdatePlaces(Places p)
         * {
         *  string query = "UPDATE Places SET  = '" + emp.Name + "', phonenumber = '" + emp.PhnNumber + "', salary = " + emp.Salary + ", designation = '" + emp.Designation + "' WHERE id = '" + emp.Id + "'";
         *  try
         *  {
         *      dcc.ConnectWithDB();
         *      dcc.ExecuteSQL(query);
         *      return true;
         *  }
         *  catch (Exception exp)
         *  {
         *      return false;
         *  }
         *  finally
         *  {
         *      dcc.CloseConnection();
         *  }
         * }*/
        public List <Places> GetAllPlaces()
        {
            List <Places> listOfPlaces = new List <Places>();
            string        query        = "SELECT * FROM Places";

            dcc.ConnectWithDB();
            SqlDataReader sdr = dcc.GetData(query);

            while (sdr.Read())
            {
                Places p = new Places();

                p.From = sdr["wherefrom"].ToString();
                p.To   = sdr["whereto"].ToString();

                listOfPlaces.Add(p);
            }
            dcc.CloseConnection();

            return(listOfPlaces);
        }
Exemplo n.º 5
0
        public List <Teacher> GetAllTeacherInfo2()
        {
            string                  query = "SELECT * from TeacherTable";
            List <Teacher>          cList = new List <Teacher>();
            DatabaseConnectionClass dcc   = new DatabaseConnectionClass();

            dcc.ConnectWithDB();
            SqlDataReader sdr = dcc.GetData(query);

            while (sdr.Read())
            {
                Teacher t = new Teacher();
                t.AccountId = sdr["AccountId"].ToString();
                t.WeekHour  = Convert.ToInt32(sdr["WeekHour"]);
                t.Status    = sdr["Status"].ToString();
                t.Salary    = Convert.ToDouble(sdr["Salary"]);
                cList.Add(t);
            }
            dcc.CloseConnection();
            return(cList);
        }
        public List <string> GetOnlySection(string semester, string ID, string course)
        {
            string                  query = "SELECT * from CourseRegistrationTable WHERE Semester= '" + semester + "' AND AccountId= '" + ID + "'AND CourseName= '" + course + "'";
            List <string>           cList = new List <string>();
            DatabaseConnectionClass dcc   = new DatabaseConnectionClass();

            dcc.ConnectWithDB();
            SqlDataReader sdr = dcc.GetData(query);

            while (sdr.Read())
            {
                CourseRegistration c = new CourseRegistration();
                c.CourseId   = sdr["CourseId"].ToString();
                c.CourseName = sdr["CourseName"].ToString();
                c.Section    = sdr["Section"].ToString();
                c.AccountId  = sdr["AccountId"].ToString();
                c.Status     = sdr["Status"].ToString();
                cList.Add(c.Section);
            }
            dcc.CloseConnection();
            return(cList);
        }
        public List <Course> GetAllCourse2(string accountid, string sname)
        {
            string                  query = "SELECT Name,Schedule from CourseTable WHERE CourseId IN (SELECT CourseId from CourseRegistrationTable WHERE AccountId='" + accountid + "' AND Semester='" + sname + "')";
            List <Course>           aList = new List <Course>();
            DatabaseConnectionClass dcc   = new DatabaseConnectionClass();

            dcc.ConnectWithDB();
            SqlDataReader sdr = dcc.GetData(query);

            while (sdr.Read())
            {
                Course a = new Course();

                a.Name     = sdr["Name"].ToString();
                a.Schedule = sdr["Schedule"].ToString();


                aList.Add(a);
            }
            dcc.CloseConnection();
            return(aList);
        }
Exemplo n.º 8
0
        public List <string> GetAccountIdsScholarshipApprove2()
        {
            string                  query = "SELECT * from StudentBalanceTable WHERE Scholarship = 'Eligible For Scholarship'";
            List <string>           sList = new List <string>();
            DatabaseConnectionClass dcc   = new DatabaseConnectionClass();

            dcc.ConnectWithDB();
            SqlDataReader sdr = dcc.GetData(query);

            while (sdr.Read())
            {
                StudentBalance s = new StudentBalance();
                s.AccountId   = sdr["AccountId"].ToString();
                s.Semester    = sdr["Semester"].ToString();
                s.Scholarship = sdr["Scholarship"].ToString();
                s.Balance     = Convert.ToDouble(sdr["Balance"]);
                s.Validation  = sdr["Validation"].ToString();
                sList.Add(s.AccountId);
            }
            dcc.CloseConnection();
            return(sList);
        }
        public List <CourseAssign> GetAllSections(string accountId, string semseter)
        {
            string query = "SELECT * from CourseAssignTable WHERE AccountId='" + accountId + "' AND Semester='" + semseter + "'";
            List <CourseAssign>     cList = new List <CourseAssign>();
            DatabaseConnectionClass dcc   = new DatabaseConnectionClass();

            dcc.ConnectWithDB();
            SqlDataReader sdr = dcc.GetData(query);

            while (sdr.Read())
            {
                CourseAssign c = new CourseAssign();
                c.AccountId      = sdr["AccountId"].ToString();
                c.AssignedCourse = sdr["AssignedCourse"].ToString();
                c.Semester       = sdr["Semester"].ToString();
                c.Section        = sdr["Section"].ToString();

                cList.Add(c);
            }
            dcc.CloseConnection();
            return(cList);
        }
Exemplo n.º 10
0
        public List <Notice> GetAllNotice(string semester, string courseId, string section)
        {
            string                  query = "SELECT * from NoticeTable WHERE Semester= '" + semester + "' AND CourseId= '" + courseId + "' AND Section= '" + section + "'";
            List <Notice>           cList = new List <Notice>();
            DatabaseConnectionClass dcc   = new DatabaseConnectionClass();

            dcc.ConnectWithDB();
            SqlDataReader sdr = dcc.GetData(query);

            while (sdr.Read())
            {
                Notice c = new Notice();
                c.CourseId = sdr["CourseId"].ToString();
                c.Semester = sdr["Semester"].ToString();
                c.Section  = sdr["Section"].ToString();
                c.Noticee  = sdr["Notice"].ToString();
                c.Date     = sdr["Date"].ToString();
                cList.Add(c);
            }
            dcc.CloseConnection();
            return(cList);
        }
        public bool RoutineVerification2(string accountid, string sname)
        {
            string query = "SELECT CourseId from CourseRegistrationTable WHERE AccountId='" + accountid + "' AND Semester='" + sname + "'";
            Course a     = null;
            DatabaseConnectionClass dcc = new DatabaseConnectionClass();

            dcc.ConnectWithDB();
            SqlDataReader sdr = dcc.GetData(query);

            if (sdr.Read())
            {
                a = new Course();
                dcc.CloseConnection();
                return(true);
            }

            else
            {
                dcc.CloseConnection();
                return(false);
            }
        }
        public string UserLoginVerification2(Account a)
        {
            string query = "SELECT * from AccountTable WHERE AccountId= '" + a.AccountId + "' AND Password= '******'";
            DatabaseConnectionClass dcc = new DatabaseConnectionClass();

            dcc.ConnectWithDB();
            SqlDataReader sdr = dcc.GetData(query);

            if (sdr.Read())
            {
                //a.Name = sdr["AccountName"].ToString();
                //a.Gender = Convert.ToDouble(sdr["Salary"]);
                //a.Address = sdr["Designation"].ToString();
                a.AccountType = sdr["AccountType"].ToString();
                dcc.CloseConnection();
                return(a.AccountType);
            }
            else
            {
                dcc.CloseConnection();
                return("false");
            }
        }
        public List <CourseRegistration> GetAllCourses2()
        {
            string query = "SELECT * from CourseRegistrationTable";
            List <CourseRegistration> cList = new List <CourseRegistration>();
            DatabaseConnectionClass   dcc   = new DatabaseConnectionClass();

            dcc.ConnectWithDB();
            SqlDataReader sdr = dcc.GetData(query);

            while (sdr.Read())
            {
                CourseRegistration c = new CourseRegistration();
                c.CourseId   = sdr["CourseId"].ToString();
                c.CourseName = sdr["CourseName"].ToString();
                c.Semester   = sdr["Semester"].ToString();
                c.Section    = sdr["Section"].ToString();
                c.AccountId  = sdr["AccountId"].ToString();
                c.Status     = sdr["Status"].ToString();
                cList.Add(c);
            }
            dcc.CloseConnection();
            return(cList);
        }
Exemplo n.º 14
0
        public bool CheckExamCourseId2(string CourseId)
        {
            string query = "SELECT * from ExamTable WHERE CourseId = '" + CourseId + "'";
            Exam   e     = new Exam();
            DatabaseConnectionClass dcc = new DatabaseConnectionClass();

            dcc.ConnectWithDB();
            SqlDataReader sdr = dcc.GetData(query);

            if (sdr.Read())
            {
                e                   = new Exam();
                e.CourseId          = sdr["CourseId"].ToString();
                e.Semester          = sdr["Semester"].ToString();
                e.Day               = sdr["Day"].ToString();
                e.Slot              = sdr["Slot"].ToString();
                e.AssignedFacultyId = sdr["AssignedFacultyId"].ToString();
                e.Room              = sdr["Room"].ToString();
                return(true);
            }
            dcc.CloseConnection();
            return(false);
        }
Exemplo n.º 15
0
        public List <Exam> GetAllExams2()
        {
            string                  query = "SELECT * from ExamTable";
            List <Exam>             eList = new List <Exam>();
            DatabaseConnectionClass dcc   = new DatabaseConnectionClass();

            dcc.ConnectWithDB();
            SqlDataReader sdr = dcc.GetData(query);

            while (sdr.Read())
            {
                Exam e = new Exam();
                e.CourseId          = sdr["CourseId"].ToString();
                e.Semester          = sdr["Semester"].ToString();
                e.Day               = sdr["Day"].ToString();
                e.Slot              = sdr["Slot"].ToString();
                e.Room              = sdr["Room"].ToString();
                e.AssignedFacultyId = sdr["AssignedFacultyId"].ToString();
                eList.Add(e);
            }
            dcc.CloseConnection();
            return(eList);
        }
        public bool UserLoginValidation(Customer cm)
        {
            string query = "SELECT * from Customer WHERE CId = '" + cm.CId + "' AND CPassword='******'";
            DatabaseConnectionClass dcc1 = new DatabaseConnectionClass();

            dcc1.ConnectWithDB();
            SqlDataReader sdr3 = dcc1.GetData(query);

            // dcc.CloseConnection();
            if (sdr3.Read())
            {
                cm.CName = sdr3["CName"].ToString();

                cm.CEmail = sdr3["CEmail"].ToString();
                cm.CPhone = sdr3["CPhone"].ToString();
                dcc1.CloseConnection();
                return(true);
            }
            else
            {
                dcc1.CloseConnection();
                return(false);
            }
        }
        public bool UserLoginValidation(Owner own)
        {
            string query = "SELECT * from Owner WHERE OId = '" + own.OId + "' AND OPassword='******'";
            DatabaseConnectionClass dcc = new DatabaseConnectionClass();

            dcc.ConnectWithDB();
            SqlDataReader sdr1 = dcc.GetData(query);

            // dcc.CloseConnection();
            if (sdr1.Read())
            {
                own.OName = sdr1["OName"].ToString();

                own.OEmail = sdr1["OEmail"].ToString();
                own.OPhone = sdr1["OPhone"].ToString();
                dcc.CloseConnection();
                return(true);
            }
            else
            {
                dcc.CloseConnection();
                return(false);
            }
        }
        public List <CourseResults> GetAllResult(string semester, string ID)
        {
            string query = "SELECT * from CourseResultsTable WHERE Semester= '" + semester + "' AND AccountId= '" + ID + "'";
            List <CourseResults>    gList = new List <CourseResults>();
            DatabaseConnectionClass dcc   = new DatabaseConnectionClass();

            dcc.ConnectWithDB();
            SqlDataReader sdr = dcc.GetData(query);

            while (sdr.Read())
            {
                CourseResults c = new CourseResults();
                c.CourseName = sdr["CourseName"].ToString();
                c.Section    = sdr["Section"].ToString();
                c.Quiz       = Convert.ToDouble(sdr["Quiz"]);
                c.Term       = Convert.ToDouble(sdr["Term"]);
                c.FinalMark  = Convert.ToDouble(sdr["FinalMark"]);
                c.Grade      = Convert.ToDouble(sdr["Grade"]);
                c.Status     = sdr["Status"].ToString();
                gList.Add(c);
            }
            dcc.CloseConnection();
            return(gList);
        }
        public Account GetAccountTypeShovon2(string AccountId)
        {
            string  query = "SELECT * from AccountTable WHERE AccountId= '" + AccountId + "'";
            Account a     = null;
            DatabaseConnectionClass dcc = new DatabaseConnectionClass();

            dcc.ConnectWithDB();
            SqlDataReader sdr = dcc.GetData(query);

            if (sdr.Read())
            {
                a             = new Account();
                a.AccountId   = sdr["AccountId"].ToString();
                a.Password    = sdr["Password"].ToString();
                a.Name        = sdr["Name"].ToString();
                a.Gender      = sdr["Gender"].ToString();
                a.Address     = sdr["Address"].ToString();
                a.AccountType = sdr["AccountType"].ToString();
                a.BloodGroup  = sdr["BloodGroup"].ToString();
                a.DOB         = sdr["DOB"].ToString();;
            }
            dcc.CloseConnection();
            return(a);
        }