public Form1(String paymentMethod, int customerIndex, PaymentClass p) { InitializeComponent(); this.customerIndex = customerIndex; this.paymentMethod = paymentMethod; this.p = p; }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); PaymentClass p = new PaymentClass(); Application.Run(new Form1("", 0, p)); }
public static void add(PaymentClass p) { SqlCommand sqlCommand = new SqlCommand("insert into payment values (@id,@fn,@ln,@cn,@ba,@d)", DBUtil.getSqlConnection()); sqlCommand.Parameters.AddWithValue("@id", p.Billing); sqlCommand.Parameters.AddWithValue("@fn", p.CreditCardType); sqlCommand.Parameters.AddWithValue("@ln", p.CreditCardNumber); sqlCommand.Parameters.AddWithValue("@cn", p.ExpirationMonth); sqlCommand.Parameters.AddWithValue("@ba", p.ExpirationYear.ToString()); sqlCommand.Parameters.AddWithValue("@d", p.DefaultBillingPeriod); sqlCommand.ExecuteNonQuery(); }