Exemplo n.º 1
0
        public string GetStatus()
        {
            DTPList dtpList = DTPList.getInstance();
            DTP     dtp     = dtpList.GetLast(this);

            StatusAfterDTPs statusAfterDTPs = StatusAfterDTPs.getInstance();
            string          statusAfterDTP  = statusAfterDTPs.getItem(Convert.ToInt32(dtp.IDStatusAfterDTP));

            CarSaleList carSaleList = CarSaleList.getInstance();
            CarSale     carSale     = carSaleList.getItem(ID);

            if (info.IsSale && carSale.Date != string.Empty)
            {
                return("продан");
            }
            if (info.IsSale)
            {
                return("на продажу");
            }

            if (!this.IsGet)
            {
                return("покупка");
            }

            if (statusAfterDTP == "А/м НЕ на ходу")
            {
                return("в ремонте");
            }

            return("на ходу");
        }
Exemplo n.º 2
0
        private void DoubleClickSale(Point point)
        {
            Car car = _dgvMain.GetCar();

            if (car == null)
            {
                return;
            }

            PTSList ptsList = PTSList.getInstance();
            PTS     pts     = ptsList.getItem(car);

            STSList stsList = STSList.getInstance();
            STS     sts     = stsList.getItem(car);

            if ((_dgvCar.Columns[point.X].HeaderText == "№ ПТС") && (!string.IsNullOrEmpty(pts.File)))
            {
                WorkWithFiles.openFile(pts.File);
            }
            else if ((_dgvCar.Columns[point.X].HeaderText == "№ СТС") && (!string.IsNullOrEmpty(sts.File)))
            {
                WorkWithFiles.openFile(sts.File);
            }
            else
            {
                CarSaleList carSaleList = CarSaleList.getInstance();
                CarSale     carSale     = carSaleList.getItem(car.ID);

                Car_Sale carSaleForm = new Car_Sale(carSale);
                if (carSaleForm.ShowDialog() == DialogResult.OK)
                {
                    loadCars();
                }
            }
        }
Exemplo n.º 3
0
        public override void Save()
        {
            string Sqldate = string.Empty;

            if (Date != string.Empty)
            {
                Sqldate = string.Concat(_date.Year.ToString(), "-", _date.Month.ToString(), "-", _date.Day.ToString());
            }

            _provider.Insert("CarSale", ID, comm, Sqldate);

            CarSaleList carSaleList = CarSaleList.getInstance();

            carSaleList.Add(this);
        }
Exemplo n.º 4
0
        private ToolStripMenuItem CreateDeleteFromSale()
        {
            ToolStripMenuItem item = CreateItem("Снять с продажи");

            item.Click += delegate
            {
                Car car = _dgvMain.GetCar();
                if (car == null)
                {
                    return;
                }

                if (MessageBox.Show("Вы действительно хотите убрать автомобиль с продажи?", "Снятие с продажи", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
                    == DialogResult.Yes)
                {
                    CarSaleList carSaleList = CarSaleList.getInstance();
                    carSaleList.Delete(car.ID);

                    _mainStatus.Set(_mainStatus.Get());
                }
            };
            return(item);
        }