示例#1
0
 public static void SetMontageFrameMaterial(ComboBox item)
 {
     item.ItemsSource       = ((IListSource)SqlBaseData.MaterialsForMontageFrame()).GetList();
     item.DisplayMemberPath = "MaterialsName";
     item.SelectedValuePath = "LevelID";
     item.SelectedIndex     = 0;
 }
示例#2
0
 public static void SetPanelType(ComboBox item)
 {
     item.ItemsSource       = ((IListSource)SqlBaseData.PanelsTable()).GetList();
     item.DisplayMemberPath = "PanelTypeName";
     item.SelectedValuePath = "PanelTypeCode";
     item.SelectedIndex     = 0;
 }
        private void SizeOfUnit_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (SizeOfUnit == null)
            {
                return;
            }
            var sqlBaseData = new SqlBaseData();
            var standartUnitSizes =
                sqlBaseData.StandartSize(
                    SizeOfUnit.SelectedItem.ToString().Replace("" +
                                                               "System.Windows.Controls.ListBoxItem: ", ""));

            if (WidthU == null || HeightU == null)
            {
                return;
            }
            WidthU.Text = standartUnitSizes[0];
            HeightU.Text = standartUnitSizes[1];
        }
示例#4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Unit50Uc"/> class.
        /// </summary>
        public Unit50Uc()
        {
            InitializeComponent();
            
            ToSQL.Conn = Settings.Default.ConnectionToSQL;

            InnerPartGrid.Visibility = Visibility.Collapsed;
            
            var sqlBaseData = new SqlBaseData();

            var airVentsStandardSize = sqlBaseData.AirVentsStandardSize();
            SizeOfUnit.ItemsSource = ((IListSource)airVentsStandardSize).GetList();
            SizeOfUnit.DisplayMemberPath = "Type";
            SizeOfUnit.SelectedIndex = 0;

            SectionTextBox.ItemsSource = Totals.SectionLetters;

            TypeOfPanel.ItemsSource = (SqlBaseData.Profils.GetList());
            TypeOfPanel.DisplayMemberPath = "Description";
            TypeOfPanel.SelectedValuePath = "ProfilID";
            TypeOfPanel.SelectedIndex = 0;


            #region UNIT50FULL

            Lenght.MaxLength = 5;
            WidthU.MaxLength = 5;
            WidthU.IsReadOnly = true;
            HeightU.MaxLength = 5;
            HeightU.IsReadOnly = true;
            Lenght.MaxLength = 5;

            #endregion

            Totals.SetPanelType(TypeOfPanel50);
            Totals.SetMaterial(MaterialP1);
            Totals.SetMaterial(MaterialP2);

            ТолщинаВнешней.ItemsSource = Totals.SheetMetalThikness;
            ТолщинаВнешней.SelectedIndex = 2;
            ТолщинаВннутренней.ItemsSource = Totals.SheetMetalThikness;
            ТолщинаВннутренней.SelectedIndex = 2;

            Totals.SetRal(Ral1);
            Totals.SetRal(Ral2);
            Ral1.Visibility = Visibility.Hidden;
            Ral2.Visibility = Visibility.Hidden;
            Totals.SetCoatingType(CoatingType1);
            Totals.SetCoatingType(CoatingType2);
            Totals.SetCoatingClass(CoatingClass1);
            Totals.SetCoatingClass(CoatingClass2);

            PanelGrid.Visibility = Visibility.Collapsed;
            InnerGrid.Visibility = Visibility.Collapsed;
            GridMontageFrame.Visibility = Visibility.Collapsed;
            GridRoof.Visibility = Visibility.Collapsed;

            WidthLabel1.Visibility = Visibility.Collapsed;
            WidthRoof.Visibility = Visibility.Collapsed;
            HeightLabel1.Visibility = Visibility.Collapsed;
            LenghtRoof.Visibility = Visibility.Collapsed;
            
            #region TypeOfUnit50

            ModelOfInnerLabel.Visibility = Visibility.Collapsed;
            ModelOfInner.Visibility = Visibility.Collapsed;
            AddTypeLabel.Visibility = Visibility.Collapsed;
            AddType.Visibility = Visibility.Collapsed;

            #endregion

            #region MontageFrame50 Initialize

            FrameOffset.MaxLength = 5;
            FrameOffset.IsReadOnly = true;
            FrameOffsetLabel.Visibility = Visibility.Collapsed;
            FrameOffset.Visibility = Visibility.Collapsed;
            
            #endregion;

            #region MontageFrame50 Initialize

            LenghtBaseFrame.Visibility = Visibility.Collapsed;
            WidthBaseFrame.Visibility = Visibility.Collapsed;

            Totals.SetMontageFrameMaterial(MaterialMontageFrame);
            FrameOffset.MaxLength = 5;
            FrameOffset.IsReadOnly = true;

            Totals.SetRal(RalFrame1);            
            RalFrame1.Visibility = Visibility.Hidden;
            Totals.SetCoatingType(CoatingTypeFrame1);
            Totals.SetCoatingClass(CoatingClassFrame1);           

            #endregion
        }
示例#5
0
        void SizeOfUnit_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            try
            {
                if (SizeOfUnit?.SelectedItem == null)
                {
                    return;
                }
                var id = Convert.ToInt32(((DataRowView)SizeOfUnit.SelectedItem)["SizeID"].ToString());
                var sqlBaseData = new SqlBaseData();
                var type = Convert.ToInt32(TypeOfPanel.SelectedValue);               
                var standartUnitSizes = sqlBaseData.StandartSize(id, type);

                switch(type)
                {
                    case 1:
                        thicknessOfPanel = "30";
                        break;
                    case 2:
                        thicknessOfPanel = "50";
                        break;
                    case 7:
                        thicknessOfPanel = "70";
                        break;
                    default:
                        thicknessOfPanel = "40";
                        break;
                }

                if (WidthU == null || HeightU == null)
                {
                    return;
                }

                WidthU.Text = standartUnitSizes[0];
                HeightU.Text = standartUnitSizes[1];
            }
            catch (Exception)
            {
                if (WidthU != null) WidthU.Text = "";
                if (HeightU != null) HeightU.Text = "";
            }

        }
        void SizeOfUnit_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (SizeOfUnit?.SelectedItem == null) return;
            
            var id = Convert.ToInt32(((DataRowView) SizeOfUnit.SelectedItem)["SizeID"].ToString());
            var sqlBaseData = new SqlBaseData();
            var standartUnitSizes = sqlBaseData.StandartSize(id, 6);

            if (WidthU == null || HeightU == null)
            {
                return;
            }
            WidthU.Text = standartUnitSizes[0];
            HeightU.Text = standartUnitSizes[1];
        }
 static IEnumerable<PartsListXml2> InnerPartsList()
 {
     var sqlBaseData = new SqlBaseData();
     var table = sqlBaseData.PartTechParams();
     var list = (from DataRow row in table.Rows
                 select new PartsListXml2
                 {
                     PartNumber = row["PartNumber"].ToString(),
                     Конфигурация = row["Конфигурация"].ToString(),
                     ЗаготовкаШирина = row["Заготовка Ширина"].ToString(),
                     ЗаготовкаВысота = row["Заготовка Высота"].ToString(),
                     Гибы = row["Гибы"].ToString(),
                     Толщина = row["Толщина"].ToString(),
                     ПлощадьПокрытия = row["Площадь покрытия"].ToString()
                 }).ToList();
     return list;
 }