Exemplo n.º 1
0
        public ActionResult AppendToModelProcessStart(BlockModelAppendViewModel m)
        {
            // get the currently mapped model columns
            List <string> columnNames = BlockModelService.GetImportFileColumnsAsList(m.BlockModelID, m.FileName, m.BlockModelAlias);
            SelectList    sl          = new SelectList(columnNames);

            // get the next available column in the database to write update to, requires a search in the meta data for column names
            m.FileColumnNames = sl;
            return(View(m));
        }
Exemplo n.º 2
0
        public ActionResult AppendToModelProcessGo(BlockModelAppendViewModel m)
        {
            // Call into the block model library to append the given column using the column map provided.
            // this will attempt to match the BlockModelID of target model, and XC, YC and ZC  coordinates of every record and insert the value
            List <string> columnNames      = BlockModelService.GetImportFileColumnsAsList(m.BlockModelID, m.FileName, m.BlockModelAlias);
            string        columnToAdd      = columnNames[3];
            int           columnIndexToAdd = 3;

            BlockModelService.AppendModelAsync(m.BlockModelID, m.FileName, m.BlockModelAlias, columnToAdd, columnIndexToAdd, getCurrentUserID(), 60);
            return(View(m));
        }
Exemplo n.º 3
0
 public BlockModelAppendViewModel GetBlockModelToAppend(Guid modelID)
 {
     using (new TransactionScope(TransactionScopeOption.Suppress))
     {
         var d = new NKDC(_users.ApplicationConnectionString, null);
         var b = (d.BlockModels.OrderByDescending(x => x.Version).FirstOrDefault(x => x.BlockModelID == modelID));
         var m = new BlockModelAppendViewModel
         {
             BlockModelAlias = b.Alias,
             Version         = (b.Version + 1),
             BlockModelID    = modelID,
             FileNames       = this.GetUpdatedModelList()
         };
         return(m);
     }
 }