public ResponseObjectPackage<List<ControlProperty>> GetControlPropertiesByFormID(int formID) { RequestPackage request = new RequestPackage() { requestID = formID }; List<ControlPropertyViewModel> properties = new DBUtils().RunSqlAction(new ControlPropertiesRepository().GetPropertiesByFormID, request).GetDataOrExceptionIfError(); List<ControlProperty> propertiesList = properties.Select(e => new ControlProperty() { controlID = e.controlID, controlPropertyTypeID = e.controlPropertyTypeID, domainValueTypeID = e.DOMAIN_VALUE_TYPE_ID_LOGIC, ID = e.ID, name = e.property, value = ValueTypesConverter.Initialize(e.value, e.logicValueTypeID, true) } ).ToList(); ResponseObjectPackage<List<ControlProperty>> response = new ResponseObjectPackage<List<ControlProperty>>() { resultData = propertiesList }; return response; }
public ResponseObjectPackage<List<Control>> GetControlsByFormID(int formID) { RequestPackage request = new RequestPackage() { requestID = formID }; List<ControlListEntity> controls = new DBUtils().RunSqlAction(new ControlsRepository().GetControlsByFormID, request).GetDataOrExceptionIfError(); List<Control> controlsList = controls.Select(e => new Control() { children = new List<Control>(), controlDictionaryMappings = new List<ControlDictionaryMappingModel>(), controlIDParent = e.controlIDParent, controlQueryMappings = new List<ControlQueryMappingModel>(), controlTypeID = e.controlTypeID, formID = e.formID, ID = e.ID, orderNumber = e.orderNumber, properties = new List<ControlProperty>() } ).ToList(); ResponseObjectPackage<List<Control>> response = new ResponseObjectPackage<List<Control>>() { resultData = controlsList }; return response; }