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; }
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; }
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); }
public Subject Get(Subject entity) { string[] addParams = { Subject_Constant.SUBJECTID }; return _SubjectRepository.Get(entity, addParams, Subject_Constant.SPROC_SUBJECTMST_SEL); }
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(); }
public object GetScalar(Subject entity) { throw new NotImplementedException(); }
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); }