Exemplo n.º 1
0
        public CarDetailReportPresentationStub(car_expense dbItem)
        {
            CarExpenseType type = (CarExpenseType)Enum.Parse(typeof(CarExpenseType), dbItem.expense_type);
            EnumHelper     eh   = new EnumHelper();

            Date    = dbItem.expense_date;
            Income  = 0;
            Expense = dbItem.expense_value;
            Notes   = eh.GetEnumDescription(type);
        }
Exemplo n.º 2
0
        public CarExpensePresentationStub(car_expense dbItem)
        {
            EnumHelper eh = new EnumHelper();

            this.Id           = dbItem.id;
            this.IdCar        = dbItem.id_car;
            this.ExpenseDate  = dbItem.expense_date;
            this.LicensePlate = dbItem.car.license_plate;
            this.Other        = dbItem.other;
            this.Distance     = dbItem.distance;
            this.ExpenseValue = dbItem.expense_value;
            this.Attachment   = dbItem.attachment;
            this.Notes        = dbItem.notes;

            if (dbItem.expense_type != null && dbItem.expense_type != "")
            {
                ExpenseTypeEnum = (CarExpenseType)Enum.Parse(typeof(CarExpenseType), dbItem.expense_type);
                ExpenseType     = eh.GetEnumDescription(ExpenseTypeEnum);
            }
        }