Пример #1
0
        private void InventoryDataGridDoubleClickExecute()
        {
            List <TextileColorInventory> textileColorInventorys = new List <TextileColorInventory>
            {
                TextileColor
            };
            InventoryListDialog inventoryListDialog = new InventoryListDialog(FileName, TextileInventoryHeader, textileColorInventorys);

            inventoryListDialog.Show();
        }
Пример #2
0
        private void CheckBox_Click(object sender, RoutedEventArgs e)
        {
            CheckBox           checkBox           = (CheckBox)sender;
            ExternalDataHelper externalDataHelper = new ExternalDataHelper();

            TextileNameMappings = externalDataHelper.GetTextileNameMappings();
            if (checkBox.IsChecked ?? false)
            {
                string fileNamePath = string.Concat(AppSettingConfig.FilePath(), "/", AppSettingConfig.StoreManageFileName());
                Tuple <List <string>, IWorkbook> tuple = ExcelModule.GetExcelWorkbook(fileNamePath);
                TextileInventoryHeader           textileInventoryHeader = ExcelModule.GetShippingDate(tuple.Item2.GetSheetAt(1));
                Workbook = tuple.Item2;
                Window parentWindow = Window.GetWindow(this);

                var textileNameMapping = TextileNameMappings.ToList().Find(f => f.ProcessOrder.Contains(ProcessOrder == null ? string.Empty : ProcessOrder.Fabric));
                List <TextileColorInventory> selectedTextiles = new List <TextileColorInventory>();
                if (textileNameMapping != null)
                {
                    ExcelHelper excelHelper = new ExcelHelper();
                    foreach (var item in textileNameMapping.Inventory)
                    {
                        selectedTextiles.AddRange(excelHelper.GetInventoryData(Workbook, item));
                    }
                    textileInventoryHeader.Textile = ProcessOrder.Fabric;
                }

                InventoryListDialog = new InventoryListDialog(AppSettingConfig.StoreManageFileName(), textileInventoryHeader, selectedTextiles)
                {
                    Owner  = Window.GetWindow(this),
                    Top    = parentWindow.Top + parentWindow.Height,
                    Left   = parentWindow.Left,
                    Height = 300
                };
                InventoryListDialog.Show();
                InventoryListDialog.Closed += InventoryListDialog_Closed;


                InventoryUpdateTime.Content = DateTime.Now.ToString("yyyy/MM/dd hh:mm:ss");
            }
            else
            {
                InventoryListDialog.Close();
            }
        }