Beispiel #1
0
        /// <summary>
        /// 取得布種成份比例資料
        /// </summary>
        /// <param name="proportionNo">布種比例編號,如修改布種成分時Update使用</param>
        /// <param name="proportion">成分比例,同一布種比例應相同</param>
        /// <param name="specificationYarnPrice"></param>
        /// <returns></returns>
        public FabricIngredientProportion GetFabricIngredientProportion(int proportionNo, decimal proportion, SpecificationYarnPrice specificationYarnPrice)
        {
            FabricIngredientProportion fabricIngredientProportion = new FabricIngredientProportion
            {
                ProportionNo = proportionNo,
                YarnPriceNo  = specificationYarnPrice.YarnPriceNo,
                Name         = specificationYarnPrice.Name,
                Color        = specificationYarnPrice.Color,
                Ingredient   = specificationYarnPrice.Ingredient,
                Price        = specificationYarnPrice.Price,
                Proportion   = proportion,
                YarnCount    = specificationYarnPrice.YarnCount
            };

            return(fabricIngredientProportion);
        }
Beispiel #2
0
        private void ChangeYarn(SpecificationYarnPrice specificationYarnPrice)
        {
            int selectedIndex = DataGridFabricIngredientProportion.SelectedIndex;
            int groupNo       = Convert.ToInt32(ComboBoxGroup.SelectedItem);

            //如果紗成分比例沒有選擇一個色的話則會新增一個比例
            //否則會將選擇到的比例
            if (selectedIndex == -1)
            {
                MessageBox.Show("請選擇一筆要修改的資料!");
            }
            else
            {
                var selectedItem = DataGridFabricIngredientProportion.SelectedItem as FabricIngredientProportion;
                FabricIngredientProportion fabricIngredientProportion = FabricModule.GetFabricIngredientProportion(selectedItem.ProportionNo, selectedItem.Proportion, specificationYarnPrice);
                _dictionaryFabricIngredientProportion[groupNo].RemoveAt(selectedIndex);
                _dictionaryFabricIngredientProportion[groupNo].Insert(selectedIndex, fabricIngredientProportion);
                DataGridFabricIngredientProportion.SelectedIndex = selectedIndex += 1;
            }
        }
Beispiel #3
0
        private void ChangeYarn(SpecificationYarnPrice specificationYarnPrice)
        {
            int selectedIndex = DataGridFabricIngredientProportion.SelectedIndex;
            //如果紗成分比例沒有選擇一個色的話則會新增一個比例
            //否則會將選擇到的比例
            TextBoxMessageDialog textBoxMessageDialog = new TextBoxMessageDialog
            {
                Left = this.Left + 100,
                Top  = this.Top + 130
            };
            decimal proportion = 0;

            if (textBoxMessageDialog.ShowDialog() == true)
            {
                proportion = decimal.Parse(textBoxMessageDialog.TextBoxProportion.Text);
            }
            else
            {
                return;
            }
            FabricIngredientProportion fabricIngredientProportion = FabricModule.GetFabricIngredientProportion(0, proportion, specificationYarnPrice);

            _dictionaryFabricIngredientProportion[1].Add(fabricIngredientProportion);
        }