private void button1_Click(object sender, EventArgs e)//project folder explorer
        {
            var con = new System.Data.SqlClient.SqlConnection();

            con.ConnectionString = Global.ConnectionString_fileserver;

            var projColl = new ObservableCollection <ProjectFolderItem>();

            try
            {
                con.Open();

                var command1 = new SqlCommand("project overview", con);

                command1.CommandType = CommandType.StoredProcedure;

                SqlDataAdapter adapt = new SqlDataAdapter();
                DataTable      dt    = new DataTable();
                adapt.SelectCommand = command1;
                adapt.Fill(dt);

                foreach (DataRow row in dt.Rows)
                {
                    var obj = new ProjectFolderItem
                    {
                        ProjNum    = (int)row["project_NR"],
                        ProjName   = (string)row["naam_project"],
                        ProjPlaats = (string)row["plaats"],
                        ProjOmsch  = (string)row[3],
                        ProjOpdr   = (string)row[4]
                    };
                    projColl.Add(obj);
                }
                con.Close();
            }
            catch (SqlException exSql)
            {
                String tmp = exSql.ToString();
                MessageBox.Show("login failed");
                this.program_closes = true;
                this.Close();
                FormManager.GetMenu().herlaad();
            }

            var wind = new ProjectFolderExplorer(projColl);

            ElementHost.EnableModelessKeyboardInterop(wind);
            wind.Width = 1100;
            wind.Show();
        }
示例#2
0
 private void instellingen_zb_FormClosing(object sender, FormClosingEventArgs e)
 {
     FormManager.GetMenu().herlaad();
 }