Ejemplo n.º 1
0
        public CarExtraArr GetCarExtraBuy(PayBuy payBuy)
        {
            OrderBuy           order = payBuy.Order;
            OrderDetailsBuyArr orderDetailsBuyArr = new OrderDetailsBuyArr();

            orderDetailsBuyArr.Fill();
            orderDetailsBuyArr = orderDetailsBuyArr.Filter(order);

            return(orderDetailsBuyArr.GetCarExtraArr());
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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";
        }
Ejemplo n.º 4
0
        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();
                        }
                    }
                }
            }
        }