Пример #1
0
        public string addNewTeacher(Teacher userPerInfo)
        {
            try
            {
                userPerInfo.user_crdate   = DateTime.Now;
                userPerInfo.user_isactive = true;
                //userlocked
                //user_failedattempt
                //user_lockedtilldate
                //user_crby
                //user_upddate
                int userid = objUserInfoDAL.getUserId(userPerInfo.user_email);
                if (userid == 0)
                {
                    objUserInfoDAL.addNewUser(userPerInfo);
                    userid = objUserInfoDAL.getUserId(userPerInfo.user_email);
                    userPerInfo.user_id = userid;
                    objUserInfoDAL.saveUserPersonalInfo(userPerInfo);
                    objUserInfoDAL.saveTeacherInfo(userPerInfo);

                    return("Success");
                }
                else
                {
                    return("User Exists");
                }
            }
            catch (Exception ex)
            {
                CubitExceptionUtility.CubitExceptionLog(ex.Message + "BAL: Error while passing teacher details in to the DAL" + ex.StackTrace + " " + ex.InnerException, this.GetType().BaseType.Name.ToString(), DateTime.Now.ToLongTimeString(), DateTime.Now.ToLongDateString());
                return("error");
            }
        }
Пример #2
0
        /* ---------FETCH EVENTS,DOCUMENTS,LOCATION,FEEDS,POST--------------*/

        public void createEvent(EventPost events)
        {
            try
            {
                if (events.event_document_id != null)
                {
                    if (events.list_document_id.Count() > 1)
                    {
                        events.event_document_id = string.Join(",", events.list_document_id);
                    }
                }
                else if (events.event_gpslocation_id != null)
                {
                    if (events.list_gpslocation_id.Count() > 1)
                    {
                        events.event_gpslocation_id = string.Join(",", events.list_gpslocation_id);
                    }
                }
                objUserInfoDAL.createEvent(events);
            }
            catch (Exception ex)
            {
                CubitExceptionUtility.CubitExceptionLog(ex.Message + "BAL: Error while creating a event" + ex.StackTrace + " " + ex.InnerException, this.GetType().BaseType.Name.ToString(), DateTime.Now.ToLongTimeString(), DateTime.Now.ToLongDateString());
            }
        }
Пример #3
0
        /*-------------------------------------------------------------------------------HOME PAGE------------------------------------------------------*/

        public string addTimeTable(PeriodTimeTable periodTimeTable)
        {
            try
            {
                periodTimeTable.createddate = DateTime.Now;
                periodTimeTable.isactive    = true;
                int TimeTableid = objUserInfoDAL.getTimeTableid(periodTimeTable.class_id, periodTimeTable.section_id);
                if (TimeTableid == 0)
                {
                    objUserInfoDAL.addTimeTable(periodTimeTable);
                    TimeTableid = objUserInfoDAL.getTimeTableid(periodTimeTable.class_id, periodTimeTable.section_id);
                    periodTimeTable.timetable_id = TimeTableid;
                    objUserInfoDAL.addPeriodTimeTable(periodTimeTable);
                    return("Success");
                }
                else
                {
                    return("User Exists");
                }
            }
            catch (Exception ex)
            {
                CubitExceptionUtility.CubitExceptionLog(ex.Message + "BAL: Error while inserting TimeTable details" + ex.StackTrace + " " + ex.InnerException, this.GetType().BaseType.Name.ToString(), DateTime.Now.ToLongTimeString(), DateTime.Now.ToLongDateString());
                return("Error");
            }
        }
Пример #4
0
        public string addReportCard(ReportCard reportCard)
        {
            int id;

            try
            {
                id = objUserInfoDAL.getExamReportMappingid(reportCard.erm_institution_id, reportCard.erm_class_id, reportCard.erm_section_id, reportCard.exam_term);
                if (id == 0)
                {
                    return("Alraedy this student created a report card ");
                }
                else
                {
                    id = objUserInfoDAL.getExamReportMappingid(reportCard.erm_institution_id, reportCard.erm_class_id, reportCard.erm_section_id, reportCard.exam_term);
                    reportCard.erm_id = id;
                    objUserInfoDAL.addReportCard(reportCard);
                    return("Success");
                }
            }
            catch (Exception ex)
            {
                CubitExceptionUtility.CubitExceptionLog(ex.Message + "BAL: Error while storing Post details" + ex.StackTrace + " " + ex.InnerException, this.GetType().BaseType.Name.ToString(), DateTime.Now.ToLongTimeString(), DateTime.Now.ToLongDateString());
                return("Error");
            }
        }
Пример #5
0
        /*----------------------------------------------------------------------------EXAM SCHEDULE-----------------------------------------------------*/

        public string addExamSchedule(ExamSchedule examSchedule)
        {
            int id;

            try
            {
                id = objUserInfoDAL.getExamReportMappingid(examSchedule.erm_institution_id, examSchedule.erm_class_id, examSchedule.erm_section_id, examSchedule.exam_term);
                if (id == 0)
                {
                    objUserInfoDAL.addExamReportMapping(examSchedule);
                    id = objUserInfoDAL.getExamReportMappingid(examSchedule.erm_institution_id, examSchedule.erm_class_id, examSchedule.erm_section_id, examSchedule.exam_term);
                    examSchedule.erm_id = id;
                    objUserInfoDAL.addExamSchedule(examSchedule);
                    return("Success");
                }
                else
                {
                    return("User Exists");
                }
            }
            catch (Exception ex)
            {
                CubitExceptionUtility.CubitExceptionLog(ex.Message + "BAL: Error while storing Post details" + ex.StackTrace + " " + ex.InnerException, this.GetType().BaseType.Name.ToString(), DateTime.Now.ToLongTimeString(), DateTime.Now.ToLongDateString());
                return("Error");
            }
        }
Пример #6
0
        public string addNewInstitute(Institution institution)
        {
            try
            {
                institution.user_crdate   = DateTime.Now;
                institution.user_isactive = true;
                //userlocked
                //user_failedattempt
                //user_lockedtilldate
                //user_crby
                //user_upddate
                int userid = objUserInfoDAL.getUserId(institution.user_email);
                if (userid == 0)
                {
                    objUserInfoDAL.addInstitution(institution);
                    userid = objUserInfoDAL.getUserId(institution.user_email);
                    institution.user_id = userid;
                    objUserInfoDAL.saveInstitutionInfo(institution);
                    return("Success");
                }
                else
                {
                    return("User Exists");
                }
            }
            catch (Exception ex)
            {
                CubitExceptionUtility.CubitExceptionLog(ex.Message + "BAL: Error while passing student details in to the DAL" + ex.StackTrace + " " + ex.InnerException, this.GetType().BaseType.Name.ToString(), DateTime.Now.ToLongTimeString(), DateTime.Now.ToLongDateString());

                return("Error");
            }
        }
Пример #7
0
        /*-------------------------------------------------------------------------------PROFILE PAGE--------------------------------------------*/

        /* ----------FETCH PROFILE,FRIENDS,CLASSMEATS,SCHOOLMATES ----------*/

        public void getSameSchoolClassFriendsList(int student_institution_id, int student_class)
        {
            try
            {
                objUserInfoDAL.getSameSchoolClassFriendsList(student_institution_id, student_class);
            }
            catch (Exception ex)
            {
                CubitExceptionUtility.CubitExceptionLog(ex.Message + "BAL: Error while getting Same School Class Friends List" + ex.StackTrace + " " + ex.InnerException, this.GetType().BaseType.Name.ToString(), DateTime.Now.ToLongTimeString(), DateTime.Now.ToLongDateString());
            }
        }
Пример #8
0
 public void userMemberGroup(UserGroup objGroup)
 {
     try
     {
         objUserInfoDAL.userMemberGroup(objGroup);
     }
     catch (Exception ex)
     {
         CubitExceptionUtility.CubitExceptionLog(ex.Message + "BAL: Error while deleting group" + ex.StackTrace + " " + ex.InnerException, this.GetType().BaseType.Name.ToString(), DateTime.Now.ToLongTimeString(), DateTime.Now.ToLongDateString());
     }
 }
Пример #9
0
 public void updateGroup(ClassEntities.Group objGroup)
 {
     try
     {
         objUserInfoDAL.updateGroup(objGroup);
     }
     catch (Exception ex)
     {
         CubitExceptionUtility.CubitExceptionLog(ex.Message + "BAL: Error while calling update group in to the UserInfoDAL" + ex.StackTrace + " " + ex.InnerException, this.GetType().BaseType.Name.ToString(), DateTime.Now.ToLongTimeString(), DateTime.Now.ToLongDateString());
     }
 }
Пример #10
0
 public void updateRequest(RequestStatus requestStatus, EnumRequestStatus.requsetStatus status)
 {
     try
     {
         objUserInfoDAL.updateRequest(requestStatus, status);
     }
     catch (Exception ex)
     {
         CubitExceptionUtility.CubitExceptionLog(ex.Message + "BAL: Error while calling update request in to the UserInfoDAL" + ex.StackTrace + " " + ex.InnerException, this.GetType().BaseType.Name.ToString(), DateTime.Now.ToLongTimeString(), DateTime.Now.ToLongDateString());
     }
 }
Пример #11
0
 public void addGPSLocation(GPSLocation location)
 {
     try
     {
         objUserInfoDAL.addGPSLocation(location);
     }
     catch (Exception ex)
     {
         CubitExceptionUtility.CubitExceptionLog(ex.Message + "BAL: Error while storing GPS location details" + ex.StackTrace + " " + ex.InnerException, this.GetType().BaseType.Name.ToString(), DateTime.Now.ToLongTimeString(), DateTime.Now.ToLongDateString());
     }
 }
Пример #12
0
 public IQueryable <UserPersonalInfo> getDiffSchoolFriendsList(int user_id, int student_institution_id)
 {
     try
     {
         IQueryable <UserPersonalInfo> lstStudents = objUserInfoDAL.getDiffSchoolFriendsList(user_id, student_institution_id);
         return(lstStudents);
     }
     catch (Exception ex)
     {
         CubitExceptionUtility.CubitExceptionLog(ex.Message + "BAL: Error while fetching different school friends list " + ex.StackTrace + " " + ex.InnerException, this.GetType().BaseType.Name.ToString(), DateTime.Now.ToLongTimeString(), DateTime.Now.ToLongDateString());
         throw ex;
     }
 }
Пример #13
0
 public IQueryable <EventPost> getSameInstTeacherEvents(int teacher_institution_id)
 {
     try
     {
         IQueryable <EventPost> listOfEvents = objUserInfoDAL.getSameInstTeacherEvents(teacher_institution_id);
         return(listOfEvents);
     }
     catch (Exception ex)
     {
         CubitExceptionUtility.CubitExceptionLog(ex.Message + "BAL: Error while fetching same institution teachers list of events " + ex.StackTrace + " " + ex.InnerException, this.GetType().BaseType.Name.ToString(), DateTime.Now.ToLongTimeString(), DateTime.Now.ToLongDateString());
         throw ex;
     }
 }
Пример #14
0
        /*------------------MY PROJECT----------------*/

        /*--------------------QUIZ--------------------*/

        /*---------------COURSE MATERIAL--------------*/

        /*----------------------------------------------------------------------------INSTITUTION-----------------------------------------------------*/

        /*----------------STUDENT DATABASE-----------------*/

        public IQueryable <Student> getStudentDatabase(int user_id)
        {
            try
            {
                IQueryable <Student> listOfStudentDatabase = objUserInfoDAL.getStudentDatabase(user_id);
                return(listOfStudentDatabase);
            }
            catch (Exception ex)
            {
                CubitExceptionUtility.CubitExceptionLog(ex.Message + "BAL: Error while fetching student database details " + ex.StackTrace + " " + ex.InnerException, this.GetType().BaseType.Name.ToString(), DateTime.Now.ToLongTimeString(), DateTime.Now.ToLongDateString());
                throw ex;
            }
        }
Пример #15
0
 public IQueryable <HomeWorkUpload> getHomeworkSubmitedtoTeacher(int teacher_id)
 {
     try
     {
         IQueryable <HomeWorkUpload> listOfHomeWorkSubited = objUserInfoDAL.getHomeworkSubmitedtoTeacher(teacher_id);
         return(listOfHomeWorkSubited);
     }
     catch (Exception ex)
     {
         CubitExceptionUtility.CubitExceptionLog(ex.Message + "BAL: Error while fetching Post details " + ex.StackTrace + " " + ex.InnerException, this.GetType().BaseType.Name.ToString(), DateTime.Now.ToLongTimeString(), DateTime.Now.ToLongDateString());
         throw ex;
     }
 }
Пример #16
0
 public IQueryable <ReportCard> getStudentResult(int student_id, int institution_id, int class_id, int section_id)
 {
     try
     {
         IQueryable <ReportCard> lstofStudentResult = objUserInfoDAL.getStudentResult(student_id, institution_id, class_id, section_id);
         return(lstofStudentResult);
     }
     catch (Exception ex)
     {
         CubitExceptionUtility.CubitExceptionLog(ex.Message + "BAL: Error while fetching calender details " + ex.StackTrace + " " + ex.InnerException, this.GetType().BaseType.Name.ToString(), DateTime.Now.ToLongTimeString(), DateTime.Now.ToLongDateString());
         throw ex;
     }
 }
Пример #17
0
 public IQueryable <TimeTable> getTeacherTimeTable(int institution_id, string teacher_name)
 {
     try
     {
         IQueryable <TimeTable> lstOfTimeTable = objUserInfoDAL.getTeacherTimeTable(institution_id, teacher_name);
         return(lstOfTimeTable);
     }
     catch (Exception ex)
     {
         CubitExceptionUtility.CubitExceptionLog(ex.Message + "BAL: Error while fetching calender details " + ex.StackTrace + " " + ex.InnerException, this.GetType().BaseType.Name.ToString(), DateTime.Now.ToLongTimeString(), DateTime.Now.ToLongDateString());
         throw ex;
     }
 }
Пример #18
0
 public IQueryable <Post> getStudentAnnouncement(int student_user_id, int institution_user_id)
 {
     try
     {
         IQueryable <Post> listOfAnnouncement = objUserInfoDAL.getStudentAnnouncement(student_user_id, institution_user_id);
         return(listOfAnnouncement);
     }
     catch (Exception ex)
     {
         CubitExceptionUtility.CubitExceptionLog(ex.Message + "BAL: Error while fetching institution announcements to student details " + ex.StackTrace + " " + ex.InnerException, this.GetType().BaseType.Name.ToString(), DateTime.Now.ToLongTimeString(), DateTime.Now.ToLongDateString());
         throw ex;
     }
 }
Пример #19
0
 public IQueryable <Post> getSameClassFriePost(int user_id, int student_class)
 {
     try
     {
         IQueryable <Post> listOfPost = objUserInfoDAL.getSameClassFriePost(user_id, student_class);
         return(listOfPost);
     }
     catch (Exception ex)
     {
         CubitExceptionUtility.CubitExceptionLog(ex.Message + "BAL: Error while fetching Post details " + ex.StackTrace + " " + ex.InnerException, this.GetType().BaseType.Name.ToString(), DateTime.Now.ToLongTimeString(), DateTime.Now.ToLongDateString());
         throw ex;
     }
 }
Пример #20
0
        public List <city> getCity(int stateId)
        {
            List <city> objCity = new List <city>();

            try
            {
                objCity = objUserInfoDAL.getCity(stateId);
            }
            catch (Exception ex)
            {
                CubitExceptionUtility.CubitExceptionLog(ex.Message + "BAL: Error while calling List of cities in to the UserInfoDAL" + ex.StackTrace + " " + ex.InnerException, this.GetType().BaseType.Name.ToString(), DateTime.Now.ToLongTimeString(), DateTime.Now.ToLongDateString());
            }
            return(objCity);
        }
Пример #21
0
        public string updateHomeWork(HomeWork objHomeWork)
        {
            try
            {
                objUserInfoDAL.updateHomeWork(objHomeWork);
                return("Success UpDate Home Work Announce");
            }

            catch (Exception ex)
            {
                CubitExceptionUtility.CubitExceptionLog(ex.Message + "BAL: Error while update HomeWork Announce" + ex.StackTrace + " " + ex.InnerException, this.GetType().BaseType.Name.ToString(), DateTime.Now.ToLongTimeString(), DateTime.Now.ToLongDateString());
                return("Fail UpDate Home Work Announce");
            }
        }
Пример #22
0
        /*----------------------------------------------------------------------------MY SLATE-----------------------------------------------------*/

        /*------------------HOME WORK----------------*/
        public string addHomeWork(HomeWork homework)
        {
            try
            {
                homework.isactive = true;
                objUserInfoDAL.addHomeWork(homework);
                return("Success");
            }
            catch (Exception ex)
            {
                CubitExceptionUtility.CubitExceptionLog(ex.Message + "BAL: Error while Homework Announce" + ex.StackTrace + " " + ex.InnerException, this.GetType().BaseType.Name.ToString(), DateTime.Now.ToLongTimeString(), DateTime.Now.ToLongDateString());
                return("Error");
            }
        }
Пример #23
0
        public double getStudentPerformanceSameClass(int institution_id, int class_id, int section_id)
        {
            double average = 0;

            try
            {
                average = objUserInfoDAL.getStudentPerformanceSameClass(institution_id, class_id, section_id);
            }
            catch (Exception ex)
            {
                CubitExceptionUtility.CubitExceptionLog(ex.Message + "BAL: Error while get Student Performance Same Class" + ex.StackTrace + " " + ex.InnerException, this.GetType().BaseType.Name.ToString(), DateTime.Now.ToLongTimeString(), DateTime.Now.ToLongDateString());
            }
            return(average);
        }
Пример #24
0
        public List <state> getState(int countryId)
        {
            List <state> objState = new List <state>();

            try
            {
                objState = objUserInfoDAL.getState(countryId);
            }
            catch (Exception ex)
            {
                CubitExceptionUtility.CubitExceptionLog(ex.Message + "BAL: Error while calling list of state in to the UserInfoDAL" + ex.StackTrace + " " + ex.InnerException, this.GetType().BaseType.Name.ToString(), DateTime.Now.ToLongTimeString(), DateTime.Now.ToLongDateString());
            }
            return(objState);
        }
Пример #25
0
 public void sendGroupRequest(RequestStatus requestStatus)
 {
     try
     {
         requestStatus.request_status = Convert.ToInt16(EnumRequestStatus.requsetStatus.pending);
         requestStatus.request_crdate = DateTime.Now;
         //requestStatus.request_upddate=  ?
         objUserInfoDAL.sendGroupRequest(requestStatus);
     }
     catch (Exception ex)
     {
         CubitExceptionUtility.CubitExceptionLog(ex.Message + "BAL: Error while calling group request in to the UserInfoDAL" + ex.StackTrace + " " + ex.InnerException, this.GetType().BaseType.Name.ToString(), DateTime.Now.ToLongTimeString(), DateTime.Now.ToLongDateString());
     }
 }
Пример #26
0
        /*--------------------------------------------------------------------------LOGIN/AUTHENTICATION-----------------------------*/

        public void addAuthToken(Authtoken token)
        {
            try
            {
                //token_key
                //token_expiry
                token.crdate = DateTime.Now;
                objUserInfoDAL.saveAuthToken(token);
            }
            catch (Exception ex)
            {
                CubitExceptionUtility.CubitExceptionLog(ex.Message + "BAL: Error while passing authotication values in to the UserInfoDAL" + ex.StackTrace + " " + ex.InnerException, this.GetType().BaseType.Name.ToString(), DateTime.Now.ToLongTimeString(), DateTime.Now.ToLongDateString());
            }
        }
Пример #27
0
 public void updateTimeTable(PeriodTimeTable periodTimeTable)
 {
     try
     {
         if (periodTimeTable.institution_id == periodTimeTable.institution_id && periodTimeTable.createdby == periodTimeTable.createdby)
         {
             objUserInfoDAL.updateTimeTable(periodTimeTable);
         }
     }
     catch (Exception ex)
     {
         CubitExceptionUtility.CubitExceptionLog(ex.Message + "BAL: Error while updating TimeTable" + ex.StackTrace + " " + ex.InnerException, this.GetType().BaseType.Name.ToString(), DateTime.Now.ToLongTimeString(), DateTime.Now.ToLongDateString());
     }
 }
Пример #28
0
        public List <usergroup> getGroupMembers(UserGroup objUserInfo)
        {
            List <usergroup> objAdminGroup = new List <usergroup>();

            try
            {
                objUserInfoDAL.getGroupMembers(objUserInfo);
            }
            catch (Exception ex)
            {
                CubitExceptionUtility.CubitExceptionLog(ex.Message + "BAL: Error while getting user group list " + ex.StackTrace + " " + ex.InnerException, this.GetType().BaseType.Name.ToString(), DateTime.Now.ToLongTimeString(), DateTime.Now.ToLongDateString());
            }
            return(objAdminGroup);
        }
Пример #29
0
        /*------------------------------------------------------------------------------VALIDATIONS---------------------------------------------*/

        public bool getEmailValidate(string inputEmail)
        {
            bool boolvalue = false;

            try
            {
                boolvalue = objUserInfoDAL.getEmailValidate(inputEmail);
            }
            catch (Exception ex)
            {
                CubitExceptionUtility.CubitExceptionLog(ex.Message + "BAL: Error while validating email" + ex.StackTrace + " " + ex.InnerException, this.GetType().BaseType.Name.ToString(), DateTime.Now.ToLongTimeString(), DateTime.Now.ToLongDateString());
            }
            return(boolvalue);
        }
Пример #30
0
        public List <eventpost> getUserEvents(int user_type)
        {
            List <eventpost> objEventPost = new List <eventpost>();

            try
            {
                objEventPost = objUserInfoDAL.getUserEvents(user_type);
            }
            catch (Exception ex)
            {
                CubitExceptionUtility.CubitExceptionLog(ex.Message + "BAL: Error while getting user group list " + ex.StackTrace + " " + ex.InnerException, this.GetType().BaseType.Name.ToString(), DateTime.Now.ToLongTimeString(), DateTime.Now.ToLongDateString());
            }
            return(objEventPost);
        }