示例#1
0
        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);
            }
        }
示例#2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Row EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToRow(Row row)
 {
     base.AddObject("Row", row);
 }
示例#3
0
 /// <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;
 }
示例#4
0
 public void AddModuleEntry(int _moduleId, Row _entry)
 {
     throw new NotImplementedException();
 }