private void LoadEmployee(Employee emp)
        {
            this.emp = emp;
            this.emp = LazyWorker <Employee> .Get(emp.Id);

            UsernameTextbox.Text = this.emp.Username;
        }
 public static BillDisplay BillModelToBillDisplay(BillModel bill)
 {
     return(new BillDisplay()
     {
         Id = bill.Id,
         Customer_ = LazyWorker <Customer> .Get(bill.CustomerId != null?bill.CustomerId.Value : 0),
         Employee_ = LazyWorker <Employee> .Get(bill.EmployeeId != null?bill.EmployeeId.Value : 0),
         CreatingDay = bill.CreatingDay
     });
 }
        public static List <ServiceMapped> GetMappedServiceByBill(int billId)
        {
            var list = connection.Query <ServiceMapped>
                           (@"select Services.Id, Services.Price, Services.RoomId, Services.ServiceName, 
                BillDetails.Count, BillDetails.BillId, BillDetails.Id as BillDetailId
                from BillDetails join Services on BillDetails.ServiceId = Services.Id
                where BillDetails.BillId = @billId",
                           new { billId })
                       .AsList();

            list.ForEach
            (
                s => s.BelongToRoom = LazyWorker <Room> .Get(s.RoomId ?? 0)
            );

            return(list);
        }
        public static List <BillDisplay> GetAllBills()
        {
            List <BillDisplay> bills = new List <BillDisplay>();

            foreach (BillModel billModel in LazyWorker <BillModel> .GetAll())
            {
                bills.Add(new BillDisplay()
                {
                    Id        = billModel.Id,
                    Customer_ = LazyWorker <Customer> .Get
                                (
                        billModel.CustomerId ?? 0
                                ),
                    Employee_ = LazyWorker <Employee> .Get
                                (
                        billModel.EmployeeId ?? 0
                                ),
                    CreatingDay = billModel.CreatingDay,
                    TotalPrice  = TotalPriceOfBill(billModel.Id)
                });
            }

            return(bills);
        }