private void customerGrid_DoubleClick(object sender, EventArgs e) { if (customerGrid.SelectedRows.Count == 1) { int selectedId = int.Parse(customerGrid.SelectedRows[0].Cells[0].Value.ToString()); SalesHistory salesHistoryForm = new SalesHistory(); salesHistoryForm.ShowHistory(selectedId, customerGrid.SelectedRows[0].Cells[1].Value.ToString(), startDate); salesHistoryForm.Dispose(); } }
private void itemGrid_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < itemGrid.RowCount) { int customerId = int.Parse(itemGrid[0, e.RowIndex].Value.ToString()); this.Cursor = Cursors.WaitCursor; SalesHistory saleHistory = new SalesHistory(); saleHistory.ShowHistory(customerId, itemGrid[1, e.RowIndex].Value.ToString(), DateTime.Now); saleHistory.Dispose(); this.Cursor = Cursors.Default; } }
private void previousBalance_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { if (customerName.Text != string.Empty && customerName.Text.ToLower() != "cash") { //get customer id and pass it to sales history form SalesHistory history = new SalesHistory(); history.ShowHistory(customer.ID, customer.Name, estimateDatePicker.Value); history.Dispose(); //transaction = tm.GetTransactionByID(transaction.ID); //if (transaction == null) //{ // transaction = new Transaction(); // transaction.ID = -1; // transaction.Remark = string.Empty; // estimateDatePicker.Value = estimateDatePicker.Value; // currentTotal.Text = "0"; // currentPayment.Text = "0"; // totalBalance.Text = "0"; //} LoadControls(); } }