⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.cs

📁 博客园WxWinter写的WF工作流入门学习资料及示例代码
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.ServiceModel.Description;
using System.ServiceModel;

namespace wxwinter.wf.testWinFormTaskTake
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        ServiceEndpoint httpEndpoint;
        wxwinter.wf.WCFCommunication.ItestControl controlObject;
        private void button1_Click(object sender, EventArgs e)
        {
            string path = this.txWCFServerURL.Text + this.txWCFServerName.Text;
            httpEndpoint = new ServiceEndpoint(ContractDescription.GetContract(typeof(wxwinter.wf.WCFCommunication.ItestControl)), new BasicHttpBinding(), new EndpointAddress(path));
            ChannelFactory<wxwinter.wf.WCFCommunication.ItestControl> factory;
            factory = new ChannelFactory<wxwinter.wf.WCFCommunication.ItestControl>(httpEndpoint);
            controlObject = factory.CreateChannel();

            this.button1.Enabled = false;
            this.groupBox2.Enabled = true;
            this.groupBox8.Enabled = true;
        }

        private void btGetTask_Click(object sender, EventArgs e)
        {
            this.dataGrid5.DataSource = controlObject.GetCurrentlyTaskList(this.txUsername.Text).Tables[0];
        }

        private void btNext_Click(object sender, EventArgs e)
        {

           object o = this.dataGrid5[this.dataGrid5.CurrentRowIndex, 0];
            if (o != null)
            {
                string gid = o.ToString();
      
                System.Data.DataSet ds = (System.Data.DataSet)this.dataGrid3.DataSource;
                   
                controlObject.NextStep(gid, "ok", ds, "");
                
                this.btNext.Enabled = false;
                    
                this.btGet.Enabled =true ;
                }

               
                           
            }

        private void btGet_Click(object sender, EventArgs e)
        {
             object o = this.dataGrid5[this.dataGrid5.CurrentRowIndex, 0];
            if (o != null)
            {
                string gid = o.ToString();
                this.dataGrid3.DataSource = controlObject.GetDataForm(gid);
                this.dataGrid3.DataMember = this.dataGrid5[this.dataGrid5.CurrentRowIndex, 2].ToString();
                this.dataGrid4.DataSource = controlObject.GetDataForm(gid);
                this.btNext.Enabled = true;
                this.btGet.Enabled = false;
            }
        }
        }
    }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -