protected void MDIChildOpenProject(object sender, System.EventArgs e)
        {
            OpenProject newMdiChildOpen = new OpenProject();

            try
            {
                project = GetSelectedProject();

                if (project != null)
                {
                    //((OpenProject)newMdiChildOpen).tbProjectInfoGeneral.Text = project.id.ToString() + "; ";
                    ((OpenProject)newMdiChildOpen).tbProjectInfoGeneral.Text += project.ProjectName.ToString().Trim() + "; ";
                    ((OpenProject)newMdiChildOpen).tbProjectInfoGeneral.Text += project.ProjectAddress.ToString().Trim() + "; ";
                    ((OpenProject)newMdiChildOpen).tbProjectInfoGeneral.Text += project.ProjectCompany.ToString().Trim();
                    ((OpenProject)newMdiChildOpen).tbProjectInfoGeneral.Text += " (" + project.ProjectState.ToString().Trim() + ")";
                    ((OpenProject)newMdiChildOpen).tbProjectInfoDateIn.Text  += Regex.Replace(project.ProjectDateIn.ToString(),
                                                                                              @"\s(.*)", string.Empty, RegexOptions.IgnoreCase);
                    ((OpenProject)newMdiChildOpen).tbProjectInfoDateOut.Text += Regex.Replace(project.ProjectDateOut.ToString(),
                                                                                              @"\s(.*)", string.Empty, RegexOptions.IgnoreCase);
                    newMdiChildOpen.ShowDialog();
                }
            }
            catch
            {
                Close();
            }
        }
        protected void MDIChildOpenProject(object sender, System.EventArgs e)
        {
            OpenProject newMdiChildOpen = new OpenProject();

            try
            {
                //var name = (string)projects.dgvProjects.SelectedRows[0].Cells["ProjectName"].Value;
                //var project = projectsKonstruktorEntities.Projects.FirstOrDefault(q => q.ProjectName == name);
                project = projects.GetSelectedProject();

                if (project != null)
                {
                    //((OpenProject)newMdiChildOpen).tbProjectInfoGeneral.Text = project.id.ToString() + "; ";
                    ((OpenProject)newMdiChildOpen).tbProjectInfoGeneral.Text += project.ProjectName.ToString().Trim() + "; ";
                    ((OpenProject)newMdiChildOpen).tbProjectInfoGeneral.Text += project.ProjectAddress.ToString().Trim() + "; ";
                    ((OpenProject)newMdiChildOpen).tbProjectInfoGeneral.Text += project.ProjectCompany.ToString().Trim();
                    ((OpenProject)newMdiChildOpen).tbProjectInfoGeneral.Text += " (" + project.ProjectState.ToString().Trim() + ")";
                    ((OpenProject)newMdiChildOpen).tbProjectInfoDateIn.Text  += Regex.Replace(project.ProjectDateIn.ToString(),
                                                                                              @"\s(.*)", string.Empty, RegexOptions.IgnoreCase);
                    ((OpenProject)newMdiChildOpen).tbProjectInfoDateOut.Text += Regex.Replace(project.ProjectDateOut.ToString(),
                                                                                              @"\s(.*)", string.Empty, RegexOptions.IgnoreCase);
                    newMdiChildOpen.ShowDialog();
                }
            }
            catch
            {
                Close();
            }
        }