public void refreshJobs()
 {
     try
     {
         listViewJobs.Items.Clear();
         foreach (OpenMassSenderCore.OpenMassSenderDBDataSet.JobRow row in JobTableAdapter.getInstance().GetData())
         {
             if (row.RowState != DataRowState.Deleted)
             {
                 JobListItem item = new JobListItem(row.ID, row.job_name, row.status);
                 listViewJobs.Items.Add(item);
             }
         }
     }
     catch (Exception ex) { }
 }
        private void Form1_Load(object sender, EventArgs e)
        {
            OpenMassSenderCore.OpenMassSenderDBDataSet.JobRow.jobFinished=(job)=>{
                string text = "\"" + job.job_name + "\" finished";
                showBalloon("Job finished", text);
            };
              //  Testing testing = new Testing();
              // testing.Show();
            if (UserTableAdapter.getInstance().userid == null || UserTableAdapter.getInstance().userid.Equals(""))
            {
                showLoginForm();
            }

            //populate listview with data
            //Get the table from the data set
            DataTable dtable = OpenMassSenderDBDataSet.getInstance().Tables["Job"];
            //Clear the ListView control
            listViewJobs.Items.Clear();
            foreach (OpenMassSenderCore.OpenMassSenderDBDataSet.JobRow row in JobTableAdapter.getInstance().GetData())
            {
                if (row.RowState != DataRowState.Deleted)
                {
                    JobListItem item = new JobListItem(row.ID, row.job_name, row.status);
                    listViewJobs.Items.Add(item);
                }
            }
        }