/// <summary>
 /// Update Customer or Team Account
 /// Insert into Customer and Team Account recharge history 
 /// </summary>
 /// <param name="obj">
 /// obj[0] = ModelBillConfig
 /// obj[1] = ModelCustomer
 /// obj[2] = ModelTeamInfo
 /// obj[3] = CustomerInfo.IsChecked
 /// </param>
 private void accountRechargeClick(object obj)
 {
     this.RechareUpdate.IsEnabled = false;
     Mouse.OverrideCursor = Cursors.Wait;
     try
     {
         if (obj is ArrayList)
         {
             ArrayList dataList= obj as ArrayList;
             ModelBillConfig billInfo = dataList[0] as ModelBillConfig;
             ModelCustomer customerInfo = dataList[1] as ModelCustomer;
             ModelTeamInfo teamInfo = dataList[2] as ModelTeamInfo;
             using (Cafeteria_Vernier_dbEntities cvDatabase = new Cafeteria_Vernier_dbEntities())
             {
                 if ((bool)dataList[3])
                 {
                     var userAccountInfo = cvDatabase.CustomerAccounts.First(x => x.UserID.Equals(customerInfo.Name));
                     userAccountInfo.Minutes += Convert.ToInt32(billInfo.Minutes);
                     cvDatabase.AddToUserRechargeHistories(
                                                 new UserRechargeHistory
                                                 {
                                                     AutoInc = default(long),
                                                     bill = Convert.ToInt32(billInfo.Amount),
                                                     DateWithTime = DateTime.Today,
                                                     EmployeeID = this.LoginEmployee.Name,
                                                     Minutes = Convert.ToInt32(billInfo.Minutes),
                                                     UserID = customerInfo.Name
                                                 });
                     customerInfo.Minutes += Convert.ToInt32(billInfo.Minutes);
                 }
                 else
                 {
                     var teamAccountInfo = cvDatabase.TeamAccounts.First(x => x.Name.Equals(teamInfo.Name));
                     teamAccountInfo.Minutes += Convert.ToInt32(billInfo.Minutes);
                     cvDatabase.AddToTeamRechargeHistories(
                                                     new TeamRechargeHistory
                                                     {
                                                         AutoInc = default(long),
                                                         bill = Convert.ToInt32(billInfo.Amount),
                                                         DateWithTime = DateTime.Today,
                                                         EmployeeID = this.LoginEmployee.Name,
                                                         Minutes = Convert.ToInt32(billInfo.Minutes),
                                                         Name = teamInfo.Name
                                                     });
                     teamInfo.Minutes += Convert.ToInt32(billInfo.Minutes);
                 }
                 var toDayCash = cvDatabase.Cashes.First(x => x.EntryDate == DateTime.Today);
                 toDayCash.Amount += Convert.ToDecimal(billInfo.Amount);
                 cvDatabase.SaveChanges();
                 Mouse.OverrideCursor = null;
                 DXMessageBox.Show(CvVariables.ERROR_MESSAGESS[0,2],CvVariables.SOFTWARE_NAME,MessageBoxButton.OK,MessageBoxImage.Information);
             }
         }
     }
     catch (Exception ErrorException)
     {
         LogFileWriter.ErrorToLog("Account Recharge", ErrorException);
         Mouse.OverrideCursor = null;
         DXMessageBox.Show(ErrorException.Message,CvVariables.SOFTWARE_NAME,MessageBoxButton.OK,MessageBoxImage.Error);
     }
     finally
     {
         Mouse.OverrideCursor = null;
         this.RechareUpdate.IsEnabled = true;
     }
 }