Example #1
0
        public EducationProgramListResponse addEducationProgram(EducationProgram educationProgram)
        {
            EducationProgramListResponse response = new EducationProgramListResponse();
            QuestionProjeEntities        db       = new QuestionProjeEntities();

            try
            {
                db.EducationProgram.Add(educationProgram);
                db.SaveChanges();
                response.educationPrograms.Add(educationProgram);
            }
            catch (Exception ex)
            {
                //bir hata olursa response set edilsin
                Helper.setErrorToResponse(Constant.ERRORCODE.SYS_SYSTEM_ERROR, response);
                return(response);
            }

            //başarılı olduğu response a set edilsin
            Helper.setErrorToResponse(Constant.ERRORCODE.SYS_SUCCESS, response);
            return(response);
        }
Example #2
0
        public EducationProgramListResponse getEducationProgramAll()
        {
            EducationProgramListResponse response = new EducationProgramListResponse();
            QuestionProjeEntities        db       = new QuestionProjeEntities();

            db.Configuration.ProxyCreationEnabled = false;
            try
            {
                response.educationPrograms = db.EducationProgram
                                             .Where(r => r.State == true).ToList();
            }
            catch (Exception ex)
            {
                //bir hata olursa response set edilsin
                Helper.setErrorToResponse(Constant.ERRORCODE.SYS_SYSTEM_ERROR, response);
                return(response);
            }


            //başarılı olduğu response a set edilsin
            Helper.setErrorToResponse(Constant.ERRORCODE.SYS_SUCCESS, response);
            return(response);
        }
Example #3
0
        public EducationProgramListResponse deleteEducationProgram(int ID)
        {
            EducationProgramListResponse response = new EducationProgramListResponse();
            QuestionProjeEntities        db       = new QuestionProjeEntities();

            try
            {
                db.Configuration.ProxyCreationEnabled = false;
                EducationProgram educationProgram = db.EducationProgram.Where(r => r.ID == ID).SingleOrDefault();
                educationProgram.State = false;
                db.SaveChanges();
                response.educationPrograms.Add(educationProgram);
            }
            catch (Exception ex)
            {
                //bir hata olursa response set edilsin
                Helper.setErrorToResponse(Constant.ERRORCODE.SYS_SYSTEM_ERROR, response);
                return(response);
            }

            //başarılı olduğu response a set edilsin
            Helper.setErrorToResponse(Constant.ERRORCODE.SYS_SUCCESS, response);
            return(response);
        }