Beispiel #1
0
        public HttpResponseMessage GetCustomFieldTabs(int accountId)
        {
            GetAllCustomFieldTabsRequest  request  = new GetAllCustomFieldTabsRequest(accountId);
            GetAllCustomFieldTabsResponse response = customFieldService.GetAllCustomFieldTabs(request);

            return(Request.BuildResponse(response));
        }
        public ActionResult CustomFields()
        {
            ViewBag.AccountId = this.Identity.ToAccountID();
            GetAllCustomFieldTabsRequest    request     = new GetAllCustomFieldTabsRequest(ViewBag.AccountId);
            GetAllCustomFieldTabsResponse   response    = customFieldService.GetAllCustomFieldTabs(request);
            CustomFieldValueOptionViewModel valueOption = new CustomFieldValueOptionViewModel()
            {
                CustomFieldId            = 0,
                CustomFieldValueOptionId = 0,
                IsDeleted = false,
                Value     = "",
                Order     = 0
            };
            CustomFieldViewModel fieldViewModel = new CustomFieldViewModel()
            {
                AccountID        = this.Identity.ToAccountID(),
                FieldInputTypeId = FieldType.text,
                IsMandatory      = false,
                SortId           = 0,
                StatusId         = FieldStatus.Active,
                Title            = "New Field",
                ValueOptions     = new List <CustomFieldValueOptionViewModel>()
            };
            CustomFieldSectionViewModel section = new CustomFieldSectionViewModel()
            {
                CustomFields = new List <CustomFieldViewModel>(),
                Name         = "New Section"
            };
            CustomFieldTabViewModel tab = new CustomFieldTabViewModel()
            {
                Sections  = new List <CustomFieldSectionViewModel>(),
                Name      = "New Tab",
                AccountId = this.Identity.ToAccountID()
            };

            response.CustomFieldsViewModel.TabTemplate         = tab;
            response.CustomFieldsViewModel.SectionTemplate     = section;
            response.CustomFieldsViewModel.CustomFieldTemplate = fieldViewModel;
            response.CustomFieldsViewModel.ValueOptionTemplate = valueOption;
            return(View("AddEditCustomFields", response.CustomFieldsViewModel));
        }