private void btnReportPrint_Click_1(object sender, EventArgs e) { frmReportTankRecipet tanko = new frmReportTankRecipet(tanktofix.Id, "report2"); tanko.ShowDialog(); }
private void btnReportPrint_Click(object sender, EventArgs e) { /* foreach (Control item in this.Controls) { item.Enabled = false; //if(item.) } */ // btnOpenTank.Enabled = false; frmReportTankRecipet tanko = new frmReportTankRecipet(tanktofix.Id, "report2"); tanko.ShowDialog(); }
private void btnPrint_Click(object sender, EventArgs e) { if(null != _currentinvoice) { // MessageBox.Show("פעולת ההוספה הצליחה"); frmReportTankRecipet tanko = new frmReportTankRecipet(Convert.ToInt32(_currentinvoice.invoiceNumber), "report3"); tanko.ShowDialog(); }else { MessageBox.Show("נא קיים תעודה כזו נא לשמור או לבחור חדשה "); } }
private void btnReportPrint_Click(object sender, EventArgs e) { using (GazOnDevEntities db = new GazOnDevEntities()) { if (edit) { db.Attach(_currentinvoice); db.ObjectStateManager.ChangeObjectState(_currentinvoice, EntityState.Modified); foreach (invoiceitem item in bindingSource1.List) { if (null != item.amount) { updateStockAmount(item); } db.Attach(item); db.ObjectStateManager.ChangeObjectState(item, EntityState.Modified); } } else { foreach (invoiceitem item in bindingSource1.List) { //invoiceitem item = new invoiceitem(); ////stocklist. // item.invoiceid = txtinvoiceid.Text; if (null != item.amount) { updateStockAmount(item); } db.AddToinvoiceitems(item); } } //} dbconf.invoicelastid = (Convert.ToInt32(dbconf.invoicelastid) + 1).ToString(); db.Attach(dbconf); db.ObjectStateManager.ChangeObjectState(dbconf, EntityState.Modified); if (edit) { } else { if (_currentinvoice == null) { _currentinvoice = new Invoice(); } _currentinvoice.address = txtAddress.Text; _currentinvoice.C_to = txtTo.Text; _currentinvoice.carnum = txtCarNum.Text; _currentinvoice.date = DatetimePicker.Value; _currentinvoice.invoiceNumber = txtinvoiceid.Text; _currentinvoice.tankNumber = tanktofix.TankNumber; _currentinvoice.tankDesc = txtTankDescription.Text; // increase invoice id number _currentinvoice.transporter = txtCarTransporter.Text; db.AddToInvoices(_currentinvoice); } if (db.SaveChanges() > 0) { // MessageBox.Show("פעולת ההוספה הצליחה"); frmReportTankRecipet tanko = new frmReportTankRecipet(Convert.ToInt32(_currentinvoice.invoiceNumber), "report3"); tanko.ShowDialog(); //btnOpenTank.Enabled = false; } else { MessageBox.Show("פעולת ההוספה נכשלה"); } } // btnOpenTank.Enabled = false; /* frmReportTankRecipet tanko = new frmReportTankRecipet(tanktofix.Id, "report3"); tanko.ShowDialog();*/ }
void ShowReport(int reportid) { frmReportTankRecipet tanko = new frmReportTankRecipet(reportid, "report1"); tanko.ShowDialog(); }