Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="MethodType"></param>
        /// <param name="extradata1"></param>
        /// <param name="extradata2"></param>
        /// <param name="extradata3">This parameter is used to hold four boolean pieces of data</param>
        /// <returns></returns>
        internal override bool makeHTTPPost(HTTPPostType MethodType, string extradata1, string extradata2, string extradata3, ref LocationData.LocationTransactionData transaction)
        {
            //ErrorForm commwithserver = Program.ShowMessage("Communicating with\r\nServer...");
            string methodtype = "";
            NameValueCollection methodparams = new NameValueCollection();

            string securityToken = getDaimlerSecurityToken();

            if (securityToken == "")
            {
                Program.logEvent("Daimler Security Token Error");
                return(false);
            }

            switch (MethodType)
            {
            case HTTPPostType.CheckReservation:
                methodtype = "Reservation";
                methodparams.Add("kioskLocation", Program.KIOSK_ID);
                methodparams.Add("reservationNumber", extradata1.ToUpper());     //any alpha characters in the res number must be capitals
                methodparams.Add("accessToken", securityToken);
                break;

            case HTTPPostType.KeyOut:
                methodtype = "TransactionComplete";
                methodparams.Add("kioskLocation", Program.KIOSK_ID);
                methodparams.Add("transactionNumber", extradata1);
                methodparams.Add("reservationNumber", extradata2.ToUpper());
                methodparams.Add("status", "SUCCESS");
                methodparams.Add("accessToken", securityToken);
                break;

            case HTTPPostType.TransactionFail:
                int transnumindex = transaction.ObjectList.FindIndex(0, delegate(LocationTransactionData.TransactionDataObject ltd) { return(ltd.name == "Transaction"); });
                string TNumber = transaction.ObjectList[transnumindex].data.ToString();

                methodtype = "TransactionComplete";
                methodparams.Add("kioskLocation", Program.KIOSK_ID);
                methodparams.Add("transactionNumber", TNumber);
                methodparams.Add("reservationNumber", transaction.AccessCode.ToUpper());
                methodparams.Add("status", "FAIL");
                methodparams.Add("accessToken", securityToken);
                break;

            case HTTPPostType.RFIDInventory:
                methodtype = "RFIDInventory";
                methodparams.Add("kioskLocation", Program.KIOSK_ID);
                methodparams.Add("inventory", extradata1);
                methodparams.Add("accessToken", securityToken);
                break;
            }
            bool ret = PostWAWaterData(methodparams, Program.CUSTOMER_DATA_SERVER, methodtype, ref transaction);

            //commwithserver.Dispose();
            return(ret);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="MethodType"></param>
        /// <param name="extradata1"></param>
        /// <param name="extradata2"></param>
        /// <param name="extradata3">This parameter is used to hold four boolean pieces of data</param>
        /// <returns></returns>
        internal override bool makeHTTPPost(HTTPPostType MethodType, string extradata1, string extradata2, string extradata3, ref LocationData.LocationTransactionData transaction)
        {
            string methodtype = "";
            NameValueCollection methodparams = new NameValueCollection();

            switch (MethodType)
            {
            case HTTPPostType.CheckReservation:
                methodtype = "Reservation";
                methodparams.Add("clientName", "DCWATER");
                methodparams.Add("reservationNumber", extradata1.ToUpper());     //any alpha characters in the res number must be capitals
                methodparams.Add("authMethod", extradata2);
                methodparams.Add("HIDcode", extradata3);
                methodparams.Add("kioskNumber", Program.KIOSK_ID);
                break;

            case HTTPPostType.KeyOut:
                methodtype = "TransactionComplete";
                methodparams.Add("clientName", "DCWATER");
                methodparams.Add("transactionNumber", extradata1.Split(',')[0]);
                methodparams.Add("reservationNumber", extradata1.Split(',')[1].ToUpper());
                methodparams.Add("status", "SUCCESS");
                methodparams.Add("question1", extradata3.Substring(1, 1));
                methodparams.Add("question2", extradata3.Substring(2, 1));
                methodparams.Add("question3", extradata3.Substring(3, 1));
                methodparams.Add("UDF1", "0");
                methodparams.Add("UDF2", "0");
                methodparams.Add("UDF3", "0");
                methodparams.Add("UDF4", "0");
                methodparams.Add("UDF5", "0");
                methodparams.Add("UDF6", "0");
                methodparams.Add("authMethod", extradata2.Split(',')[0]);
                methodparams.Add("HIDcode", extradata2.Split(',')[1]);
                break;

            case HTTPPostType.TransactionFail:
                return(true);
            }
            return(PostHudsonData(methodparams, Program.CUSTOMER_DATA_SERVER, methodtype, ref transaction));
        }
        internal override bool makeHTTPPost(HTTPPostType MethodType, string extradata1, string extradata2, string extradata3)
        {
            LocationTransactionData fakedata = new HudsonTransactionData();

            return(makeHTTPPost(MethodType, extradata1, extradata2, extradata3, ref fakedata));
        }
Beispiel #4
0
 internal virtual bool makeHTTPPost(HTTPPostType MethodType, string extradata1, string extradata2, string extradata3, ref LocationData.LocationTransactionData transaction)
 {
     return(true);
 }
Beispiel #5
0
 /// <summary>
 /// This method is meant to be overridden by customers who need to access some online
 /// database for their transaction process.
 /// </summary>
 /// <param name="MethodType">Predetermined type of communication with server. Usually given as a
 ///                          method name at the end of the url</param>
 /// <param name="extradata">This can be used for whatever other data might be needed by the
 ///                         server communication</param>
 /// <returns></returns>
 internal virtual bool makeHTTPPost(HTTPPostType MethodType, string extradata1, string extradata2, string extradata3)
 {
     return(true);
 }