2021-12-05 16:55:36 +03:00
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
using ExcelDna.Integration.CustomUI;
|
2021-12-07 08:28:21 +03:00
|
|
|
|
using Rehau.Sku.Assist;
|
2021-12-05 16:55:36 +03:00
|
|
|
|
|
|
|
|
|
namespace Ribbon
|
|
|
|
|
{
|
|
|
|
|
[ComVisible(true)]
|
|
|
|
|
public class RibbonController : ExcelRibbon
|
|
|
|
|
{
|
|
|
|
|
public override string GetCustomUI(string RibbonID)
|
|
|
|
|
{
|
|
|
|
|
return @"
|
|
|
|
|
<customUI xmlns='http://schemas.microsoft.com/office/2006/01/customui'>
|
|
|
|
|
<ribbon>
|
|
|
|
|
<tabs>
|
|
|
|
|
<tab id='tab1' label='REHAU'>
|
|
|
|
|
<group id='group1' label='Прайс-лист'>
|
|
|
|
|
<button id='button1' label='Экспорт' onAction='OnButtonPressed'/>
|
|
|
|
|
</group >
|
|
|
|
|
</tab>
|
|
|
|
|
</tabs>
|
|
|
|
|
</ribbon>
|
|
|
|
|
</customUI>";
|
|
|
|
|
}
|
2021-12-07 08:28:21 +03:00
|
|
|
|
|
|
|
|
|
public void OnButtonPressed(IRibbonControl control)
|
|
|
|
|
{
|
|
|
|
|
using (DataWriter dw = new DataWriter())
|
|
|
|
|
{
|
|
|
|
|
if (!dw.IsRangeValid())
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("Выделен неверный диапазон!", "Неверный диапазон", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
dw.FillSkuAmountDict();
|
2021-12-08 09:45:03 +03:00
|
|
|
|
//dw.FillPriceList();
|
2021-12-07 08:28:21 +03:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-12-05 16:55:36 +03:00
|
|
|
|
}
|
|
|
|
|
}
|