private void button19_Click(object sender, EventArgs e) { GlobalVariables.TransactionType = "Return"; if (lsvReturnItems_Returns.Items.Count > 0) { Form payment = new payment(this); payment.ShowDialog(); } else { MessageBox.Show("Please Add Items the Items to be Returned"); } }
private void button14_Click(object sender, EventArgs e) { GlobalVariables.cartTotal = Double.Parse(phoneOrderDataGridView.CurrentRow.Cells[1].Value.ToString()); GlobalVariables.customerName_Order = phoneOrderDataGridView.CurrentRow.Cells[2].Value.ToString(); GlobalVariables.customerCellNo_Order = phoneOrderDataGridView.CurrentRow.Cells[3].Value.ToString(); GlobalVariables.StaffID = int.Parse(phoneOrderDataGridView.CurrentRow.Cells[4].Value.ToString()); if (GlobalVariables.isMemeber) { GlobalVariables.MemberID = int.Parse(phoneOrderDataGridView.CurrentRow.Cells[5].Value.ToString()); } for (int i = 0; i < getPhoneOrderProductsDataGridView.Rows.Count - 1; i++) { GlobalVariables.productCart_ProductID.Add(getPhoneOrderProductsDataGridView.Rows[i].Cells[1].Value.ToString()); GlobalVariables.productCart_UnitPrice.Add(Double.Parse(getPhoneOrderProductsDataGridView.Rows[i].Cells[2].Value.ToString())); GlobalVariables.productCart_Quantity.Add(int.Parse(getPhoneOrderProductsDataGridView.Rows[i].Cells[3].Value.ToString())); } GlobalVariables.TransactionType = "Phone"; Form payment = new payment(this); payment.ShowDialog(); updateProduantity1.DeletePhoneOrder(int.Parse(phoneOrderDataGridView.CurrentRow.Cells[0].Value.ToString())); updateProduantity1.deletePhoneOrderLine(int.Parse(phoneOrderDataGridView.CurrentRow.Cells[0].Value.ToString())); }
private void button5_Click(object sender, EventArgs e) { if (GlobalVariables.TransactionType.Equals("Store")) { Form payment = new payment(this); payment.ShowDialog(); } else { //Add to Phone Order Table. if (GlobalVariables.isMemeber) { phoneOrderTableAdapter.Insert(Decimal.Parse(GlobalVariables.cartTotal.ToString()), GlobalVariables.customerName_Order, GlobalVariables.customerCellNo_Order, GlobalVariables.StaffID, GlobalVariables.MemberID); } else { phoneOrderTableAdapter.Insert(Decimal.Parse(GlobalVariables.cartTotal.ToString()), GlobalVariables.customerName_Order, GlobalVariables.customerCellNo_Order, GlobalVariables.StaffID, null); } int maxID = int.Parse(phoneOrderTableAdapter.getMaxID().ToString()); //MessageBox.Show(maxID.ToString()) ; for (int i = 0; i < GlobalVariables.productCart_ProductID.Count(); i++) { phoneOrderLineTblTableAdapter.Insert(maxID, int.Parse(GlobalVariables.productCart_ProductID.ElementAt(i)), Decimal.Parse(GlobalVariables.productCart_UnitPrice.ElementAt(i).ToString()), GlobalVariables.productCart_Quantity.ElementAt(i)); } this.phoneOrderLineTblTableAdapter.Fill(this.productDS.PhoneOrderLineTbl); this.phoneOrderTableAdapter.Fill(this.productDS.PhoneOrder); tabcontrol1.SelectedTab = orders; tabcontrol1.Size = new Size(1280, 566); GlobalVariables.Clear(); } }