public void CreateModule(IModule _dbModule, DynamicModuleViewModel _moduleData) { var row = new Row() { Module = (Module)_dbModule }; foreach (DynamicModuleField field in _moduleData.Fields) { var converter = FieldValueConversion.GetConverter(field.DataType); var rowField = new Cell { Field = _dbModule.Fields.FirstOrDefault(f => f.FieldName == field.PropertyName), Data = converter.Serialize(field, new ConversionContext { Cell = null }) }; row.Cells.Add(rowField); } try { ModRepository.AddModuleEntry(_dbModule.Id, row); } catch (Exception e) { throw new CreateModuleFailedException("Ocorreu um erro ao incluir o seu registro. Tente novamente mais tarde.", e); } }
/// <summary> /// Deprecated Method for adding a new object to the Row EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToRow(Row row) { base.AddObject("Row", row); }
/// <summary> /// Create a new Row object. /// </summary> /// <param name="id">Initial value of the ID property.</param> public static Row CreateRow(global::System.Int32 id) { Row row = new Row(); row.ID = id; return row; }
public void AddModuleEntry(int _moduleId, Row _entry) { throw new NotImplementedException(); }