Пример #1
0
        /*Changing the account num*/
        public HttpResponseMessage EditAcct(string newAcc, int index)
        {
            HttpRequestMessage Request = new HttpRequestMessage();


            try
            {
                channel.EditAccount(newAcc, index);                             //Calling data tier function
                logger.LogFunc("Changed the acct of index: " + index);          //Logging success
                return(Request.CreateErrorResponse(HttpStatusCode.OK, newAcc)); //Success
            }
            catch (FaultException <ExceptionDetail> e)
            {
                logger.LogFunc("Inside EditAcct: " + "Message: " + e.Message + " StackTrace: " + e.StackTrace); //Logging failure
                HttpResponseMessage hrm = Request.CreateResponse(HttpStatusCode.NotFound);                      //Telling caller it failed
                hrm.Content = new StringContent("Account Number was in incorrect format");                      //Error message for user
                return(hrm);
            }
        }