예제 #1
0
        public int Delete(Subject entity)
        {
            int i = 0;

            string[] addParams = { Subject_Constant.SUBJECTID };
            i = _SubjectRepository.ExecuteNonQuery(entity, addParams, Subject_Constant.SPROC_SUBJECTMST_DEL);

            return i;
        }
예제 #2
0
        public int AddEdit(Subject entity)
        {
            int i = 0;

            User objUser = null;
            if (eSchoolSession.IsInSession(SessionKeys.CurrentUser))
                objUser = (User)eSchoolSession.GetDirectValue(SessionKeys.CurrentUser);

            if (string.IsNullOrEmpty(entity.SubjectID))
            {
                entity.SubjectID = Utility.GeneratorUniqueId(ID_PREFIX_CONSTANTS.SUBJECT_ID_PREFIX);

                if (objUser != null && !string.IsNullOrEmpty(objUser.UserID))
                {
                    entity.CreatedByID = objUser.UserID;
                    entity.ModifiedByID = objUser.UserID;
                }
                else
                {
                    entity.CreatedByID = "1";
                    entity.ModifiedByID = "1";
                }
            }
            else
            {
                if (objUser != null && !string.IsNullOrEmpty(objUser.UserID))
                    entity.ModifiedByID = objUser.UserID;
                else
                    entity.ModifiedByID = "1";
            }

            entity.DateCreated = DateTime.Now;
            entity.DateModified = DateTime.Now;

            string[] addParams = { Subject_Constant.SUBJECTID,
                                    Subject_Constant.SUBJECTNAME,
                                    Subject_Constant.SUBJECTCODE,
                                    Subject_Constant.ISFORPRIMARY,
                                    Subject_Constant.ISFORSECONDARY,
                                    Subject_Constant.ISACTIVE,
                                    BaseEntity_Constant.CREATED_BY_ID,
                                    BaseEntity_Constant.MODIFIED_BY_ID
                                };

            i = _SubjectRepository.ExecuteNonQuery(entity, addParams, Subject_Constant.SPROC_SUBJECTMST_UPS);

            return i;
        }
예제 #3
0
        public IEnumerable<Subject> GetAll(Subject entity)
        {
            User objUser = null;
            if (eSchoolSession.IsInSession(SessionKeys.CurrentUser))
                objUser = (User)eSchoolSession.GetDirectValue(SessionKeys.CurrentUser);

            string[] addParams = { Constants.PAGEINDEX, Constants.PAGESIZE, Constants.SORTEXP, Subject_Constant.SUBJECTNAME, Subject_Constant.SUBJECTCODE};
            return _SubjectRepository.GetAll(entity, addParams, Subject_Constant.SPROC_SUBJECTMST_LSTALL);
        }
예제 #4
0
 public Subject Get(Subject entity)
 {
     string[] addParams = { Subject_Constant.SUBJECTID };
     return _SubjectRepository.Get(entity, addParams, Subject_Constant.SPROC_SUBJECTMST_SEL);
 }
예제 #5
0
        public List<Subject> GetTeacherSubjects(Subject entity)
        {
            string[] addParams = new string[] { Subject_Constant.TEACHERID, BaseEntity_Constant.SCHOOL_ID};

            return _SubjectRepository.GetAll(entity, addParams, Subject_Constant.SPROC_GETTEACHERSUBJECTS).ToList();
        }
예제 #6
0
 public object GetScalar(Subject entity)
 {
     throw new NotImplementedException();
 }
예제 #7
0
        public IEnumerable<Subject> GetAllForLookup(Subject entity)
        {
            User objUser = null;
            if (eSchoolSession.IsInSession(SessionKeys.CurrentUser))
                objUser = (User)eSchoolSession.GetDirectValue(SessionKeys.CurrentUser);

            string[] addParams = {  };
            return _SubjectRepository.GetAll(entity, addParams, Subject_Constant.SPROC_SUBJECTMST_LSTALL_FOR_LOOKUP);
        }