public override void DeleteForm()
        {
            string consoleVal;

            ConsoleTexts.FrameHeaderFooterLine();
            ConsoleTexts.Header(Messages.FormHeaderRentalDelete);
            ConsoleTexts.FrameHeaderFooterLine();

            List <RentalDetailDto> rentals = RentalList();

            string[] headers = { "Rental ID", "Car Name", "Brand Name", "Color Name", "First Name", "Last Name", "Email Address", "Company Name", "Rent Date", "Return Date" };
            //Todo : Liste sütunlarını azalt
            ConsoleTexts.WriteDataList <RentalDetailDto>(Messages.ListHeaderRentalSelect, rentals, headers);
            if (rentals != null)
            {
                consoleVal = ConsoleTexts.ConsoleWriteReadLine(Messages.SelectRentalIdToDelete);
                if (consoleVal != "")
                {
                    Rental rental = _rentalManager.GetById(Convert.ToInt32(consoleVal)).Data;
                    if (ConsoleTexts.ConfirmAction(Messages.DeleteItemAttention))
                    {
                        _rentalManager.Delete(rental);
                    }
                }
            }
        }
        public override void DeleteForm()
        {
            Car    car;
            string consoleVal;

            ConsoleTexts.FrameHeaderFooterLine();
            ConsoleTexts.Header(Messages.FormHeaderCarDelete);
            ConsoleTexts.FrameHeaderFooterLine();
            ListAllCars();
            if (_carManager.Count().Data > 0)
            {
                consoleVal = ConsoleTexts.ConsoleWriteReadLine(Messages.SelectCarIdToDelete);
                if (consoleVal != "")
                {
                    car = _carManager.GetById(Convert.ToInt32(consoleVal)).Data;
                    if (ConsoleTexts.ConfirmAction(Messages.DeleteItemAttention))
                    {
                        _carManager.Delete(car);
                    }
                }
            }
        }
        public override void DeleteForm()
        {
            Color  color;
            string consoleVal;

            ConsoleTexts.FrameHeaderFooterLine();
            ConsoleTexts.Header(Messages.FormHeaderColorDelete);
            ConsoleTexts.FrameHeaderFooterLine();
            ConsoleTexts.WriteConsoleMenuInFrame(Messages.ListHeaderColorSelect, StrColorList());
            if (StrColorList() != null)
            {
                consoleVal = ConsoleTexts.ConsoleWriteReadLine(Messages.SelectColorIdToDelete);
                if (consoleVal != "")
                {
                    color = _colorManager.GetById(Convert.ToInt32(consoleVal)).Data;
                    if (ConsoleTexts.ConfirmAction(Messages.DeleteItemAttention))
                    {
                        _colorManager.Delete(color);
                    }
                }
            }
        }
Ejemplo n.º 4
0
        public override void DeleteForm()
        {
            Brand  brand;
            string consoleVal;

            ConsoleTexts.FrameHeaderFooterLine();
            ConsoleTexts.Header(Messages.FormHeaderBrandDelete);
            ConsoleTexts.FrameHeaderFooterLine();
            ConsoleTexts.WriteConsoleMenuInFrame(Messages.ListHeaderBrandSelect, StrBrandList());
            if (StrBrandList() != null)
            {
                consoleVal = ConsoleTexts.ConsoleWriteReadLine(Messages.SelectBrandIdToDelete);
                if (consoleVal != "")
                {
                    brand = _brandManager.GetById(Convert.ToInt32(consoleVal)).Data;
                    if (ConsoleTexts.ConfirmAction(Messages.DeleteItemAttention))
                    {
                        _brandManager.Delete(brand);
                    }
                }
            }
        }