Esempio n. 1
0
        public ResponseView Modify(StorageView storage)
        {
            var model = _adapter.Adapt <Storage>(storage);

            var repo = ServiceLocator.Current.GetInstance <IStorageRepository>();

            var stor = repo.First(t => t.ID == model.ID);

            stor.Name    = model.Name;
            stor.Address = model.Address;

            var result = new ResponseView();

            try
            {
                repo.Context.Commit();
                return(result);
            }
            catch (Exception e)
            {
                result.IsSuccess = false;
                result.Message   = "修改仓库失败";
                return(result);
            }
        }
Esempio n. 2
0
        private void ShowStorageWindow(int id)
        {
            StorageView      storageView      = new StorageView();
            StorageViewModel storageViewModel = new StorageViewModel(id);

            storageView.DataContext = storageViewModel;
            storageView.Show();
        }
        private void ShowStorageWindow(int id, string filterText)
        {
            StorageView      storageView      = new StorageView();
            StorageViewModel storageViewModel = new StorageViewModel(id, filterText);

            storageView.DataContext = storageViewModel;
            storageView.Show();
        }
Esempio n. 4
0
        public static Storage Create(StorageView storageView)
        {
            var storage = new Storage
            {
                StorageName = storageView.StorageName,
                Address     = storageView.Address,
            };

            return(storage);
        }
Esempio n. 5
0
        public StoragePresenter(StorageView view)
        {
            this.view = view;
            gsStatusColor[EnumCellStatus.空料框.ToString()]     = Color.Yellow;
            gsStatusColor[EnumCellStatus.空闲.ToString()]      = Color.Transparent;
            gsStatusColor[EnumCellStatus.满位.ToString()]      = Color.Green;
            gsStatusColor[EnumGSEnabledStatus.禁用.ToString()] = Color.Red;
            gsStatusColor[EnumGSTaskStatus.锁定.ToString()]    = Color.Blue;

            IniAreaColorDic();
        }
Esempio n. 6
0
        public async Task <IActionResult> Create(StorageView storageView)
        {
            if (!ModelState.IsValid)
            {
                return(View(storageView));
            }
            var storage = UtilityStorage.Create(storageView);

            _context.Add(storage);
            await _context.SaveChangesAsync();

            return(RedirectToAction(nameof(Index)));
        }
        private void закупкиToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form newForm = new StorageView(this, user);

            if (currentChildForm != null)
            {
                currentChildForm.Close();
            }
            currentChildForm    = newForm;
            newForm.MdiParent   = this;
            newForm.WindowState = FormWindowState.Maximized;
            newForm.BringToFront();
            newForm.Show();
        }
Esempio n. 8
0
        public StoragePresenter(StorageView view)
        {
            this.view = view;
            gsStatusColor[EnumCellStatus.空料框.ToString()]     = Color.Yellow;
            gsStatusColor[EnumCellStatus.空闲.ToString()]      = Color.Transparent;
            gsStatusColor[EnumCellStatus.满位.ToString()]      = Color.Green;
            gsStatusColor[EnumGSEnabledStatus.禁用.ToString()] = Color.Red;
            gsStatusColor[EnumGSTaskStatus.锁定.ToString()]    = Color.Blue;
            gsStatusColor[EnumGSTaskStatus.出库允许.ToString()]  = Color.Blue;

            IniAreaColorDic();
            string rstr = "";

            LoadAreaColorCfg(ref rstr);
            xmlOper = new XMLOperater(filePath);
        }
    void Start()
    {
        //model
        model = new StorageModel();

        //view
        view = new StorageView();
        view.SetModel(model);
        view.SetUITexts(textUnits, textNealyfull);
        view.Refresh();

        //controller
        controller = new StorageController();
        controller.SetModel(model);
        controller.SetView(view);
        controller.SetInputFieldDelivery(inputFieldDelivery);
    }
Esempio n. 10
0
        private void button1_Click(object sender, EventArgs e)
        {
            string         reStr = "";
            StorageManager sm    = new StorageManager();

            sm.Initialize(ref reStr);
            CellCoordModel cell = new CellCoordModel(1, 1, 5);

            //EnumGSEnabledStatus gsSta = EnumGSEnabledStatus.禁用;
            //sm.GetCellEnabledStatus("A库房", cell, ref gsSta);
            //sm.UpdateCellStatus("A库房", cell, EnumCellStatus.满位, EnumGSTaskStatus.完成, ref reStr);
            // sm.UpdateGSOper("A库房", cell, EnumGSOperate.入库, ref reStr);
            // sm.CellRequire("A库房", ref cell, ref reStr);
            // EnumCellStatus cellSta = EnumCellStatus.满位;
            // EnumGSTaskStatus taskStas = EnumGSTaskStatus.锁定;
            // sm.GetCellStatus("A库房", cell, ref cellSta, ref taskStas);
            string[] ssf = new string[2];
            ssf[0] = "tb123";
            ssf[1] = "tb345";
            sm.AddStack("A库房", cell, "1234567", ssf, ref reStr);
            sm.UpdateCellStatus("A库房", cell, EnumCellStatus.满位, EnumGSTaskStatus.锁定, ref reStr);
            // sm.CellRequire("A库房", ref cell, ref reStr);
            // List<CellCoordModel> cellList = new List<CellCoordModel>();
            // sm.GetAllowLeftHouseGs("A库房", ref cellList, ref reStr);

            // sm.AddEmptyMeterialBox("A库房", cell, ref reStr);
            //// sm.AddGSOperRecord("A库房", cell, EnumGSOperateType.手动出库, ref reStr);

            // DateTime dt = new DateTime();
            // sm.GetCellInputTime("A库房", cell, ref dt);
            // sm.RemoveStack("A库房", cell, ref reStr);
            // sm.UpdateGSOper("A库房", cell, EnumGSOperate.出库, ref reStr);
            // sm.UpdateGsStatus("A库房", cell, EnumCellStatus.空料框, ref reStr);
            // sm.UpdateGsTaskStatus("A库房", cell, EnumGSTaskStatus.出库允许, ref reStr);

            //List<string> stockList = new List<string>();
            //sm.GetStockDetail("A库房", new CellCoordModel(1, 1, 5), ref stockList);
            StorageView storageView = new StorageView("库存管理");

            storageView.ShowDialog();
            //StorageView sv = new StorageView("wer");
            //sv.ShowDialog();
        }
Esempio n. 11
0
        //*************************
        //*                       *
        //*  RemoveAccount_Click  *
        //*                       *
        //*************************
        // Remove selected account.

        private void RemoveAccount_Click(object sender, RoutedEventArgs e)
        {
            if (AccountList.SelectedIndex == -1 | AccountList.SelectedIndex == 0)
            {
                return;
            }

            int index = AccountList.SelectedIndex - 1;

            String accountName = Accounts[index].Name;

            // Confirm removal of storage account.

            if (System.Windows.MessageBox.Show("Are you sure you want to remove '" + accountName + "' from your list of storage accounts?", "Confirm Remove Storage Account", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
            {
                // If account is currently displayed, removed its tab.

                if (StorageViewsTabControl.Items != null)
                {
                    foreach (TabItem item in StorageViewsTabControl.Items)
                    {
                        StorageView view = item.Content as StorageView;
                        if (view != null && view.Account.Name == accountName)
                        {
                            StorageViewsTabControl.Items.Remove(item);
                            break;
                        }
                    }
                }

                // Remove account from internal list and save it. Remove account from accounts selection list.

                Cursor = System.Windows.Input.Cursors.Wait;
                AccountList.Items.RemoveAt(index);
                AccountList.SelectedIndex = -1;
                Accounts.RemoveAt(index);

                SaveAccountList();

                Cursor = System.Windows.Input.Cursors.Arrow;
            }
        }
Esempio n. 12
0
        public ResponseView Add(StorageView storage)
        {
            var model = _adapter.Adapt <Storage>(storage);

            var repo = ServiceLocator.Current.GetInstance <IStorageRepository>();

            var result = new ResponseView();

            try
            {
                repo.Add(model);
                repo.Context.Commit();
                return(result);
            }
            catch (Exception e)
            {
                result.IsSuccess = false;
                result.Message   = "添加仓库失败";
                return(result);
            }
        }
Esempio n. 13
0
 private void FormStock_Load(object sender, EventArgs e)
 {
     if (id.HasValue)
     {
         try
         {
             StorageView view = service.GetElement(id.Value);
             if (view != null)
             {
                 textBoxName.Text                     = view.StorageName;
                 dataGridView.DataSource              = view.StorageComponents;
                 dataGridView.Columns[0].Visible      = false;
                 dataGridView.Columns[1].Visible      = false;
                 dataGridView.Columns[2].Visible      = false;
                 dataGridView.Columns[3].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }
        public void TestThatStorageViewCanBeSerialized()
        {
            StorageView storageView = _fixture.Create <StorageView>();

            DataContractTestHelper.TestAtContractKanSerialiseresOgDeserialiseres(storageView);
        }
        public void TestThatStorageViewCanBeInitialized()
        {
            StorageView storageView = _fixture.Create <StorageView>();

            DataContractTestHelper.TestAtContractErInitieret(storageView);
        }
Esempio n. 16
0
        //***********************
        //*                     *
        //*  AddStorageAccount  *
        //*                     *
        //***********************
        // Add a storage view tab.

        private void AddStorageView(String accountName)
        {
            AccountSelector.Visibility = Visibility.Collapsed;
            AccountMessage.Text        = "Loading Storage Account " + accountName;
            AccountMessage.Visibility  = Visibility.Visible;
            AccountAction.Visibility   = Visibility.Visible;

            AzureAccount account = null;

            // Find the selected account name in the account list.

            foreach (AzureAccount acct in Accounts)
            {
                if (acct.Name == accountName)
                {
                    account = acct;
                }
            }

            if (account == null)
            {
                return;
            }

            // Check that the account isn't already in a tab; if it is, do nothing.

            if (StorageViewsTabControl.Items != null)
            {
                foreach (TabItem item in StorageViewsTabControl.Items)
                {
                    StorageView view = item.Content as StorageView;
                    if (view != null && view.Account.Name == accountName)
                    {
                        StorageViewsTabControl.SelectedItem = item;
                        AccountAction.Visibility            = Visibility.Collapsed;
                        AccountSelector.Visibility          = Visibility.Visible;
                        return;
                    }
                }
            }

            Task task = Task.Factory.StartNew(() =>
            {
            });

            task.ContinueWith((t) =>
            {
                TabItem item = new TabItem();
                //item.Header = account.Name;

                StackPanel panel  = new StackPanel();
                panel.Orientation = System.Windows.Controls.Orientation.Horizontal;
                TextBlock title   = new TextBlock()
                {
                    Text = account.Name + " "
                };
                panel.Children.Add(title);
                TextBlock closeBox = new TextBlock()
                {
                    Text = "×"
                };
                closeBox.Tag        = account.Name;
                closeBox.Cursor     = System.Windows.Input.Cursors.Hand;
                closeBox.MouseDown += new MouseButtonEventHandler(CloseStorageView);
                panel.Children.Add(closeBox);
                item.Header             = panel;
                StorageView storageView = new StorageView();

                storageView.Account = account;
                item.Content        = storageView;

                storageView.LoadLeftPane();

                item.Content = storageView;;

                StorageViews.Items.Add(item);

                StorageViews.SelectedItem = item;

                AccountAction.Visibility   = Visibility.Collapsed;
                AccountSelector.Visibility = Visibility.Visible;
            }, TaskScheduler.FromCurrentSynchronizationContext());
        }
Esempio n. 17
0
 public void SetView(StorageView view)
 {
     this.view = view;
 }
Esempio n. 18
0
 //Utworzenie nowego widoku i przypisanie zawartości okna do niego
 public void startAppView(object sender, EventArgs e)
 {
     storageView = new StorageView();
     DataContext = storageView;
 }