Esempio n. 1
0
        /// <summary>
        /// 新建工作流工程
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void new_proj_Click(object sender, RoutedEventArgs e)
        {
            CloseAll();
            if (main_proj == null)
            {
                main_proj = new WorkFlowsProj();
                NewWorkFlowProj newWF = new NewWorkFlowProj();
                newWF.Owner = this;
                if (!newWF.ShowDialog().Value)
                {
                    main_proj = null;
                    return;
                }

                string proj_name = newWF.newProj_name;
                string proj_path = newWF.newProj_path;


                main_proj.Name         = proj_name;
                main_proj.Path         = proj_path;
                main_proj.win_main     = this;
                main_proj.DB_Config    = newWF.db_config;
                main_proj.Record_Items = newWF.Record_Items;
                TreeViewItem projItem = new TreeViewItem();
                StackPanel   stack    = new StackPanel();
                stack.Orientation = System.Windows.Controls.Orientation.Horizontal;
                Image im = new Image();
                im.Width  = 16;
                im.Height = 16;
                im.Source = new BitmapImage(new Uri("new_wfs.ico", UriKind.RelativeOrAbsolute));
                stack.Children.Add(im);
                TextBlock tb = new TextBlock();
                tb.VerticalAlignment = VerticalAlignment.Center;
                tb.Text = main_proj.Name;
                stack.Children.Add(tb);
                projItem.Header = stack;

                System.Windows.Controls.ContextMenu cm = this.FindResource("proj_prop") as System.Windows.Controls.ContextMenu;
                cm.PlacementTarget   = sender as System.Windows.Controls.TreeViewItem;
                projItem.ContextMenu = cm;


                main_treeView.Items.Add(projItem);
                AddFlow.IsEnabled = true;



                Save_button.IsEnabled = true;
            }
        }
Esempio n. 2
0
        private void proj_prop_show(object sender, RoutedEventArgs e)
        {
            NewWorkFlowProj wfp = new NewWorkFlowProj();

            wfp.Owner               = this;
            wfp.Title               = "工程属性";
            wfp.newProj_name        = main_proj.Name;
            wfp.newProj_path        = main_proj.Path;
            wfp.proj_name.IsEnabled = false;
            wfp.proj_path.IsEnabled = false;
            wfp.Record_Items        = main_proj.Record_Items;

            SqlConnection sqlConn = new SqlConnection(main_proj.DB_Config);

            wfp.server.Text = sqlConn.DataSource;
            wfp.SetDBConfigration(sqlConn.Database);
            if (wfp.ShowDialog().Value == true)
            {
                main_proj.DB_Config    = wfp.db_config;
                main_proj.Record_Items = wfp.Record_Items;
            }
        }