Exemplo n.º 1
0
        // 单击菜单"项目"-"编辑当前项目"
        private void EditProjectMenu_Click(object sender, RoutedEventArgs e)
        {
            // 隐藏项目基本信息窗口
            foreach (TreeViewItem item in this.ProjectTreeView.Items)
            {
                item.IsSelected = false;
            }

            // 赋值要传递的参数
            string        name                 = Program.currentProject;
            string        province             = ProjectDataBase.ReadProjectProvince(name);
            string        city                 = ProjectDataBase.ReadProjectCity(name);
            List <string> layerNumberList      = ProjectDataBase.ReadLayerNumberList(name);
            List <string> layerNameList        = ProjectDataBase.ReadLayerNameList(name);
            List <string> layerGeoList         = ProjectDataBase.ReadLayerGeoList(name);
            List <string> layerDescriptionList = ProjectDataBase.ReadLayerDescriptionList(name);

            string[] company = ProjectDataBase.ReadProjectCompany(name);

            // 实例化窗口
            NewProject editProject = new NewProject(name, province, city, layerNumberList, layerNameList, layerGeoList, layerDescriptionList, company);

            editProject.ShowDialog();

            // 更新项目数据文件
            if (editProject.DialogResult == true)
            {
                GC.Collect();
                GC.WaitForPendingFinalizers();
                File.Move(editProject.oldFile, editProject.newFile);
            }

            // 重命名窗口
            SetProgramText(Program.currentProject);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 带1个参数的构造函数,用于新建分层
        /// </summary>
        /// <param name="_lastDepth">上一层层底深度</param>
        public ZkLayerDetail(double _lastDepth)
        {
            InitializeComponent();

            // 赋值上一层层底深度
            LastDepth = _lastDepth;

            // 赋值各选框的候选项
            this.LayerNumberComboBox.ItemsSource = ProjectDataBase.ReadLayerNumberList(Program.currentProject);
            this.LayerNameComboBox.ItemsSource   = ProjectDataBase.ReadLayerNameList(Program.currentProject);
            this.LayerGeoComboBox.ItemsSource    = ProjectDataBase.ReadLayerGeoList(Program.currentProject);

            // 定义层底深度输入框的工具提示
            DefineToolTip();
        }
Exemplo n.º 3
0
        /// <summary>
        /// 带4个参数的构造函数,用于编辑分层
        /// </summary>
        /// <param name="_lastDepth">上一层层底深度</param>
        /// <param name="_number">分层编号</param>
        /// <param name="_depth">层底深度</param>
        /// <param name="_description">分层描述</param>
        public ZkLayerDetail(double _lastDepth, string _number, double _depth, string _description)
        {
            InitializeComponent();

            // 重新赋值窗体标题
            this.Title = "编辑钻孔分层";

            // 赋值上一层层底深度
            LastDepth = _lastDepth;

            // 赋值各选框的候选项
            this.LayerNumberComboBox.ItemsSource = ProjectDataBase.ReadLayerNumberList(Program.currentProject);
            this.LayerNameComboBox.ItemsSource   = ProjectDataBase.ReadLayerNameList(Program.currentProject);
            this.LayerGeoComboBox.ItemsSource    = ProjectDataBase.ReadLayerGeoList(Program.currentProject);

            // 定义层底深度输入框的工具提示
            DefineToolTip();

            // 赋值
            this.LayerNumberComboBox.SelectedValue = _number;
            this.LayerDepthTextBox.Text            = _depth.ToString();
            this.LayerDescriptionTextBox.Text      = _description;
        }
Exemplo n.º 4
0
 /// <summary>
 /// 赋值项目数据
 /// </summary>
 private void InitialProjectBasicInfo()
 {
     if (Program.currentProject != null)
     {
         dt.Clear();
         this.DrawerComboBox.ItemsSource        = SettingDataBase.ReadCompanyPeople();
         this.WriterComboBox.ItemsSource        = SettingDataBase.ReadCompanyPeople();
         this.CheckerComboBox.ItemsSource       = SettingDataBase.ReadCompanyPeople();
         this.InspectorComboBox.ItemsSource     = SettingDataBase.ReadCompanyPeople();
         this.ApproverComboBox.ItemsSource      = SettingDataBase.ReadCompanyPeople();
         this.FinalApproverComboBox.ItemsSource = SettingDataBase.ReadCompanyPeople();
         string prj = Program.currentProject;
         this.ProjectNameTextBox.Text     = prj;
         this.ProjectProvinceTextBox.Text = ProjectDataBase.ReadProjectProvince(prj);
         this.ProjectCityTextBox.Text     = ProjectDataBase.ReadProjectCity(prj);
         string[] company = ProjectDataBase.ReadProjectCompany(prj);
         this.CompanyNameTextBox.Text    = company[0];
         this.CompanyCodeTextBox.Text    = company[1];
         this.DrawerComboBox.Text        = company[2];
         this.WriterComboBox.Text        = company[3];
         this.CheckerComboBox.Text       = company[4];
         this.InspectorComboBox.Text     = company[5];
         this.ApproverComboBox.Text      = company[6];
         this.FinalApproverComboBox.Text = company[7];
         InitialDataTable(ProjectDataBase.ReadLayerNumberList(prj), ProjectDataBase.ReadLayerNameList(prj), ProjectDataBase.ReadLayerGeoList(prj), ProjectDataBase.ReadLayerDescriptionList(prj));
     }
 }