예제 #1
0
        private void btnReturnRental_Click(object sender, EventArgs e)
        {
            CarDetails frm    = (CarDetails)Application.OpenForms["CarDetails"];
            int        id     = (int)frm.dtCarList.CurrentRow.Cells[0].Value;
            var        result = _rentalService.UpdateReturnDate(id);

            if (result.Success)
            {
                LoadRental();
                MessageBox.Show("Teslim Alındı");
            }
        }
예제 #2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            CarDetails frm    = (CarDetails)Application.OpenForms["CarDetails"];
            int        id     = (int)frm.dtCarList.CurrentRow.Cells[0].Value;
            var        result = _rentalService.CheckReturnDate(id);

            if (result.Success)
            {
                Rental rental = new Rental()
                {
                    CarId      = Convert.ToInt32(cmbCar.SelectedValue),
                    CustomerId = Convert.ToInt32(cmbCustomer.SelectedValue),
                    RentDate   = dtpRentDate.Value
                };
                _rentalService.Add(rental);
                LoadRental();
            }
            else
            {
                MessageBox.Show("Araç zaten kiralık");
            }
        }
예제 #3
0
        public void cmbCarDt()
        {
            CarDetails frm = (CarDetails)Application.OpenForms["CarDetails"];

            cmbCar.Text = frm.dtCarList.CurrentRow.Cells[1].Value.ToString();
        }