Пример #1
0
        public void ListData_CallDalListData()
        {
            //  arrange

            //  act
            var actual = _colorBL.ListData();

            //  assert
            _colorDal.Verify(x => x.ListData(), Times.Once);
        }
Пример #2
0
        private void LoadColorComboBox()
        {
            ColorIDComboBox.DataSource = null;
            ColorIDComboBox.Items.Clear();

            //  ambil data
            var listColor = _colorBL.ListData();

            //  exit jika kosong
            if (listColor == null)
            {
                return;
            }

            var listColorOrdered = listColor
                                   .OrderBy(x => x.ColorID)
                                   .Select(x => x.ColorID)
                                   .ToList();

            ColorIDComboBox.DataSource = listColorOrdered;
        }
Пример #3
0
        void LoadColorCombo()
        {
            ColorComboBox.DataSource = null;
            ColorComboBox.Items.Clear();

            //  ambil data
            var listColor = _colorBL.ListData();

            //  exit jika kosong
            if (listColor == null)
            {
                return;
            }

            var listColorWithHue =
                from c in listColor
                select new
            {
                c.ColorID,
                c.RedValue,
                c.GreenValue,
                c.BlueValue,
                Hue = Color.FromName(c.ColorID).GetHue()
            };

            listColorWithHue = listColorWithHue
                               .OrderBy(x => x.RedValue)
                               .ThenBy(x => x.GreenValue)
                               .ThenBy(x => x.BlueValue)
                               .ToList();
            ColorComboBox.DataSource    = listColorWithHue;
            ColorComboBox.DisplayMember = "ColorID";
            ColorComboBox.ValueMember   = "ColorID";
            var color = _colorBL.GetData(ColorComboBox.SelectedValue.ToString());

            ColorPanel.BackColor = _colorBL.GetFromRGB(color);

            ColorComboBox.SelectedItem = null;
        }