internal static FormFields MapFormFieldDbModel(FormFieldModel model) { FormFields formField = new FormFields() { ClassName = model.ClassName, FormId = model.FormId, Id = model.Id, IsRequired = model.IsRequired, Label = model.Label, Type = model.Type, CanMultiply = model.CanMultiply }; if(model.Options.Count > 0) { formField.FormFieldsOptions = new List<FormFieldsOptions>(); foreach (var option in model.Options) { formField.FormFieldsOptions.Add(MapFormFieldOption(option)); } } return formField; }
public HttpResponseMessage SaveFormFieldItem(FormFieldModel formField) { HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK); FormsAdminBLL.SaveFormFieldItem(FormFieldModel.MapFormFieldDbModel(formField)); return response; }
internal static FormFieldModel MapFormFieldModel(FormFields formField) { FormFieldModel model = new FormFieldModel() { ClassName = formField.ClassName, FormId = formField.FormId, Id = formField.Id, IsRequired = formField.IsRequired, Label = formField.Label, Type = formField.Type, CanMultiply = formField.CanMultiply }; formField.FormFieldsOptions.ToList().ForEach(f => model.Options.Add(FormFieldOptionModel.MapFormFieldOptionModel(f))); return model; }