internal static ResponseEnvelope CreateEntity(InputFieldConfigurationDataModel model) { InputFieldConfiguration entity = model.ConvertToEntity(); entity.DateCreated = DateTime.Now; entity.DateLastModified = DateTime.Now; return(InputFieldConfigurationManager.Create(entity)); }
internal static ResponseEnvelope DeleteEntity(InputFieldConfigurationDataModel model) { if (model == null) { return(new ResponseEnvelope(new Exception("Parameter 'model' is empty"))); } InputFieldConfiguration entity = InputFieldConfigurationManager.GetEntityFromGuid(model.Id); return(InputFieldConfigurationManager.Delete(entity)); }
internal static void UpdateFromModel(this InputFieldConfiguration entity, InputFieldConfigurationDataModel model) { entity.Id = model.Id; entity.ControlType = model.ControlType; entity.DataType = model.DataType; entity.IsRequired = model.IsRequired; entity.LabelName = model.LabelName; entity.MaxLength = model.MaxLength; entity.ToolTip = model.ToolTip; entity.ValidationRule = model.ValidationRule; }
internal static ResponseEnvelope UpdateEntity(InputFieldConfigurationDataModel model) { if (model == null) { return(new ResponseEnvelope(new Exception("Parameter 'model' is empty"))); } InputFieldConfiguration entity = InputFieldConfigurationManager.GetEntityFromGuid(model.Id); entity.UpdateFromModel(model); entity.DateLastModified = DateTime.Now; return(InputFieldConfigurationManager.Update()); }
internal static InputFieldConfiguration ConvertToEntity(this InputFieldConfigurationDataModel model) { return(new InputFieldConfiguration() { Id = model.Id, ControlType = model.ControlType, DataType = model.DataType, IsRequired = model.IsRequired, LabelName = model.LabelName, MaxLength = model.MaxLength, ToolTip = model.ToolTip, ValidationRule = model.ValidationRule }); }