Example #1
0
        internal void CreateOptionFromClipboard()
        {
            var data = ClipboardHelpers.GetExcelData();

            if (data == null)
            {
                Toaster.Warning(Properties.Resources.pasteFailTitle, Properties.Resources.pasteFailMessage);
                return;
            }
            if (data.Length < 5)
            {
                Toaster.Warning(Properties.Resources.pasteFailTitle, Properties.Resources.pasteFailIncompleteMessage);
            }

            var option = new Option
            {
                LongText = data[1],
                Unit     = data[2],
                Prices   = new ObservableCollection <Price>
                {
                    new Price {
                        From = 0, To = 0, PricePerUnit = double.Parse(data[5])
                    },
                }
            };

            Service.ShowOptionWindow(option);
        }