예제 #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));
        }
예제 #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));
        }
예제 #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));
        }
예제 #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));
        }