Esempio n. 1
0
        private void metroLink3_Click(object sender, EventArgs e)
        {
            if (RowView != null)
            {
                RentDetails form = new RentDetails(this.StyleManager);
                form.Rent.Id = int.Parse(RowView["Id Aluguel"].ToString());
                Database.DBCar    _appCar    = new Database.DBCar();
                Database.DBClient _appClient = new Database.DBClient();
                var car = _appCar.GetCar(branch: RowView["Marca"].ToString(), model: RowView["Modelo"].ToString(), color: RowView["Cor"].ToString(), year: RowView["Ano"].ToString());
                form.Rent.idCar = car.Id;
                if (RowView["Funcionario"].ToString() != "")
                {
                    Database.DBEmployee _appEmployee = new Database.DBEmployee();
                    form.Rent.idEmployee = _appEmployee.GetEmployee(employeeName: RowView["Funcionario"].ToString()).Id;
                }
                form.Rent.idClient    = (_appClient.GetClientByName(RowView["Cliente"].ToString())).Id;
                form.Rent.PickUpDate  = DateTime.Parse(RowView["Retirada"].ToString());
                form.Rent.DropOffDate = DateTime.Parse(RowView["Devolução"].ToString());
                form.Rent.Value       = double.Parse(RowView["Valor"].ToString().Replace("R$", ""));
                switch (RowView["Tipo Pagamento"].ToString())
                {
                case "1":
                    form.Rent.PaymentType = Domain.Entities.PaymentTypeEnum.Billet;
                    break;

                case "2":
                    form.Rent.PaymentType = Domain.Entities.PaymentTypeEnum.Money;
                    break;

                case "3":
                    form.Rent.PaymentType = Domain.Entities.PaymentTypeEnum.Card;
                    break;
                }
                form.ShowDialog();
            }
            else
            {
                MetroMessageBox.Show(this, "Selecione a linha que deseja editar", "", MessageBoxButtons.OK, MessageBoxIcon.Warning, 100);
            }
        }
Esempio n. 2
0
 private Domain.Entities.Employee Load_Employee()
 {
     Database.DBEmployee _appEmployee = new Database.DBEmployee();
     return(_appEmployee.GetEmployee(idEmployee: Rent.idEmployee));
 }