private void торговыйЗалToolStripMenuItem_Click(object sender, EventArgs e) { prodant examp = new prodant(); examp.Show(); this.Close(); }
private void prodazhi_Load(object sender, EventArgs e) { const string message = "Вы хотите оформить чек?"; const string caption = "Form Closing"; var result = MessageBox.Show(message, caption, MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { maskedTextBox1.Text = Convert.ToString(DateTime.Today); tov_zal(); get_nom_chek(); chek(); summ = 0; } else { prodant examp = new prodant(); examp.Show(); this.Close(); } }
private void button3_Click(object sender, EventArgs e) { Microsoft.Office.Interop.Excel.Application ExcelApp = new Microsoft.Office.Interop.Excel.Application(); ExcelApp.Application.Workbooks.Add(Type.Missing); ExcelApp.Columns.ColumnWidth = 25; ExcelApp.Cells[1, 1] = "Дата: " + maskedTextBox1.Text; ExcelApp.Cells[1, 2] = "Номер чека: " + textBox5.Text; ExcelApp.Cells[1, 3] = "Сумма: " + textBox2.Text; for (int j = 0; j < dataGridView1.Rows.Count; j++) { for (int i = 0; i < dataGridView1.ColumnCount; i++) { ExcelApp.Cells[i + 2, j + 1] = dataGridView1.Rows[j].Cells[i].Value; } } ExcelApp.Visible = true; ExcelApp.UserControl = true; prodant examp = new prodant(); examp.Show(); this.Close(); }