コード例 #1
0
        public ActionResult Editar(string id)
        {
            EducationLevelBL oBL = new EducationLevelBL();
            int pIntID           = 0;

            int.TryParse(id, out pIntID);
            EducationLevelViewModel pEducationLevelViewModel = oBL.Obtener(pIntID);

            return(View(pEducationLevelViewModel));
        }
コード例 #2
0
        public void Modificar(EducationLevelViewModel pEducationLevelViewModel)
        {
            education_levels oeducation_levels = oRepositorio.FindById(pEducationLevelViewModel.education_level_id);

            oeducation_levels.name = pEducationLevelViewModel.name;

            oeducation_levels.user_id_modified = pEducationLevelViewModel.user_id_modified;

            oeducation_levels.date_modified = DateTime.Now;
            oRepositorio.Update(oeducation_levels);
            oUnitOfWork.SaveChanges();
        }
コード例 #3
0
        public void Agregar(EducationLevelViewModel pEducationLevelViewModel)
        {
            education_levels oeducation_levels = new education_levels
            {
                education_level_id = 0,
                name            = pEducationLevelViewModel.name,
                date_created    = DateTime.Now,
                user_id_created = pEducationLevelViewModel.user_id_created
            };

            oRepositorio.Add(oeducation_levels);
            oUnitOfWork.SaveChanges();
        }
コード例 #4
0
        public ActionResult Editar([Bind(Include = "education_level_id,name")] EducationLevelViewModel pEducationLevelViewModel)
        {
            // TODO: Add insert logic here

            if (pEducationLevelViewModel == null)
            {
                return(HttpNotFound());
            }
            EducationLevelBL oEducationLevelBL = new EducationLevelBL();

            pEducationLevelViewModel.user_id_modified = AuthorizeUserAttribute.UsuarioLogeado().user_id;
            oEducationLevelBL.Modificar(pEducationLevelViewModel);
            return(RedirectToAction("Index"));
        }
コード例 #5
0
        public ActionResult Crear([Bind(Include = "education_level_id,name")] EducationLevelViewModel pEducationLevelViewModel)
        {
            // TODO: Add insert logic here

            if (pEducationLevelViewModel == null)
            {
                return(HttpNotFound());
            }
            pEducationLevelViewModel.education_level_id = 0;
            pEducationLevelViewModel.user_id_created    = AuthorizeUserAttribute.UsuarioLogeado().user_id;

            EducationLevelBL oBL = new EducationLevelBL();

            oBL.Agregar(pEducationLevelViewModel);
            return(RedirectToAction("Index"));
        }