public string SelectData(Table table) { ReadRequest req = new ReadRequest(); try { req.Entity = Connection.RunFetch(table.Name); } catch (Exception e) { req.Exception = e.Message; } Connection.Disconnect(); return(js.Serialize(req)); }
public string ReadData(Table table) { ReadRequest req = new ReadRequest(); try { /*Перечисляем поля для Fetch запроса*/ String fields = String.Empty; foreach (Field field in table.Fields) { fields = fields + "<attribute name='" + field.Caption + "' />"; } /*Формируем ответ на запрос*/ req.Entity = Connection.RunFetch(table.Name, table.Id.Value, table.Id.Name, fields); } /*Обработка ошибок*/ catch (Exception e) { req.Exception = e.Message; } Connection.Disconnect(); return(js.Serialize(req)); }