Example #1
0
        private void btnGetActivity_Click(object sender, EventArgs e)
        {
            List <aaa> ab = new List <aaa>();

            ab.Add(new aaa {
                sZddm = "aa", sZdmc = "bb", iXh = 1
            });
            ab.Add(new aaa {
                sZddm = "aa", sZdmc = "bb", iXh = 2
            });
            ab.Add(new aaa {
                sZddm = "aa", sZdmc = "bb", iXh = 3
            });


            #region 字段值组装
            SqlParameter[] param = new SqlParameter[] {
                new SqlParameter("@ID", SqlDbType.VarChar),   //医院代码
                new SqlParameter("@NAME", SqlDbType.VarChar), //医院名称
            };
            param[0].Value = "aa";                            //医院代码
            param[1].Value = "bb";                            //医院代码
            //param.SetValue("bb", 1); //医院名称

            Hashtable ht = new Hashtable();
            for (int i = 0; i < param.Length; i++)
            {
                ht.Add(param[i].ParameterName, param[i].Value);
            }
            #endregion
            string aa = Newtonsoft.Json.JsonConvert.SerializeObject(ht);

            OpenFileDialog fileDialog = new OpenFileDialog();
            fileDialog.Title            = "请选择文件";
            fileDialog.Filter           = "所有文件(*.dll)|*.dll";
            fileDialog.InitialDirectory = Directory.GetCurrentDirectory();
            if (fileDialog.ShowDialog() == DialogResult.OK)
            {
                string               file    = fileDialog.FileName;
                WorkFlowData         workGet = new WorkFlowData();
                List <ComponentInfo> aaa     = workGet.LoadTypeFromAssembly(file, "");
            }
        }
Example #2
0
        /// <summary>
        /// 保存内容
        /// </summary>
        /// <param name="sText"></param>
        /// <returns>0忽略1成功2失败</returns>
        private void DoSaveWorkFlowConfig()
        {
            SaveFileDialog saveDialog = new SaveFileDialog();

            saveDialog.Filter           = "Config files (*.Config)|*.Config|All files (*.*)|*.*";
            saveDialog.RestoreDirectory = true;
            saveDialog.FileName         = sConfigName;
            if (saveDialog.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    WorkFlowData flowFunction = new WorkFlowData();
                    flowFunction.CreateWorkflows(saveDialog.FileName, workflowObj);
                    MessageBox.Show("保存成功!");
                }
                catch
                {
                    MessageBox.Show("保存失败!");
                }
            }
        }