using DocumentFormat.OpenXml.Packaging;
using System;
using DocumentFormat.OpenXml;
using DocumentFormat.OpenXml.Spreadsheet;
namespace ExcelImport
{
public class ProjectEstimatesImport
{
private const string pkname = "CF_РТК";
private const string rtk = "ПК_РТК";
private const string importData = "Лист импорта данных";
public ProjectEstimatesImport(string fileName)
{
using (SpreadsheetDocument mySpreadsheet = SpreadsheetDocument.Open(fileName, false))
{
var sheets = mySpreadsheet.WorkbookPart.Workbook.Sheets;
foreach (Sheets sheet in sheets)
{
foreach (var attr in sheet.GetAttributes())
{
if (attr.Value == pkname)
{
;
}
else if (attr.Value == rtk)
{
;
}
else if (attr.Value == importData)
{
;
}
Console.WriteLine("{0}: {1}", attr.LocalName, attr.Value);
}
}
}
}
public object Result { get; private set; }
}
}
if(text === 'Магазин'){
man = connection.query('SELECT * FROM `products`', function(error,results){
if(error) {throw error}
for (let i in results) {
bot.sendMessage(chatId, `Продукты: \nИмя: ${results[i]['name']} Цена: ${results[i]['price']}`);
bot.sendMessage(chatId, results[i]['name']);
}
});
}