Ejemplo n.º 1
0
 private void AssignGuid(Grid grid, Guid guid, Schema instanceSchema, int run, string nickName)
 {
     Entity entity = null;
     try
     {
         entity = grid.GetEntity(instanceSchema);
     }
     catch (Exception ex)
     {
         Debug.Write("Error", ex.Message);
     }
     try
     {
         if (!entity.IsValid())
         {
             entity = new Entity(instanceSchema);
         }
         Field field = instanceSchema.GetField("InstanceID");
         entity.Set<string>(field, guid.ToString());
         field = instanceSchema.GetField("RunID");
         entity.Set<int>(field, run);
         field = instanceSchema.GetField("NickName");
         entity.Set<string>(field, nickName);
         grid.SetEntity(entity);
     }
     catch (Exception ex)
     {
         TaskDialog.Show("Error", ex.Message);
     }
 }