public CarExtraArr GetCarExtraBuy(PayBuy payBuy) { OrderBuy order = payBuy.Order; OrderDetailsBuyArr orderDetailsBuyArr = new OrderDetailsBuyArr(); orderDetailsBuyArr.Fill(); orderDetailsBuyArr = orderDetailsBuyArr.Filter(order); return(orderDetailsBuyArr.GetCarExtraArr()); }
private PayBuy FormToPayBuy(OrderBuy orderBuy) { PayBuy pay = new PayBuy(); pay.Id = int.Parse(lbl_Idtxt.Text); pay.FullName = txt_FullName.Text; pay.CardNumber = txt_Card.Text; pay.Date = GetDate(); pay.CVC = txt_CVC.Text; pay.Order = orderBuy; return(pay); }
public Form_Invoice(PayBuy payBuy) { InitializeComponent(); newpayBuy = payBuy; DoesBuy = true; AddItemToList(newpayBuy.Order.Product, 1); AddItemToList(newpayBuy.Order.CarDesign, 1); AddItemsToList(GetCarExtraBuy(newpayBuy)); client = newpayBuy.Order.Client; digits = newpayBuy.CardNumber.Substring(newpayBuy.CardNumber.Length - 4); Id = newpayBuy.Order.Id; status = "Buy"; }
private void btn_Save_Click(object sender, EventArgs e) { // שומר את המידע שקיבלנו לטבלה if (CheckForm()) { if (DoesBuy) { PayBuy payBuy = FormToPayBuy(neworderBuy); if (payBuy.Id == 0) { if (payBuy.Insert()) { ClearForm(); Form_Invoice newform = new Form_Invoice(payBuy); Hide(); newform.ShowDialog(); Close(); } } } else { PayRent payRent = FormToPayRent(neworderRent); if (payRent.Id == 0) { if (payRent.Insert()) { ClearForm(); Form_Invoice newform = new Form_Invoice(payRent); Hide(); newform.ShowDialog(); Close(); } } } } }