Пример #1
0
        private void AddItemButton_Click(object sender, EventArgs e)
        {
            if (SubGroupsDataGrid.SelectedRows.Count == 0 || SubGroupsDataGrid.SelectedRows[0].Cells["TechStoreSubGroupID"].Value == DBNull.Value)
            {
                return;
            }

            Thread T = new Thread(delegate() { SplashWindow.CreateSplash(); });

            T.Start();

            while (!SplashForm.bCreated)
            {
                ;
            }

            AddNewTechStoreItemForm AddNewStoreItemForm = new AddNewTechStoreItemForm(ref StorageItemsManager);

            TopForm = AddNewStoreItemForm;

            AddNewStoreItemForm.ShowDialog();

            AddNewStoreItemForm.Close();
            AddNewStoreItemForm.Dispose();

            TopForm = null;
            TechStoreManager.RefreshTechStore();
            StorageItemsManager.RefreshStoreItems();
            SubGroupsDataGrid_SelectionChanged(null, null);
            //StorageItemsManager.MoveToStore(TechStoreID);
        }
Пример #2
0
        private void ItemsDataGrid_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (!StorageItemsManager.EditItem() || CreateStoreDetail || ItemsDataGrid.Columns[e.ColumnIndex].Name == "CheckBoxColumn")
            {
                return;
            }

            int TechStoreID = 0;

            if (ItemsDataGrid.SelectedRows.Count > 0 && ItemsDataGrid.SelectedRows[0].Cells["TechStoreID"].Value != DBNull.Value)
            {
                TechStoreID = Convert.ToInt32(ItemsDataGrid.SelectedRows[0].Cells["TechStoreID"].Value);
            }
            if (TechStoreID == 0)
            {
                return;
            }

            string TechStoreName         = string.Empty;
            string TechStoreSubGroupName = string.Empty;
            string SubGroupNotes         = string.Empty;
            string SubGroupNotes1        = string.Empty;
            string SubGroupNotes2        = string.Empty;

            if (ItemsDataGrid.SelectedRows.Count > 0 && ItemsDataGrid.SelectedRows[0].Cells["TechStoreName"].Value != DBNull.Value)
            {
                TechStoreName = ItemsDataGrid.SelectedRows[0].Cells["TechStoreName"].Value.ToString();
            }
            if (SubGroupsDataGrid.SelectedRows.Count > 0 && SubGroupsDataGrid.SelectedRows[0].Cells["Notes"].Value != DBNull.Value)
            {
                SubGroupNotes = SubGroupsDataGrid.SelectedRows[0].Cells["Notes"].Value.ToString();
            }
            if (SubGroupsDataGrid.SelectedRows.Count > 0 && SubGroupsDataGrid.SelectedRows[0].Cells["Notes1"].Value != DBNull.Value)
            {
                SubGroupNotes1 = SubGroupsDataGrid.SelectedRows[0].Cells["Notes1"].Value.ToString();
            }
            if (SubGroupsDataGrid.SelectedRows.Count > 0 && SubGroupsDataGrid.SelectedRows[0].Cells["TechStoreSubGroupName"].Value != DBNull.Value)
            {
                TechStoreSubGroupName = SubGroupsDataGrid.SelectedRows[0].Cells["TechStoreSubGroupName"].Value.ToString();
            }
            if (SubGroupsDataGrid.SelectedRows.Count > 0 && SubGroupsDataGrid.SelectedRows[0].Cells["Notes2"].Value != DBNull.Value)
            {
                SubGroupNotes2 = SubGroupsDataGrid.SelectedRows[0].Cells["Notes2"].Value.ToString();
            }

            Thread T = new Thread(delegate() { SplashWindow.CreateSplash(); });

            T.Start();

            while (!SplashForm.bCreated)
            {
                ;
            }

            AddNewTechStoreItemForm AddNewStoreItemForm = new AddNewTechStoreItemForm(ref StorageItemsManager, TechStoreName, TechStoreSubGroupName,
                                                                                      SubGroupNotes, SubGroupNotes1, SubGroupNotes2, bPrintLabels);

            TopForm = AddNewStoreItemForm;

            AddNewStoreItemForm.ShowDialog();

            AddNewStoreItemForm.Close();
            AddNewStoreItemForm.Dispose();

            TopForm = null;
            SubGroupsDataGrid_SelectionChanged(null, null);
            StorageItemsManager.MoveToStore(TechStoreID);
        }