示例#1
0
        private void Fill()
        {
            CWCarModelsLogic models = new CWCarModelsLogic(manager);
            CWCategoriesLogic categories = new CWCategoriesLogic(manager);

            CategoriesCB.DisplayMember = "Name";
            CategoriesCB.ValueMember = "ID";
            CategoriesCB.DataSource = categories.GetAll();

            if (mode == "edit")
            {
                CWCarModel model = models.Get(Convert.ToInt32(id));
                if (model != null)
                {
                    NameTB.Text = model.Name;
                    BrandImagePB.SizeMode = PictureBoxSizeMode.Zoom;

                    _image = Helpers.ImageOperations.ByteArrayToImage(model.Image);
                    image = model.Image;
                    BrandImagePB.Image = _image;
                    foreach (object category in CategoriesCB.Items)
                    {
                        if (((CWCategory)category).ID == model.CategoryID)
                        {
                            CategoriesCB.SelectedItem = category;
                        }
                    }
                }
            }
        }
示例#2
0
文件: CarData.cs 项目: zep2zep/Compas
        private void Fill()
        {
            CWCarsLogic       cars       = new CWCarsLogic(manager);
            CWCategoriesLogic categories = new CWCategoriesLogic(manager);

            CategoriesCB.DisplayMember = "Name";
            CategoriesCB.ValueMember   = "ID";
            CategoriesCB.DataSource    = categories.GetAll();

            FillBrands();


            if (mode == "edit")
            {
                CWCar car = cars.Get(Convert.ToInt32(id));
                if (car != null)
                {
                    foreach (object category in CategoriesCB.Items)
                    {
                        if (((CWCategory)category).ID == car.CategoryID)
                        {
                            CategoriesCB.SelectedItem = category;
                        }
                    }
                }
            }
        }
示例#3
0
        private void Fill()
        {
            CWCarModelsLogic  models     = new CWCarModelsLogic(manager);
            CWCategoriesLogic categories = new CWCategoriesLogic(manager);

            CategoriesCB.DisplayMember = "Name";
            CategoriesCB.ValueMember   = "ID";
            CategoriesCB.DataSource    = categories.GetAll();


            if (mode == "edit")
            {
                CWCarModel model = models.Get(Convert.ToInt32(id));
                if (model != null)
                {
                    NameTB.Text           = model.Name;
                    BrandImagePB.SizeMode = PictureBoxSizeMode.Zoom;

                    _image             = Helpers.ImageOperations.ByteArrayToImage(model.Image);
                    image              = model.Image;
                    BrandImagePB.Image = _image;
                    foreach (object category in CategoriesCB.Items)
                    {
                        if (((CWCategory)category).ID == model.CategoryID)
                        {
                            CategoriesCB.SelectedItem = category;
                        }
                    }
                }
            }
        }
示例#4
0
 private void Fill()
 {
     CWCategoriesLogic Categories = new CWCategoriesLogic(manager);
     DataGV.AutoGenerateColumns = false;
     DataGV.DataSource = Categories.GetAll();
     DataGV.Update();
 }
示例#5
0
        private void Fill()
        {

            CWCategoriesLogic Categories = new CWCategoriesLogic(manager);
            DataGV.AutoGenerateColumns = false;
            DataGV.DataSource = Categories.GetAll();
            DataGV.Update();

        }
示例#6
0
        /// <summary>
        /// заповнення категорій автомобілів
        /// </summary>
        public void FillCategories()
        {
            CWCategoriesLogic categories = new CWCategoriesLogic(manager);

            CarCategoriesCB.DisplayMember = "Name";
            CarCategoriesCB.ValueMember   = "ID";

            CWCategory c0 = new CWCategory();

            c0.ID   = -1;
            c0.Name = "-не обрано-";
            CarCategoriesCB.Items.Add(c0);
            foreach (CWCategory category in categories.GetAll())
            {
                CarCategoriesCB.Items.Add(category);
            }
        }
示例#7
0
        /// <summary>
        /// заповнення категорій автомобілів
        /// </summary>
        public void FillCategories()
        {
            CWCategoriesLogic categories = new CWCategoriesLogic(manager);

            CarCategoriesCB.DisplayMember = "Name";
            CarCategoriesCB.ValueMember = "ID";

            CWCategory c0 = new CWCategory();
            c0.ID = -1;
            c0.Name = "-не обрано-";
            CarCategoriesCB.Items.Add(c0);
            foreach (CWCategory category in categories.GetAll())
            {
                CarCategoriesCB.Items.Add(category);
            }
        }
示例#8
0
文件: CarData.cs 项目: rymarrv/Compas
        private void Fill()
        {
            CWCarsLogic cars = new CWCarsLogic(manager);
            CWCategoriesLogic categories = new CWCategoriesLogic(manager);

            CategoriesCB.DisplayMember = "Name";
            CategoriesCB.ValueMember = "ID";
            CategoriesCB.DataSource = categories.GetAll();

            FillBrands();

            if (mode == "edit")
            {
                CWCar car = cars.Get(Convert.ToInt32(id));
                if (car != null)
                {
                    foreach (object category in CategoriesCB.Items)
                    {
                        if (((CWCategory)category).ID == car.CategoryID)
                        {
                            CategoriesCB.SelectedItem = category;
                        }
                    }

                }
            }
        }