private void DataGV_DoubleClick(object sender, EventArgs e) { if (DataGV.SelectedRows.Count > 0) { DocumentData form = new DocumentData("edit", Convert.ToInt32(DataGV.SelectedRows[0].Cells["ID"].Value), null); form.ShowDialog(); manager.Save(); manager.CloseContext(); manager = new ContextManager(); documentsLogic = new DocumentsLogic(manager); Fill(); } }
private void NewDocumentToolStripMenuItem_Click(object sender, EventArgs e) { Documents.DocumentData form = new Documents.DocumentData("new", null, cashRegister); bool allowed = Compas.Logic.Security.CurrentSecurityContext.Principal.OpperationAllowed(form.Name); if (allowed == true) { form.WindowState = FormWindowState.Maximized; form.ShowDialog(); } else { MessageBox.Show("Дія заборонена. Зверніться до адміністратора."); } }
// void DataGV_CellPainting(object sender, DataGridViewCellPaintingEventArgs e) // { // int sum = 0; // // only draw the cells of the extra row by ourselves, leaving // //the rest cells to the system // if (e.RowIndex == this.DataGV.NewRowIndex && // e.ColumnIndex > -1) // { // for (int i = 0; i < this.DataGV.NewRowIndex; i++) // { // if //(this.DataGV.Rows[i].Cells[e.ColumnIndex].Value.ToString().Trim() != //"") // { // sum += // (int)this.DataGV.Rows[i].Cells[e.ColumnIndex].Value; // } // } // e.PaintBackground(e.CellBounds, false); // e.Graphics.DrawString(sum.ToString(), // this.DataGV.Font, Brushes.Black, e.CellBounds.Left + // 2, e.CellBounds.Top + 2); // e.Handled = true; // } // } private void NewSB_Click(object sender, EventArgs e) { DocumentData form = new DocumentData("new", null, cashRegister); form.ShowDialog(); Fill(); }
private void EditSB_Click(object sender, EventArgs e) { DocumentData form = new DocumentData("edit", Convert.ToInt32(DataGV.SelectedRows[0].Cells["ID"].Value), cashRegister); form.ShowDialog(); manager.Save(); manager.CloseContext(); manager = new ContextManager(); documentsLogic = new DocumentsLogic(manager); Fill(); }
private void NewDocumentWithoutCloseToolStripMenuItem_Click(object sender, EventArgs e) { Documents.DocumentData form = new Documents.DocumentData("new", null, cashRegister); form.CloseAfterPayment = false; bool allowed = Compas.Logic.Security.CurrentSecurityContext.Principal.OpperationAllowed(form.Name); if (allowed == true) { form.WindowState = FormWindowState.Maximized; form.ShowDialog(); } else { MessageBox.Show("Дія заборонена. Зверніться до адміністратора."); } }