コード例 #1
0
        private void button5_Click(object sender, EventArgs e)
        {
            int?id = getId();
            int?countInspeccion = null;

            if (id != null)
            {
                using (RentcarEntities db = new RentcarEntities())
                {
                    countInspeccion = db.inspeccions.Count(a => a.renta_id == id);
                }

                if (countInspeccion > 0)
                {
                    ShowRentaData c = new ShowRentaData(id);
                    c.ShowDialog();
                    refreshDataGrid();
                }
                else
                {
                    FrmInspeccion c = new FrmInspeccion(id, "New");
                    c.ShowDialog();
                    refreshDataGrid();
                }
            }
        }
コード例 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            FrmInspeccion c = new FrmInspeccion(oRenta.id, "Edit");

            c.ShowDialog();
        }