Example #1
0
        /// <summary>
        /// Добавляем новый проек
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void InsertNewProject_Click(object sender, EventArgs e)
        {
            InsertProjectForm frm = new InsertProjectForm();

            if (frm.ShowDialog(this) == DialogResult.OK)
            {
                Project project = new Project();

                project.Place = frm.ProjectPlace;
                project.Bush  = frm.ProjectBush;

                project.Well = frm.ProjectWell;
                project.Job  = frm.ProjectJob;

                DateTime now = DateTime.Now;
                project.DB_Name = string.Format("db_{0:00}_{1:00}_{2:00}_{3:00}_{4:00}_{5:00}",
                                                now.Year, now.Month, now.Day, now.Hour, now.Minute, now.Second);

                project.Created = now;
                project.Dir     = string.Format("{0:00}_{1:00}_{2:00}_{3:00}_{4:00}_{5:00}", now.Year, now.Month,
                                                now.Day, now.Hour, now.Minute, now.Second);


                InsertStages(project);
                projects.Add(project);



                InsertProjectToTree(project);
            }
        }
Example #2
0
        /// <summary>
        /// Добавляем новый проек
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void InsertNewProject_Click(object sender, EventArgs e)
        {
            InsertProjectForm frm = new InsertProjectForm();
            if (frm.ShowDialog(this) == DialogResult.OK)
            {
                Project project = new Project();

                project.Place = frm.ProjectPlace;
                project.Bush = frm.ProjectBush;

                project.Well = frm.ProjectWell;
                project.Job = frm.ProjectJob;

                DateTime now = DateTime.Now;
                project.DB_Name = string.Format("db_{0:00}_{1:00}_{2:00}_{3:00}_{4:00}_{5:00}",
                    now.Year, now.Month, now.Day, now.Hour, now.Minute, now.Second);

                project.Created = now;
                project.Dir = string.Format("{0:00}_{1:00}_{2:00}_{3:00}_{4:00}_{5:00}", now.Year, now.Month,
                    now.Day, now.Hour, now.Minute, now.Second);

                InsertStages(project);
                projects.Add(project);

                InsertProjectToTree(project);
            }
        }