Пример #1
0
 /**
  * Edits the user's details based on the specified index and given details to edit
  */
 public void EditValuesFromIndex(int index, uint acctNo, uint pin, int bal, string fName, string lName, byte[] profileImg)
 {
     logNumber++;
     Log(String.Format("OPERATION: Edit a user at specified index {0} with the following values: ", index));
     Log(String.Format("First name: {0}", fName));
     Log(String.Format("Last name: {0}", lName));
     Log(String.Format("Account No: {0}", acctNo));
     Log(String.Format("PIN: {0}", pin));
     Log(String.Format("Balance: {0}", bal));
     if (profileImg != null)
     {
         Log(String.Format("Profile Image: {0}", profileImg.ToString()));
     }
     try
     {
         foob.EditValuesForEntry(index, acctNo, pin, bal, fName, lName, profileImg);
     }
     catch (FaultException <DatabaseFault> e)
     {
         // When an database error occurs, log it as well
         string errorMessage = String.Format("Failed to perform {0}, {1}", e.Detail.Operation, e.Detail.ProblemType);
         Log(String.Format("ERROR: {0}", errorMessage));
         // Throw an exception to the controllers
         throw new ArgumentException(errorMessage);
     }
     catch (CommunicationException e)
     {
         // When the image is too large, then throw an exception to the controller
         throw new CommunicationException(e.Message);
     }
 }