コード例 #1
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Transactions EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToTransactions(Transaction transaction)
 {
     base.AddObject("Transactions", transaction);
 }
コード例 #2
0
        /// <summary>
        /// Tested..
        /// When transaction is selected, it will get the transaction details into the textboxes and datepickers
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void selectTransaction(object sender, MouseButtonEventArgs e)
        {
            if (sender != null)
            {
                DataGrid grid = sender as DataGrid;
                if (grid != null && grdTransacData.SelectedItems != null && grdTransacData.SelectedItems.Count == 1)
                {
                    Transaction selectedTransac = (Transaction) grdTransacData.SelectedItems[0];
                    currentTransaction = selectedTransac;
                    //string serviceID = row["ServiceID"].ToString();
                    //Transaction selectedTransac= CoreOperations.GetAllTransactions(default(DateTime), default(DateTime), string.Empty, string.Empty, string.Empty, serviceID).First();
                    txtCustName.Text = selectedTransac.Vehicle.Customer.Name;
                    txtOperations.Text = selectedTransac.Operation.Name;
                    txtTech.Text = selectedTransac.Technician.Name;
                    startDatePicker.Value = selectedTransac.StartDate;
                    endDatePicker.Value = selectedTransac.EndDate;
                    txtPayment.Text = selectedTransac.PaymentAmount.Value.ToString();
                    txtPaymentDetails.Text = selectedTransac.PaymentStatus;
                    txtRegID.Text = selectedTransac.Vehicle.RegistrationNumber;
                    txtCustPhone.Text = selectedTransac.Vehicle.Customer.Phone;
                    txtServiceID.Text = selectedTransac.ServiceId;
                }

            }
        }
コード例 #3
0
 /// <summary>
 /// Create a new Transaction object.
 /// </summary>
 /// <param name="serviceId">Initial value of the ServiceId property.</param>
 public static Transaction CreateTransaction(global::System.String serviceId)
 {
     Transaction transaction = new Transaction();
     transaction.ServiceId = serviceId;
     return transaction;
 }