public ReedeemTicketDetailsComms RedeemTicketCompleteComms(ReedeemTicketDetailsComms TicketDetailComms)
        {
            //Add additional parameter to update clientsitecode from client

            try
            {
                SqlParameter[] oSQLParams = new SqlParameter[5];

                SqlParameter objSQLParam = new SqlParameter();
                objSQLParam.ParameterName = "Barcode";
                objSQLParam.Value = TicketDetailComms.Barcode;
                objSQLParam.Direction = ParameterDirection.Input;
                oSQLParams[0] = objSQLParam;

                objSQLParam = new SqlParameter();
                objSQLParam.ParameterName = "DeviceID";
                objSQLParam.Value = TicketDetailComms.DeviceId;
                objSQLParam.Direction = ParameterDirection.Input;
                oSQLParams[1] = objSQLParam;

                objSQLParam = new SqlParameter();
                objSQLParam.ParameterName = "retResult";
                objSQLParam.Direction = ParameterDirection.Output;
                objSQLParam.SqlDbType = SqlDbType.Int;
                oSQLParams[2] = objSQLParam;


                objSQLParam = new SqlParameter();
                objSQLParam.ParameterName = "iVoucherID";
                objSQLParam.Direction = ParameterDirection.Output;
                objSQLParam.SqlDbType = SqlDbType.Int;
                oSQLParams[3] = objSQLParam;

                objSQLParam = new SqlParameter();
                objSQLParam.ParameterName = "iClientSiteCode";
                objSQLParam.Value = TicketDetailComms.ClientSiteCode;
                objSQLParam.Direction = ParameterDirection.Input;
                objSQLParam.SqlDbType = SqlDbType.VarChar;
                oSQLParams[4] = objSQLParam;

                SqlHelper.ExecuteNonQuery(CommonDataAccess.ExchangeConnectionString, CommandType.StoredProcedure, "esp_RedeemTicketComplete", oSQLParams);

                LogManager.WriteLog("<CrossTicketing>   esp_RedeemTicketComplete after SP CALL", LogManager.enumLogLevel.Info);

                int nResult, nVoucherid;
                bool bResult = int.TryParse(Convert.ToString(oSQLParams[2].Value),out nResult);
                bResult= int.TryParse(Convert.ToString(oSQLParams[3].Value), out nVoucherid);

                TicketDetailComms.retResult = nResult;
                TicketDetailComms.iVoucherid = nVoucherid;

                LogManager.WriteLog("<CrossTicketing>   esp_RedeemTicketComplete returns: " + TicketDetailComms.retResult.ToString() + " | nVoucherid" + nVoucherid.ToString(), LogManager.enumLogLevel.Info);

            }

            catch (Exception ex)
            {
                ExceptionManager.Publish(ex);
            }

            return TicketDetailComms;
        }
        public ReedeemTicketDetailsComms RedeemTicketCancelComms(ReedeemTicketDetailsComms TicketDetailComms)
        {

            try
            {
                SqlParameter[] oSQLParams = new SqlParameter[5];

                SqlParameter objSQLParam = new SqlParameter();
                objSQLParam.ParameterName = "Barcode";
                objSQLParam.Value = TicketDetailComms.Barcode;
                objSQLParam.Direction = ParameterDirection.Input;
                oSQLParams[0] = objSQLParam;

                objSQLParam = new SqlParameter();
                objSQLParam.ParameterName = "DeviceID";
                objSQLParam.Value = TicketDetailComms.DeviceId;
                objSQLParam.Direction = ParameterDirection.Input;
                oSQLParams[1] = objSQLParam;

                objSQLParam = new SqlParameter();
                objSQLParam.ParameterName = "iError_Code";
                objSQLParam.Value = TicketDetailComms.iErrorCode;
                objSQLParam.Direction = ParameterDirection.Input;
                objSQLParam.SqlDbType = SqlDbType.Int;
                oSQLParams[2] = objSQLParam;

                objSQLParam = new SqlParameter();
                objSQLParam.ParameterName = "retResult";
                objSQLParam.Direction = ParameterDirection.Output;
                objSQLParam.SqlDbType = SqlDbType.Int;
                oSQLParams[3] = objSQLParam;

                objSQLParam = new SqlParameter();
                objSQLParam.ParameterName = "iClientSiteCode";
                objSQLParam.Value = TicketDetailComms.ClientSiteCode;
                objSQLParam.Direction = ParameterDirection.Input;
                objSQLParam.SqlDbType = SqlDbType.VarChar;
                oSQLParams[4] = objSQLParam;


                SqlHelper.ExecuteNonQuery(CommonDataAccess.ExchangeConnectionString, CommandType.StoredProcedure, "esp_RedeemTicketCancel", oSQLParams);

                TicketDetailComms.retResult = int.Parse(oSQLParams[3].Value.ToString());

                LogManager.WriteLog("<CrossTicketing>   esp_RedeemTicketCancel returns: " + TicketDetailComms.retResult.ToString(), LogManager.enumLogLevel.Info);

            }

            catch (Exception ex)
            {
                ExceptionManager.Publish(ex);
            }

            return TicketDetailComms;
        }
        public ReedeemTicketDetailsComms RedeemTicketStartComms(ReedeemTicketDetailsComms TicketDetailComms)
        {

            try
            {
                SqlParameter[] oSQLParams = new SqlParameter[7];

                SqlParameter objSQLParam = new SqlParameter();
                objSQLParam.ParameterName = "Barcode";
                objSQLParam.Value = TicketDetailComms.Barcode;
                objSQLParam.Direction = ParameterDirection.Input;
                oSQLParams[0] = objSQLParam;

                LogManager.WriteLog("<CrossTicketing>   Esp_redeemticketstart Barcode: " + TicketDetailComms.Barcode, LogManager.enumLogLevel.Info);

                objSQLParam = new SqlParameter();
                objSQLParam.ParameterName = "DeviceID";
                objSQLParam.Value = TicketDetailComms.DeviceId;
                objSQLParam.Direction = ParameterDirection.Input;
                oSQLParams[1] = objSQLParam;

                LogManager.WriteLog("<CrossTicketing>   Esp_redeemticketstart DeviceID: " + TicketDetailComms.DeviceId, LogManager.enumLogLevel.Info);

                objSQLParam = new SqlParameter();
                objSQLParam.ParameterName = "ClSiteCode";
                objSQLParam.Value = TicketDetailComms.ClientSiteCode;
                objSQLParam.Direction = ParameterDirection.Input;
                oSQLParams[2] = objSQLParam;

                LogManager.WriteLog("<CrossTicketing>   Esp_redeemticketstart ClSiteCode: " + TicketDetailComms.ClientSiteCode, LogManager.enumLogLevel.Info);

                objSQLParam = new SqlParameter();
                objSQLParam.ParameterName = "retAmount";
                objSQLParam.Value = TicketDetailComms.retAmount;
                objSQLParam.Direction = ParameterDirection.Output;
                objSQLParam.SqlDbType = SqlDbType.Int;
                oSQLParams[3] = objSQLParam;

                LogManager.WriteLog("<CrossTicketing>   Esp_redeemticketstart retAmount: " + TicketDetailComms.retAmount, LogManager.enumLogLevel.Info);

                objSQLParam = new SqlParameter();
                objSQLParam.ParameterName = "retResult";
                objSQLParam.Direction = ParameterDirection.Output;
                objSQLParam.SqlDbType = SqlDbType.Int;
                oSQLParams[4] = objSQLParam;

                objSQLParam = new SqlParameter();
                objSQLParam.ParameterName = "retBarcode";
                objSQLParam.Value = string.Empty;
                objSQLParam.Direction = ParameterDirection.Output;
                objSQLParam.SqlDbType = SqlDbType.VarChar;
                oSQLParams[5] = objSQLParam;

                objSQLParam = new SqlParameter();
                objSQLParam.ParameterName = "retTicketType";
                objSQLParam.Direction = ParameterDirection.Output;
                objSQLParam.SqlDbType = SqlDbType.Int;
                oSQLParams[6] = objSQLParam;

                SqlHelper.ExecuteNonQuery(CommonDataAccess.ExchangeConnectionString, CommandType.StoredProcedure, "Esp_redeemticketstart", oSQLParams);

                bool bResult;
                int nretAmount, nretResult, nretTicketType;

                
                bResult = int.TryParse(Convert.ToString(oSQLParams[3].Value), out nretAmount);
                LogManager.WriteLog("<CrossTicketing>   Esp_redeemticketstart returns nretAmount: " + nretAmount.ToString(), LogManager.enumLogLevel.Info);
                bResult = int.TryParse(Convert.ToString(oSQLParams[4].Value), out nretResult);
                LogManager.WriteLog("<CrossTicketing>   Esp_redeemticketstart returns nretResult: " + nretResult.ToString(), LogManager.enumLogLevel.Info);

                TicketDetailComms.retAmount=  nretAmount;
                TicketDetailComms.retResult = nretResult;
                //TicketDetailComms.retBarcode = Convert.ToString(oSQLParams[5].Value);
                //LogManager.WriteLog("<CrossTicketing>   Esp_redeemticketstart returns retBarcode: " + TicketDetailComms.retBarcode, LogManager.enumLogLevel.Info);
                //TicketDetailComms.retTicketType = int.Parse(oSQLParams[6].Value.ToString());
                bResult = int.TryParse(Convert.ToString(oSQLParams[6].Value), out nretTicketType);
                TicketDetailComms.retTicketType = bResult ? nretTicketType : 0;
                LogManager.WriteLog("<CrossTicketing>   Esp_redeemticketstart returns retTicketType: " + TicketDetailComms.retTicketType, LogManager.enumLogLevel.Info);

                LogManager.WriteLog("<CrossTicketing>   Esp_redeemticketstart returns: " + TicketDetailComms.retResult.ToString(), LogManager.enumLogLevel.Info);

            }

            catch (Exception ex)
            {
                ExceptionManager.Publish(ex);
            }

            return TicketDetailComms;
        }
        public bool ImportVoucherDetailsComms(ReedeemTicketDetailsComms TicketDetail)
        {
            bool bSuccess = false;
            try
            {
                SqlParameter[] oSQLParams = new SqlParameter[4];

                SqlParameter objSQLParam = new SqlParameter();
                objSQLParam.ParameterName = "doc";
                objSQLParam.Value = TicketDetail.VoucherXMLData;
                objSQLParam.Direction = ParameterDirection.Input;
                oSQLParams[0] = objSQLParam;

                objSQLParam = new SqlParameter();
                objSQLParam.ParameterName = "DeviceName";
                objSQLParam.Value = TicketDetail.DeviceId;
                objSQLParam.Direction = ParameterDirection.Input;
                oSQLParams[1] = objSQLParam;


                objSQLParam = new SqlParameter();
                objSQLParam.ParameterName = "RedeemUserName";
                objSQLParam.Value = "";
                objSQLParam.Direction = ParameterDirection.Input;
                oSQLParams[2] = objSQLParam;

                objSQLParam = new SqlParameter();
                objSQLParam.ParameterName = "IsSuccess";
                objSQLParam.Direction = ParameterDirection.Output;
                objSQLParam.SqlDbType = SqlDbType.Int;
                oSQLParams[3] = objSQLParam;

         

                SqlHelper.ExecuteNonQuery(CommonDataAccess.TicketingConnectionString, CommandType.StoredProcedure, "RSP_IMPORTVOUCHERDETAILS", oSQLParams);

                if (int.Parse(oSQLParams[3].Value.ToString()) == 0)
                {
                    bSuccess = true;
                    LogManager.WriteLog("<CrossTicketing>   ImportVoucherDetails Call Success", LogManager.enumLogLevel.Info);
                }
                else
                {
                    bSuccess = false;
                    LogManager.WriteLog("<CrossTicketing>   ImportVoucherDetails Call " + "  failed due to " + oSQLParams[1].Value.ToString(), LogManager.enumLogLevel.Info);
                }
            }

            catch (Exception ex)
            {
                ExceptionManager.Publish(ex);
                bSuccess = false;
            }

            return bSuccess;
        }
Exemplo n.º 5
0
 public bool ImportVoucherDetailsComms(ReedeemTicketDetailsComms objReedeemTicketDetailsComms)
 {
     return redeemTicketDB.ImportVoucherDetailsComms(objReedeemTicketDetailsComms);
 }
Exemplo n.º 6
0
 public ReedeemTicketDetailsComms RedeemTicketCancelComms(ReedeemTicketDetailsComms TicketDetailComms)
 {
     return redeemTicketDB.RedeemTicketCancelComms(TicketDetailComms);
 }
Exemplo n.º 7
0
 public ReedeemTicketDetailsComms RedeemTicketStartComms(ReedeemTicketDetailsComms TicketDetailComms)
 {
     return redeemTicket.RedeemTicketStartComms(TicketDetailComms);
 }