예제 #1
0
        // GET api/<controller>
        public EducationLevelListModel Get(int page, int rows)
        {
            int totalRecords;
            var model = new EducationLevelListModel
            {
                Rows    = EducationLevelRepository.Search(string.Empty, page, rows, out totalRecords),
                Page    = page,
                Total   = (totalRecords / rows) + 1,
                Records = rows
            };

            return(model);
        }
예제 #2
0
        public ActionResult Create(FormCollection collection)
        {
            try
            {
                // TODO: Add insert logic here
                try
                {
                    //fill business object
                    var info = new EducationLevelInfo();

                    /*
                     *
                     *
                     * info.EducationLevelId = collection["EducationLevelId"];
                     *
                     *
                     *
                     * info.Name = collection["Name"];
                     *
                     *
                     *
                     *
                     * info.Description = collection["Description"];
                     *
                     *
                     *
                     *
                     *
                     * info.CreatedBy = collection["CreatedBy"];
                     *
                     *
                     *
                     *
                     *
                     *
                     *
                     *
                     */
                    EducationLevelRepository.Create(info);
                }
                catch (Exception ex)
                {
                }
                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
예제 #3
0
        public string Edit(FormDataCollection form)
        {
            var retVal      = string.Empty;
            var operation   = form.Get("oper");
            var id          = ConvertHelper.ToInt32(form.Get("EducationLevelId"));
            var curUserInfo = UserRepository.GetCurrentUserInfo();

            if (!string.IsNullOrEmpty(operation))
            {
                EducationLevelInfo info = null;
                switch (operation)
                {
                case "edit":
                    info = EducationLevelRepository.GetInfo(id);
                    if (info != null)
                    {
                        info.Name        = form.Get("Name");
                        info.Description = form.Get("Description");
                        EducationLevelRepository.Update(info);
                    }
                    break;

                case "add":
                    info = new EducationLevelInfo
                    {
                        Name        = form.Get("Name"),
                        Description = form.Get("Description"),
                        CreatedBy   = curUserInfo.UserID,
                        CreatedDate = DateTime.Now
                    };
                    EducationLevelRepository.Create(info);
                    break;

                case "del":
                    EducationLevelRepository.Delete(id);
                    break;
                }
            }
            //StoreData.ListEducationLevel = EducationLevelRepository.GetAll();
            return(retVal);
        }
예제 #4
0
파일: UnitOfWork.cs 프로젝트: alonsodev/SSR
 public void Dispose()
 {
     this._userRepository               = null;
     this._permissionRepository         = null;
     this._roleRepository               = null;
     this._rolePermissionRepository     = null;
     this._investigatorRepository       = null;
     this._institutionRepository        = null;
     this._interestAreaRepository       = null;
     this._programRepository            = null;
     this._investigationGroupRepository = null;
     this._commissionRepository         = null;
     this._draftLawRepository           = null;
     this._conceptRepository            = null;
     this._badLanguageRepository        = null;
     this._tagRepository = null;
     this._conceptStatusLogRepository       = null;
     this._debateSpeakerRepository          = null;
     this._educationalInstitutionRepository = null;
     this._knowledgeAreaRepository          = null;
     this._academicLevelRepository          = null;
     this._educationLevelRepository         = null;
     this._snieRepository                     = null;
     this._meritRangeRepository               = null;
     this._investigatorCommissionRepository   = null;
     this._investigatorInterestAreaRepository = null;
     this._configurationRepository            = null;
     this._notificationRepository             = null;
     this._conceptDebateSpeakerRepository     = null;
     this._consultationRepository             = null;
     this._consultationInterestAreaRepository = null;
     this._draftLawStatusRepository           = null;
     this._periodRepository                   = null;
     this._originRepository                   = null;
     this._userInstitutionRepository          = null;
     this._consultationTypeRepository         = null;
     this._reasonRejectRepository             = null;
     _context.Dispose();
 }
예제 #5
0
 // GET api/<controller>/5
 public EducationLevelInfo Get(int id)
 {
     return(EducationLevelRepository.GetInfo(id));
 }
예제 #6
0
 // GET api/<controller>
 public IEnumerable <EducationLevelInfo> Get()
 {
     return(EducationLevelRepository.GetAll());
 }
예제 #7
0
 public EducationLevelBL()
 {
     oUnitOfWork  = new UnitOfWork(ConfigurationManager.ConnectionStrings["SSREntities"].ConnectionString);
     oRepositorio = oUnitOfWork.EducationLevelRepository;
 }