private void AddTechStoreToStoreDetailButton_Click(object sender, EventArgs e) { TechStoreIDArray.Clear(); IsHalfStuff1Array.Clear(); LengthArray.Clear(); HeightArray.Clear(); WidthArray.Clear(); for (int i = 0; i < ItemsDataGrid.SelectedRows.Count; i++) { TechStoreIDArray.Add(Convert.ToInt32(ItemsDataGrid.SelectedRows[i].Cells["TechStoreID"].Value)); IsHalfStuff1Array.Add(ItemsDataGrid.SelectedRows[i].Cells["IsHalfStuff"].Value); LengthArray.Add(ItemsDataGrid.SelectedRows[i].Cells["Length"].Value); HeightArray.Add(ItemsDataGrid.SelectedRows[i].Cells["Height"].Value); WidthArray.Add(ItemsDataGrid.SelectedRows[i].Cells["Width"].Value); } if (TechStoreIDArray.Count == 0) { return; } int[] TechStoreID = TechStoreIDArray.OfType <int>().Distinct().ToArray(); object[] IsHalfStuff1 = IsHalfStuff1Array.OfType <object>().ToArray(); object[] Length = LengthArray.OfType <object>().ToArray(); object[] Height = HeightArray.OfType <object>().ToArray(); object[] Width = WidthArray.OfType <object>().ToArray(); TechStoreManager.AddTechCatalogStoreDetail(TechCatalogOperationsDetailID, TechStoreID, IsHalfStuff1, Length, Height, Width); InfiniumTips.ShowTip(this, 50, 85, "Добавлено в материалы", 1700); }