Пример #1
0
        public int AddEdit(ClassSubjects entity)
        {
            User objUser = null;
            if (eSchoolSession.IsInSession(SessionKeys.CurrentUser))
                objUser = (User)eSchoolSession.GetDirectValue(SessionKeys.CurrentUser);

            if (entity != null && string.IsNullOrEmpty(entity.SchoolID))
            {
                if (objUser != null && !string.IsNullOrEmpty(objUser.SchoolID))
                    entity.SchoolID = objUser.SchoolID;
            }

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

            string[] addParams = new string[] { ClassSubjects_Constant.CLASS_SUBJECT_ID, ClassSubjects_Constant.CLASS_ID, ClassSubjects_Constant.SUBJECT_ID, ClassSubjects_Constant.CREATED_BY_ID, ClassSubjects_Constant.MODIFIED_BY_ID };

            return _IClassSubjectsRepository.ExecuteNonQuery(entity, addParams, ClassSubjects_Constant.SPROC_CLASSSUBJECTS_UPS);
        }
Пример #2
0
        public ActionResult AddEditClassSubjects(ClassListViewModel model)
        {
            _IClassSubjectsService.DeleteAllClassSubjects(new ClassSubjects() { ClassID = model.ClassSubjects.ClassID });

            string[] csvSubjects = model.ClassSubjects.Subjects.Split(',');

            foreach (string singleSubject in csvSubjects)
            {
                if (string.IsNullOrEmpty(singleSubject))
                    continue;

                ClassSubjects obj = new ClassSubjects();
                obj.SubjectID = singleSubject.Trim();
                obj.ClassID = model.ClassSubjects.ClassID;
                obj.ClassSubjectID = Utility.GeneratorUniqueId("CLSSUB_");
                _IClassSubjectsService.AddEdit(obj);
            }

            return RedirectToAction("ManageClassSubjects", "Class");
        }
Пример #3
0
 public object GetScalar(ClassSubjects obj)
 {
     throw new NotImplementedException();
 }
Пример #4
0
 public IEnumerable<ClassSubjects> GetAll(ClassSubjects entity)
 {
     string[] addParams = new string[] { ClassSubjects_Constant.CLASSNAME, ClassSubjects_Constant.CLASS_ID };
     return _IClassSubjectsRepository.GetAll(entity, addParams, ClassSubjects_Constant.SPROC_CLASSSUBJECTS_GETALL);
 }
Пример #5
0
 public ClassSubjects Get(ClassSubjects obj)
 {
     throw new NotImplementedException();
 }
Пример #6
0
 public int DeleteAllClassSubjects(ClassSubjects entity)
 {
     string[] addParams = new string[] { ClassSubjects_Constant.CLASS_ID};
     return _IClassSubjectsRepository.ExecuteNonQuery(entity, addParams, ClassSubjects_Constant.SPROC_DELETEALLCLASSSUBJECTS);
 }
Пример #7
0
 public int Delete(ClassSubjects entity)
 {
     throw new NotImplementedException();
 }