Exemplo n.º 1
0
        public ActionResult EditVizier(int id)
        {
            var entity = _contactsRepository.GetById(id);

            if (entity.Id <= 0)
            {
                return(ErrorResult(HttpStatusCode.NotFound));
            }

            var model = Mapper.Map <ContactViewModel>(entity);

            model = BuildModel(model);

            model.ViewMode = ContactViewModes.Vizier;


            IEnumerable <VizierType> vvtype = VizierType.GetAll();

            model.VizierTypeSelect = new SelectList(
                vvtype
                , "Name" // Id
                , "Name");


            return(View("ManagerVizier", model));
        }
Exemplo n.º 2
0
        public ActionResult Add()
        {
            var model = new ContactViewModel();

            model = BuildModel(model);

            model.Type = ContactType.Company;

            IEnumerable <VizierType> vvtype = VizierType.GetAll();

            model.VizierTypeSelect = new SelectList(
                vvtype
                , "Name" // Id
                , "Name");


            return(View("Manager", model));
        }
Exemplo n.º 3
0
        public ActionResult Modal(ContactType contactType = ContactType.General, ContactViewModes viewMode = ContactViewModes.Full, bool enableTypeModification = false)
        {
            var model = new ContactViewModel()
            {
                Type     = contactType,
                ViewMode = viewMode,
                EnableTypeModification = enableTypeModification
            };

            model = BuildModel(model);

            IEnumerable <VizierType> vvtype = VizierType.GetAll();

            model.VizierTypeSelect = new SelectList(
                vvtype
                , "Name" // Id
                , "Name");

            return(PartialView(model));
        }
Exemplo n.º 4
0
        public ActionResult AddVizier(ContactViewModes viewMode = ContactViewModes.Vizier, bool enableTypeModification = true)
        {
            var model = new ContactViewModel()
            {
                //Type = contactType,
                ViewMode = viewMode,
                EnableTypeModification = enableTypeModification
            };

            model = BuildModel(model);

            model.Type = ContactType.VizierUMTOP;

            IEnumerable <VizierType> vvtype = VizierType.GetAll();

            model.VizierTypeSelect = new SelectList(
                vvtype
                , "Name" // Id
                , "Name");



            return(View("ManagerVizier", model));
        }