Exemplo n.º 1
0
        /**
         * Retrieves the user's details based on the specified index in the database
         */
        public DataIntermed GetValuesFromIndex(int index)
        {
            logNumber++;
            Log(String.Format("OPERATION: Get a user from specified index: {0}", index));
            DataIntermed result = new DataIntermed();

            result.index = index;
            foob.GetValuesForEntry(index, out result.acct, out result.pin, out result.bal, out result.fName, out result.lName, out result.profileImg);

            return(result);
        }
Exemplo n.º 2
0
        /*Getting a specific user at an entry*/
        public HttpResponseMessage GetValuesForEntry(int index, out uint acctNo, out uint pin, out double bal,
                                                     out string fName, out string lName, out byte[] image)
        {
            acctNo = 0;
            pin    = 0;
            bal    = 0;
            fName  = "";
            lName  = "";
            image  = null;
            //Initialising values

            DataIntermed       data;
            HttpRequestMessage Request = new HttpRequestMessage();

            try
            {
                channel.GetValuesForEntry(index, out acctNo, out pin, out bal, out fName, out lName, out image);                           //Calling the function in data tier
                data = new DataIntermed(bal, acctNo, pin, fName, lName, index, image);                                                     //making a dataintermed obj
                var json = new JavaScriptSerializer().Serialize(data);                                                                     //serializing the dataintermed obj so it can be inside the httpresponsemessage
                logger.LogFunc("Inside the GetValuesForEntry inside the DataModel Class and have found " + data.fName + " " + data.lName); //Logging success
                return(Request.CreateErrorResponse(HttpStatusCode.OK, json));                                                              //Returning successmessage and data
            }
            catch (FaultException <ExceptionDetail> e)                                                                                     //If it fails
            {
                logger.LogFunc("Inside Get Values For Entry: " + "Message: " + e.Message + " StackTrace: " + e.StackTrace);                //Logging that it failed
                HttpResponseMessage hrm = Request.CreateResponse(HttpStatusCode.NotFound);                                                 //Status code for caller
                hrm.Content = new StringContent("Value was not found at that index");                                                      //Error message for user
                return(hrm);
            }
        }
Exemplo n.º 3
0
 public void GetValuesForEntry(int index, out uint acctNo, out uint pin, out string fName, out string lName, out int bal)
 {
     data.GetValuesForEntry(index, out acctNo, out pin, out fName, out lName, out bal);
 }
 public void GetValuesForEntry(int index, out uint aN, out uint pin, out int bal, out string fName, out string lName)
 {
     log("Search for index was executed for index:" + " " + index + " ");
     dataServer.GetValuesForEntry(index, out aN, out pin, out bal, out fName, out lName);
 }
Exemplo n.º 5
0
 public void GetValuesForEntry(int index, out uint acctNo, out uint pin, out string fName, out string lName, out int bal)
 {
     Log(String.Concat("Retrieved values at index ", index.ToString()));
     data.GetValuesForEntry(index, out acctNo, out pin, out fName, out lName, out bal);
 }