Пример #1
0
        /// <summary>
        /// Create a StartTransaction XML/SOAP request.
        /// </summary>
        /// <param name="TransactionId">The transaction identification copied from the start transaction response.</param>
        /// <param name="Timestamp">The timestamp of the end of the charging transaction.</param>
        /// <param name="MeterStop">The energy meter value in Wh for the connector at end of the charging transaction.</param>
        /// <param name="IdTag">An optional identifier which requested to stop the charging.</param>
        /// <param name="Reason">An optional reason why the transaction had been stopped.</param>
        /// <param name="TransactionData">Optional transaction usage details relevant for billing purposes.</param>
        public StopTransactionRequest(Transaction_Id TransactionId,
                                      DateTime Timestamp,
                                      UInt64 MeterStop,
                                      IdToken?IdTag  = null,
                                      Reasons?Reason = null,
                                      IEnumerable <MeterValue> TransactionData = null)

        {
            this.TransactionId   = TransactionId;
            this.Timestamp       = Timestamp;
            this.MeterStop       = MeterStop;
            this.IdTag           = IdTag ?? new IdToken?();
            this.Reason          = Reason ?? new Reasons?();
            this.TransactionData = TransactionData ?? new MeterValue[0];
        }
Пример #2
0
        /// <summary>
        /// Create a new SetEVSEBusyStatus response.
        /// </summary>
        /// <param name="Request">The SetEVSEBusyStatus request leading to this response.</param>
        /// <param name="TransactionId">A transaction identification.</param>
        /// <param name="RequestStatus">The status of the request.</param>
        ///
        /// <param name="HTTPResponse">The correlated HTTP response of this eMIP response.</param>
        /// <param name="CustomData">Optional additional customer-specific data.</param>
        public SetEVSEBusyStatusResponse(SetEVSEBusyStatusRequest Request,
                                         Transaction_Id TransactionId,
                                         RequestStatus RequestStatus,

                                         HTTPResponse HTTPResponse = null,
                                         IReadOnlyDictionary <String, Object> CustomData = null)

            : base(Request,
                   TransactionId,
                   RequestStatus,
                   HTTPResponse,
                   CustomData)

        {
        }
Пример #3
0
        /// <summary>
        /// Create a new SetChargingStationAvailabilityStatus response.
        /// </summary>
        /// <param name="Request">The SetChargingStationAvailabilityStatus request leading to this response.</param>
        /// <param name="TransactionId">A transaction identification.</param>
        /// <param name="RequestStatus">The status of the request.</param>
        ///
        /// <param name="HTTPResponse">The correlated HTTP response of this eMIP response.</param>
        /// <param name="CustomData">Optional additional customer-specific data.</param>
        public SetChargingStationAvailabilityStatusResponse(SetChargingStationAvailabilityStatusRequest Request,
                                                            Transaction_Id TransactionId,
                                                            RequestStatus RequestStatus,

                                                            HTTPResponse HTTPResponse = null,
                                                            IReadOnlyDictionary <String, Object> CustomData = null)

            : base(Request,
                   TransactionId,
                   RequestStatus,
                   HTTPResponse,
                   CustomData)

        {
        }
        /// <summary>
        /// Create a new SetChargeDetailRecord response.
        /// </summary>
        /// <param name="Request">The SetChargeDetailRecord request leading to this response.</param>
        /// <param name="TransactionId">A transaction identification.</param>
        /// <param name="RequestStatus">The status of the request.</param>
        ///
        /// <param name="HTTPResponse">The correlated HTTP response of this eMIP response.</param>
        /// <param name="CustomData">Optional additional customer-specific data.</param>
        public SetChargeDetailRecordResponse(SetChargeDetailRecordRequest Request,
                                             Transaction_Id TransactionId,
                                             RequestStatus RequestStatus,

                                             HTTPResponse HTTPResponse = null,
                                             IReadOnlyDictionary <String, Object> CustomData = null)

            : this(Request,
                   TransactionId,
                   RequestStatus,
                   null,
                   HTTPResponse,
                   CustomData)

        {
        }
Пример #5
0
        /// <summary>
        /// Create a new RemoteStopTransaction request.
        /// </summary>
        /// <param name="ChargeBoxId">The charge box identification.</param>
        /// <param name="TransactionId">The identification of the transaction which the charge point is requested to stop.</param>
        ///
        /// <param name="RequestId">An optional request identification.</param>
        /// <param name="RequestTimestamp">An optional request timestamp.</param>
        public RemoteStopTransactionRequest(ChargeBox_Id ChargeBoxId,
                                            Transaction_Id TransactionId,

                                            Request_Id?RequestId             = null,
                                            DateTime?RequestTimestamp        = null,
                                            EventTracking_Id EventTrackingId = null)

            : base(ChargeBoxId,
                   "RemoteStopTransaction",
                   RequestId,
                   EventTrackingId,
                   RequestTimestamp)

        {
            this.TransactionId = TransactionId;
        }
        /// <summary>
        /// Create a new Heartbeat response.
        /// </summary>
        /// <param name="Request">The Heartbeat request leading to this response.</param>
        /// <param name="TransactionId">A transaction identification.</param>
        /// <param name="RequestStatus">The status of the request.</param>
        ///
        /// <param name="HTTPResponse">The correlated HTTP response of this eMIP response.</param>
        /// <param name="CustomData">Optional additional customer-specific data.</param>
        public HeartbeatResponse(HeartbeatRequest Request,
                                 Transaction_Id TransactionId,
                                 RequestStatus RequestStatus,

                                 HTTPResponse HTTPResponse = null,
                                 IReadOnlyDictionary <String, Object> CustomData = null)

            : this(Request,
                   TimeSpan.FromMinutes(5),
                   DateTime.UtcNow,
                   TransactionId,
                   RequestStatus,
                   HTTPResponse,
                   CustomData)

        {
        }
Пример #7
0
        /// <summary>
        /// Create a new SetServiceAuthorisation response.
        /// </summary>
        /// <param name="Request">The SetServiceAuthorisation request leading to this response.</param>
        /// <param name="TransactionId">A transaction identification.</param>
        /// <param name="RequestStatus">The status of the request.</param>
        ///
        /// <param name="PartnerServiceSessionId">The GIREVE session id for this service session.</param>
        /// <param name="HTTPResponse">The correlated HTTP response of this eMIP response.</param>
        /// <param name="CustomData">Optional additional customer-specific data.</param>
        public SetServiceAuthorisationResponse(SetServiceAuthorisationRequest Request,
                                               Transaction_Id TransactionId,
                                               RequestStatus RequestStatus,

                                               PartnerServiceSession_Id?PartnerServiceSessionId = null,
                                               HTTPResponse HTTPResponse = null,
                                               IReadOnlyDictionary <String, Object> CustomData = null)

            : base(Request,
                   TransactionId,
                   RequestStatus,
                   HTTPResponse,
                   CustomData)

        {
            this.PartnerServiceSessionId = PartnerServiceSessionId;
        }
        /// <summary>
        /// Create a new heartbeat response.
        /// </summary>
        /// <param name="Request">The Heartbeat request leading to this response.</param>
        /// <param name="HeartbeatPeriod">A heartbeat period.</param>
        /// <param name="CurrentTime">The current time.</param>
        /// <param name="TransactionId">A transaction identification.</param>
        /// <param name="RequestStatus">The status of the request.</param>
        ///
        /// <param name="HTTPResponse">The correlated HTTP response of this eMIP response.</param>
        /// <param name="CustomData">Optional additional customer-specific data.</param>
        public HeartbeatResponse(HeartbeatRequest Request,
                                 TimeSpan HeartbeatPeriod,
                                 DateTime CurrentTime,
                                 Transaction_Id TransactionId,
                                 RequestStatus RequestStatus,

                                 HTTPResponse HTTPResponse = null,
                                 IReadOnlyDictionary <String, Object> CustomData = null)

            : base(Request,
                   TransactionId,
                   RequestStatus,
                   HTTPResponse,
                   CustomData)

        {
            this.HeartbeatPeriod = HeartbeatPeriod;
            this.CurrentTime     = CurrentTime;
        }
        /// <summary>
        /// Create a new SetSessionEventReport response.
        /// </summary>
        /// <param name="Request">The SetSessionEventReport request leading to this response.</param>
        /// <param name="TransactionId">A transaction identification.</param>
        /// <param name="RequestStatus">The status of the request.</param>
        /// <param name="ServiceSessionId">The service session identification.</param>
        /// <param name="SessionActionId">The unique identification of the session action.</param>
        ///
        /// <param name="HTTPResponse">The correlated HTTP response of this eMIP response.</param>
        /// <param name="CustomData">Optional additional customer-specific data.</param>
        public SetSessionEventReportResponse(SetSessionEventReportRequest Request,
                                             Transaction_Id TransactionId,
                                             RequestStatus RequestStatus,
                                             ServiceSession_Id ServiceSessionId,
                                             SessionAction_Id SessionActionId,

                                             HTTPResponse HTTPResponse = null,
                                             IReadOnlyDictionary <String, Object> CustomData = null)

            : base(Request,
                   TransactionId,
                   RequestStatus,
                   HTTPResponse,
                   CustomData)

        {
            this.ServiceSessionId = ServiceSessionId;
            this.SessionActionId  = SessionActionId;
        }
Пример #10
0
        /// <summary>
        /// Create a new SetChargeDetailRecord response.
        /// </summary>
        /// <param name="Request">The SetChargeDetailRecord request leading to this response.</param>
        /// <param name="TransactionId">A transaction identification.</param>
        /// <param name="ServiceSessionId">The service session identification.</param>
        /// <param name="RequestStatus">The status of the request.</param>
        ///
        /// <param name="SalesPartnerOperatorId">An optional sales partner operator identification.</param>
        /// <param name="HTTPResponse">The correlated HTTP response of this eMIP response.</param>
        /// <param name="CustomData">Optional additional customer-specific data.</param>
        public SetChargeDetailRecordResponse(SetChargeDetailRecordRequest Request,
                                             Transaction_Id TransactionId,
                                             ServiceSession_Id ServiceSessionId,
                                             RequestStatus RequestStatus,

                                             PartnerOperator_Id?SalesPartnerOperatorId = null,
                                             HTTPResponse HTTPResponse = null,
                                             IReadOnlyDictionary <String, Object> CustomData = null)

            : base(Request,
                   TransactionId,
                   RequestStatus,
                   HTTPResponse,
                   CustomData)

        {
            this.ServiceSessionId       = ServiceSessionId;
            this.SalesPartnerOperatorId = SalesPartnerOperatorId;
        }
        /// <summary>
        /// Create a new SetServiceAuthorisation response.
        /// </summary>
        /// <param name="Request">The SetServiceAuthorisation request leading to this response.</param>
        /// <param name="TransactionId">A transaction identification.</param>
        /// <param name="RequestStatus">The status of the request.</param>
        /// <param name="ServiceSessionId">The GIREVE session id for this service session.</param>
        ///
        /// <param name="ExecPartnerOperatorId">The operator identification of the executing operator.</param>
        /// <param name="HTTPResponse">The correlated HTTP response of this eMIP response.</param>
        /// <param name="CustomData">Optional additional customer-specific data.</param>
        public SetServiceAuthorisationResponse(SetServiceAuthorisationRequest Request,
                                               Transaction_Id TransactionId,
                                               RequestStatus RequestStatus,
                                               ServiceSession_Id ServiceSessionId,

                                               Operator_Id?ExecPartnerOperatorId = null,
                                               HTTPResponse HTTPResponse         = null,
                                               IReadOnlyDictionary <String, Object> CustomData = null)

            : base(Request,
                   TransactionId,
                   RequestStatus,
                   HTTPResponse,
                   CustomData)

        {
            this.ServiceSessionId      = ServiceSessionId;
            this.ExecPartnerOperatorId = ExecPartnerOperatorId;
        }
        /// <summary>
        /// Create a new GetServiceAuthorisation response.
        /// </summary>
        /// <param name="Request">The GetServiceAuthorisation request leading to this response.</param>
        /// <param name="TransactionId">A transaction identification.</param>
        /// <param name="RequestStatus">The status of the request.</param>
        ///
        /// <param name="HTTPResponse">The correlated HTTP response of this eMIP response.</param>
        /// <param name="CustomData">Optional additional customer-specific data.</param>
        public GetServiceAuthorisationResponse(GetServiceAuthorisationRequest Request,
                                               Transaction_Id TransactionId,
                                               RequestStatus RequestStatus,

                                               HTTPResponse HTTPResponse = null,
                                               IReadOnlyDictionary <String, Object> CustomData = null)

            : this(Request,
                   TransactionId,
                   AuthorisationValues.KO,
                   PartnerServiceSession_Id.Zero,
                   false,
                   RequestStatus,
                   null,
                   null,
                   null,
                   HTTPResponse,
                   CustomData)

        {
        }
Пример #13
0
        /// <summary>
        /// Create a new OCPP start transaction response.
        /// </summary>
        /// <param name="TransactionId">The transaction identification assigned by the central system.</param>
        /// <param name="IdTagInfo">Information about authorization status, expiry and parent id.</param>
        public StartTransactionResponse(Transaction_Id TransactionId,
                                        IdTagInfo IdTagInfo)

            : base(Result.OK())

        {
            #region Initial checks

            if (TransactionId == null)
            {
                throw new ArgumentNullException(nameof(TransactionId), "The given transaction identification must not be null!");
            }

            if (IdTagInfo == null)
            {
                throw new ArgumentNullException(nameof(IdTagInfo), "The given identification tag info must not be null!");
            }

            #endregion

            this.TransactionId = TransactionId;
            this.IdTagInfo     = IdTagInfo;
        }
Пример #14
0
        /// <summary>
        /// Create a new StartTransaction request.
        /// </summary>
        /// <param name="ChargeBoxId">The charge box identification.</param>
        /// <param name="TransactionId">The transaction identification copied from the start transaction response.</param>
        /// <param name="Timestamp">The timestamp of the end of the charging transaction.</param>
        /// <param name="MeterStop">The energy meter value in Wh for the connector at end of the charging transaction.</param>
        /// <param name="IdTag">An optional identifier which requested to stop the charging.</param>
        /// <param name="Reason">An optional reason why the transaction had been stopped.</param>
        /// <param name="TransactionData">Optional transaction usage details relevant for billing purposes.</param>
        ///
        /// <param name="RequestId">An optional request identification.</param>
        /// <param name="RequestTimestamp">An optional request timestamp.</param>
        public StopTransactionRequest(ChargeBox_Id ChargeBoxId,
                                      Transaction_Id TransactionId,
                                      DateTime Timestamp,
                                      UInt64 MeterStop,
                                      IdToken?IdTag  = null,
                                      Reasons?Reason = null,
                                      IEnumerable <MeterValue> TransactionData = null,

                                      Request_Id?RequestId      = null,
                                      DateTime?RequestTimestamp = null)

            : base(ChargeBoxId,
                   "StopTransaction",
                   RequestId,
                   RequestTimestamp)

        {
            this.TransactionId   = TransactionId;
            this.Timestamp       = Timestamp;
            this.MeterStop       = MeterStop;
            this.IdTag           = IdTag ?? new IdToken?();
            this.Reason          = Reason ?? new Reasons?();
            this.TransactionData = TransactionData ?? new MeterValue[0];
        }
Пример #15
0
        private void initialize_UI()
        {
            if (Type == 0)
            {
                /* Hide UI */
                cus_label.Visible         = false;
                phone_label.Visible       = false;
                customer_name_out.Visible = false;
                phone_no_out.Visible      = false;

                /* Puchase Transaction */
                type_out.Text = "Purchase Transaction";
                this.Text     = "Purchase Transaction";

                // bind transaction information
                transaction_id_out.Text = Transaction_Id.ToString();
                string  qryString = "select Date, Employee.Name as Employee_Name, Representative.Name as Representative_Name from PurchaseTransaction, Employee, Representative where Employee_Id=Employee.Id and Representative_Id=Representative.Id and PurchaseTransaction.Id=" + Transaction_Id.ToString();
                DataSet tran_data = DatabaseManager.resultQuery(qryString);
                date_out.Text                = Convert.ToDateTime(tran_data.Tables[0].Rows[0]["Date"].ToString()).ToLongDateString();
                employee_name_out.Text       = tran_data.Tables[0].Rows[0]["Employee_Name"].ToString();
                representative_name_out.Text = tran_data.Tables[0].Rows[0]["Representative_Name"].ToString();

                // bind product list
                qryString = "select Product_Id, Product.Name as Product_Name, Quantity, TransactionProductRecord.Price as Price from TransactionProductRecord, Product where Product_Id=Product.Id and Type=" + Type.ToString() + " and Transaction_Id=" + Transaction_Id.ToString() + " ";
                DataSet prod_data = DatabaseManager.resultQuery(qryString);
                product_grid_view.DataSource = prod_data.Tables[0];

                // total price
                Total_Price = 0;
                foreach (DataGridViewRow product in product_grid_view.Rows)
                {
                    try {
                        Total_Price += ((int)product.Cells["Quantity"].Value) * ((int)product.Cells["Price"].Value);
                    } catch (Exception exep) {
                    }
                }
                total_price_out.Text = Total_Price.ToString() + "  taka only";
            }
            else
            {
                /* Sales Transaction*/
                type_out.Text = "Sales Transaction";
                this.Text     = "Sales Transaction";

                /* Hide UI */
                representative_name_out.Visible = false;
                rep_label.Visible = false;

                // bind transaction information
                transaction_id_out.Text = Transaction_Id.ToString();
                string  qryString = "select Date, Employee.Name as Employee_Name, Customer_Name, Customer_Contact_No from SalesTransaction, Employee where Employee_Id=Employee.Id and SalesTransaction.Id=" + Transaction_Id.ToString();
                DataSet tran_data = DatabaseManager.resultQuery(qryString);
                date_out.Text          = Convert.ToDateTime(tran_data.Tables[0].Rows[0]["Date"].ToString()).ToLongDateString();
                employee_name_out.Text = tran_data.Tables[0].Rows[0]["Employee_Name"].ToString();
                customer_name_out.Text = tran_data.Tables[0].Rows[0]["Customer_Name"].ToString();
                phone_no_out.Text      = tran_data.Tables[0].Rows[0]["Customer_Contact_No"].ToString();

                // bind product list
                qryString = "select Product_Id, Product.Name as Product_Name, Quantity, TransactionProductRecord.Price as Price from TransactionProductRecord, Product where Product_Id=Product.Id and Type=" + Type.ToString() + " and Transaction_Id=" + Transaction_Id.ToString() + " ";
                DataSet prod_data = DatabaseManager.resultQuery(qryString);
                product_grid_view.DataSource = prod_data.Tables[0];

                // total price
                Total_Price = 0;
                foreach (DataGridViewRow product in product_grid_view.Rows)
                {
                    try {
                        Total_Price += ((int)product.Cells["Quantity"].Value) * ((int)product.Cells["Price"].Value);
                    } catch (Exception exep) {
                    }
                }
                total_price_out.Text = Total_Price.ToString() + "  taka only";
            }
        }