protected override bool AcceptCreate(BL.BaseManager manager) { Ad adImage = new Ad(); UCFormAd.PopulateModel(adImage); return(((AdImageManager)manager).Save(adImage)); }
protected override bool AcceptCreate(BL.BaseManager manager) { Map map = new Map(); UCFormMap.PopulateModel(map); return(((MapManager)manager).Save(map)); }
protected override bool AcceptModify(BL.BaseManager manager, int id) { Map map = ((MapManager)manager).Get(id); UCFormMap.PopulateModel(map); return(((MapManager)manager).Edit(map)); }
protected override bool AcceptModify(BL.BaseManager manager, int id) { User user = ((UserManager)manager).Get(id); UCFormNewMember.PopulateModel(user); return(((UserManager)manager).Edit(user)); }
protected override bool AcceptModify(BL.BaseManager manager, int id) { Poll poll = ((PollManager)manager).Get(id); UCFormPoll.PopulateModel(poll); return(((PollManager)manager).Edit(poll)); }
protected override bool AcceptModify(BL.BaseManager manager, int id) { Category category = ((CategoryManager)manager).Get(id); UCFormCategory.PopulateModel(category); return(((CategoryManager)manager).Edit(category)); }
protected override bool AcceptCreate(BL.BaseManager manager) { Poll poll = new Poll(); UCFormPoll.PopulateModel(poll); return(((PollManager)manager).Save(poll)); }
protected override bool AcceptCreate(BL.BaseManager manager) { Category category = new Category(); UCFormCategory.PopulateModel(category); return(((CategoryManager)manager).Save(category)); }
protected override bool AcceptModify(BL.BaseManager manager, int id) { News news = ((NewsManager)manager).Get(id); UCFormNews.PopulateModel(news); return(((NewsManager)manager).Edit(news)); }
protected override bool AcceptCreate(BL.BaseManager manager) { News news = new News(); UCFormNews.PopulateModel(news); return(((NewsManager)manager).Save(news)); }
protected override bool AcceptModify(BL.BaseManager manager, int id) { Role role = ((RoleManager)manager).Get(id); UCFormRolePermission.PopulateModel(role); role.Permissions = RetrievePermissionFromSession("granted"); return(((RoleManager)manager).Edit(role)); }
protected override bool AcceptCreate(BL.BaseManager manager) { Role role = new Role(); UCFormRolePermission.PopulateModel(role); role.Permissions = RetrievePermissionFromSession("granted"); return(((RoleManager)manager).Save(role)); }
protected override bool AcceptModify(BL.BaseManager manager, int id) { RoleManager roleManager = new RoleManager(); User user = ((UserManager)manager).Get(id); if (user == null && manager.HasErrors) { return(false); } user.Roles = RetrieveFromSession("granted"); bool success = roleManager.EditRoleForUser(user); if (!success && roleManager.HasErrors) { Alert.Show("Error", roleManager.ErrorDescription); } return(success); }
protected override bool AcceptCreate(BL.BaseManager manager) { User user = new User(); UCFormNewMember.PopulateModel(user); //TODO - LA VALIDACIÓN DEL PASSWORD Y LA REPETICIÓN, DEBERÍA HACERSE POR FRONT //Por otro lado, notar que como está el break, el mensaje no se muestra y debe implementarse un workaround bool success = true; if (IsValidForSave()) { user.Password = SecurityHelper.Encrypt(user.Password); success = ((UserManager)manager).Save(user); } else { success = false; Alert.Show("Error", "El password y su verificación, deben coincidir."); } return(success); }
protected virtual bool AcceptModify(BL.BaseManager manager, int id) { return(true); }
protected virtual bool AcceptCreate(BL.BaseManager manager) { return(true); }