示例#1
0
文件: WorksForm.cs 项目: slawer/sgt
        /// <summary>
        /// редактировать задание
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void EditProject_Click(object sender, EventArgs e)
        {
            if (treeViewWorks.SelectedNode != null)
            {
                Work work = treeViewWorks.SelectedNode.Tag as Work;
                if (work != null)
                {
                    InsertNewWorkForm frm = new InsertNewWorkForm();
                    frm.Text = "Редактирование задания";

                    frm.SelectedField = work.Field;
                    frm.SelectedBush  = work.Bush;

                    frm.SelectedWell        = work.Well;
                    frm.SelectedDescription = work.Description;

                    frm.SelectedDept = work.StartingDepth;

                    if (frm.ShowDialog(this) == DialogResult.OK)
                    {
                        work.Field = frm.SelectedField;
                        work.Bush  = frm.SelectedBush;

                        work.Well        = frm.SelectedWell;
                        work.Description = frm.SelectedDescription;

                        work.StartingDepth = frm.SelectedDept;

                        treeViewWorks.Nodes.Clear();
                        WorksForm_Load(this, EventArgs.Empty);
                    }
                }
                else
                {
                    MessageBox.Show(this, "Выберите задание для редактирования.", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            else
            {
                MessageBox.Show(this, "Выберите задание для редактирования.", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
示例#2
0
文件: WorksForm.cs 项目: slawer/sgt
        /// <summary>
        /// добавляем новое задание
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void InsertNewProject_Click(object sender, EventArgs e)
        {
            InsertNewWorkForm frm = new InsertNewWorkForm();

            if (frm.ShowDialog(this) == DialogResult.OK)
            {
                Work work = new Work();

                work.Field = frm.SelectedField;
                work.Bush  = frm.SelectedBush;

                work.Well        = frm.SelectedWell;
                work.Description = frm.SelectedDescription;

                work.StartingDepth = frm.SelectedDept;

                _app.Works.Add(work);
                InsertWorkToTree(work);
            }
        }
示例#3
0
文件: WorksForm.cs 项目: slawer/sgt
        /// <summary>
        /// добавляем новое задание
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void InsertNewProject_Click(object sender, EventArgs e)
        {
            InsertNewWorkForm frm = new InsertNewWorkForm();
            if (frm.ShowDialog(this) == DialogResult.OK)
            {
                Work work = new Work();

                work.Field = frm.SelectedField;
                work.Bush = frm.SelectedBush;

                work.Well = frm.SelectedWell;
                work.Description = frm.SelectedDescription;

                work.StartingDepth = frm.SelectedDept;

                _app.Works.Add(work);
                InsertWorkToTree(work);
            }
        }
示例#4
0
文件: WorksForm.cs 项目: slawer/sgt
        /// <summary>
        /// редактировать задание
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void EditProject_Click(object sender, EventArgs e)
        {
            if (treeViewWorks.SelectedNode != null)
            {
                Work work = treeViewWorks.SelectedNode.Tag as Work;
                if (work != null)
                {
                    InsertNewWorkForm frm = new InsertNewWorkForm();
                    frm.Text = "Редактирование задания";

                    frm.SelectedField = work.Field;
                    frm.SelectedBush = work.Bush;

                    frm.SelectedWell = work.Well;
                    frm.SelectedDescription = work.Description;

                    frm.SelectedDept = work.StartingDepth;

                    if (frm.ShowDialog(this) == DialogResult.OK)
                    {
                        work.Field = frm.SelectedField;
                        work.Bush = frm.SelectedBush;

                        work.Well = frm.SelectedWell;
                        work.Description = frm.SelectedDescription;

                        work.StartingDepth = frm.SelectedDept;

                        treeViewWorks.Nodes.Clear();
                        WorksForm_Load(this, EventArgs.Empty);
                    }
                }
                else
                    MessageBox.Show(this, "Выберите задание для редактирования.", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
                MessageBox.Show(this, "Выберите задание для редактирования.", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }