Ejemplo n.º 1
0
        private void btIzvozUExcel_Click(object sender, EventArgs e)
        {
            DateTime startTime = DateTime.Now;

            try
            {
                saveFileDialog1.DefaultExt = "*.xlsx";
                saveFileDialog1.Filter     = "Excel v2007+|*.xlsx|Sve|*.*";
                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    Cursor = Cursors.WaitCursor;
                    Procode.PolovniAutomobili.Data.Vehicle.Automobile a = new Procode.PolovniAutomobili.Data.Vehicle.Automobile();
                    ExportToExcel(saveFileDialog1.FileName, a.GetAllAsArray());
                    Cursor = Cursors.Default;
                    DateTime endTime = DateTime.Now;
                    MessageBox.Show(string.Format("Gotovo! Trajanje {0} min.", (endTime - startTime).TotalMinutes), "Izvoz");
                }
            }
            catch (Exception ex)
            {
                Cursor = Cursors.Default;
                MessageBox.Show("Greska: " + ex.Message);
            }
        }
Ejemplo n.º 2
0
 public AdReader(Data.DbContext dbContext, ref Common.Http.ListaStrana procitaneStraneOglasa, int threadId) :
     base(ref procitaneStraneOglasa, threadId, typeof(AdReader).Name, (int)Properties.Settings.Default.BrojCitacaOglasa)
 {
     autoDB = new Procode.PolovniAutomobili.Data.Vehicle.Automobile(Data.Provider.Data.GetNewDataInstance(dbContext));
 }