private void StoreData()
        {
            var cashier = AccountInformation.GetInstance().CurrentAccount.Employee;
            var bill    = new MaintenanceBill()
            {
                BikeID          = bike.ID,
                Date            = DateTime.Now,
                CashierID       = cashier.ID,
                StoreID         = cashier.StoreID,
                CustomerPayment = customer
            };

            bill.ID = MaintenanceBillDAL.GetInstance().Insert(bill);
            foreach (var item in currentList)
            {
                item.BillID = bill.ID;
                var billDetailID = BillDetailDAL.GetInstance().Insert(item);
                //foreach (var billEmp in item.BillEmployees)
                //{
                //    billEmp.BillDetailID = billDetailID;
                //    BillEmployeesDAL.GetInstance().Insert(billEmp);
                //}
            }
            MessageBox.Show("Create Bill Success");
            this.Close();
        }
        public TransactionResult CreateNewSaleReceipt(string phone, Bike bike)
        {
            var cashier = AccountInformation.GetInstance().CurrentAccount.Employee;
            var result  = new TransactionResult();

            using (var db = new MotorcycleShopsEntities())
            {
                var success = new ObjectParameter("Success", typeof(bool));
                var error   = new ObjectParameter("Error", typeof(string));
                db.NEW_SALE_TRANSACTION(phone, bike.EngineNumber, bike.ChassisNumber, cashier.ID, DateTime.Now, cashier.StoreID, success, error);
                result.Success = success.Value != DBNull.Value ? (bool)success.Value : true;
                result.Error   = error.Value != DBNull.Value ? (string)error.Value : "";
            }
            return(result);
        }
 private void InitAccountInformation(Account account)
 {
     currentAccount = AccountInformation.GetInstance();
     currentAccount.CurrentAccount          = account;
     currentAccount.CurrentAccount.Employee = EmployeeDAL.GetInstance().GetEmployeeByID((long)account.EmployeeID);
 }
 private void ResetAccountInformation()
 {
     currentAccount = AccountInformation.GetInstance();
     currentAccount.CurrentAccount = null;
 }