Beispiel #1
0
        public FrmNewFlow()
        {
            InitializeComponent();

            WSDesignerSoapClient da = Glo.GetDesignerServiceInstance();

            da.RunSQLReturnTableAsync("SELECT no,name FROM WF_FlowSort ");
            da.RunSQLReturnTableCompleted += new EventHandler <RunSQLReturnTableCompletedEventArgs>(da_RunSQLReturnTableCompleted);


            DataTable dt = new DataTable();

            dt.Columns.Add(new DataColumn("No"));
            dt.Columns.Add(new DataColumn("Name"));

            DataRow dr = dt.NewRow();

            dr[0] = "0";
            dr[1] = "数据轨迹模式";
            dt.Rows.Add(dr);

            dr    = dt.NewRow();
            dr[0] = "1";
            dr[1] = "数据合并模式";
            dt.Rows.Add(dr);
            IList list = dt.GetBindableData(new Connector());

            DDL_DataStoreModel.ItemsSource       = list;
            DDL_DataStoreModel.DisplayMemberPath = dt.Columns[1].ColumnName;
            DDL_DataStoreModel.SelectedIndex     = 0;
        }
Beispiel #2
0
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            var client = Glo.GetDesignerServiceInstance();
            var sql    = "select * from Sys_MapData";

            client.RunSQLReturnTableCompleted += client_RunSQLReturnTableCompleted;
            client.RunSQLReturnTableAsync(sql, true);
        }
Beispiel #3
0
        private void TB_Name_LostFocus(object sender, RoutedEventArgs e)
        {
            string s        = this.TB_Name.Text;
            var    daPinYin = Glo.GetDesignerServiceInstance();

            daPinYin.ParseStringToPinyinAsync(s);
            daPinYin.ParseStringToPinyinCompleted += new EventHandler <ParseStringToPinyinCompletedEventArgs>(daPinYin_ParseStringToPinyinCompleted);
        }
Beispiel #4
0
        public static int RunSQL(string sql)
        {
            WSDesignerSoapClient client = Glo.GetDesignerServiceInstance();

            client.RunSQLAsync(sql, true);
            client.RunSQLCompleted += new EventHandler <RunSQLCompletedEventArgs>(client_RunSQLCompleted);
            return(myResultInt);
        }
Beispiel #5
0
        public FrmImp()
        {
            InitializeComponent();
            WSDesignerSoapClient da_InitFrmSort = Glo.GetDesignerServiceInstance();

            da_InitFrmSort.RunSQLReturnTableAsync("SELECT No,Name FROM Sys_FrmSort");
            da_InitFrmSort.RunSQLReturnTableCompleted += new EventHandler <RunSQLReturnTableCompletedEventArgs>(da_InitFrmSort_RunSQLReturnTableCompleted);
        }
Beispiel #6
0
        public static DataTable RunSQLReturnTable(string sql)
        {
            var client = Glo.GetDesignerServiceInstance();

            client.RunSQLReturnTableAsync(sql, true);
            client.RunSQLReturnTableCompleted += new EventHandler <RunSQLReturnTableCompletedEventArgs>(client_RunSQLReturnTableCompleted);

            return(myResultDT);
        }
Beispiel #7
0
        void RB_Checked(object sender, RoutedEventArgs e)
        {
            RadioButton rb     = sender as RadioButton;
            string      id     = rb.Name.Replace("RB_", "");
            var         client = Glo.GetDesignerServiceInstance();
            var         sql    = "SELECT * FROM Sys_MapData WHERE AppType=" + id;

            client.RunSQLReturnTableCompleted += new EventHandler <RunSQLReturnTableCompletedEventArgs>(client_RunSQLReturnTableCompleted);
            client.RunSQLReturnTableAsync(sql, true);
        }
Beispiel #8
0
 /// <summary>
 /// 如果FlowFormId不为空,说明是编辑页面,需要初始化控件的值
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void ChildWindow_Loaded(object sender, RoutedEventArgs e)
 {
     if (!string.IsNullOrEmpty(FlowFormId))
     {
         var sql    = "select * from Sys_MapData";
         var client = Glo.GetDesignerServiceInstance();
         client.RunSQLReturnTableCompleted += new EventHandler <global::WF.WS.RunSQLReturnTableCompletedEventArgs>(client_RunSQLReturnTableCompleted);
         client.RunSQLReturnTableAsync(sql, true);
     }
 }
Beispiel #9
0
        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            var selectedItem = tabControl.SelectedItem as TabItem;

            if (null == selectedItem)
            {
                return;
            }

            if (selectedItem == tabStandardNew)
            {
                if (string.IsNullOrWhiteSpace(TB_FlowName.Text))
                {
                    MessageBox.Show("请输入流程名称", "提示", MessageBoxButton.OK);
                    return;
                }
                if (null != CurrentDesinger)
                {
                    var flowSortID     = (DDL_FlowSort.SelectedItem as BindableObject).GetValue("NO");
                    var DataStoreModel = this.DDL_DataStoreModel.SelectedIndex;
                    var ptable         = this.TB_PTable.Text;
                    var flowCode       = this.TB_FlowCode.Text;

                    CurrentDesinger.NewFlow(flowSortID, TB_FlowName.Text, DataStoreModel, ptable, flowCode);
                    this.DialogResult = true;
                }
            }

            if (selectedItem == tabImportNew)
            {
                if (buffer == null || buffer.Length <= 0 || file == null || cbxFlowSortImport.SelectedIndex == -1)
                {
                    MessageBox.Show("请选择模板文件", "提示", MessageBoxButton.OK);
                    return;
                }

                //调用服务上传
                try
                {
                    loadingWindow.Show();

                    WSDesignerSoapClient daUpload = Glo.GetDesignerServiceInstance();
                    daUpload.UploadfileAsync(buffer, file.Name);
                    daUpload.UploadfileCompleted += _Service_UploadfileCompleted;

                    this.DialogResult = true;
                }
                catch (Exception ex)
                {
                    this.DialogResult = false;
                    MessageBox.Show(ex.Message, "错误", MessageBoxButton.OK);
                }
            }
        }
Beispiel #10
0
        public void BindNew()
        {
            this.Title           = "新建表单";
            this.IsNew           = true;
            this.TB_No.IsEnabled = true;
            string sqls = "SELECT No,Name FROM Sys_FrmSort";
            WSDesignerSoapClient daNew = Glo.GetDesignerServiceInstance();

            daNew.RunSQLReturnTableSAsync(sqls);
            daNew.RunSQLReturnTableSCompleted += new EventHandler <RunSQLReturnTableSCompletedEventArgs>(daNew_RunSQLReturnTableSCompleted);
            this.HisAppType = AppType.Application;
        }
Beispiel #11
0
        public void BindFrm(string fk_mapdata)
        {
            this.IsNew = false;
            string sqls = "SELECT * FROM Sys_FrmSort ";

            sqls += "@SELECT * FROM Sys_MapData WHERE No='" + fk_mapdata + "'";
            this.TB_No.IsEnabled = false;
            WSDesignerSoapClient daBindFrm = Glo.GetDesignerServiceInstance();

            daBindFrm.RunSQLReturnTableSAsync(sqls);
            daBindFrm.RunSQLReturnTableSCompleted += new EventHandler <RunSQLReturnTableSCompletedEventArgs>(daBindFrm_RunSQLReturnTableSCompleted);
        }
Beispiel #12
0
        private void DelButton_Click(object sender, RoutedEventArgs e)
        {
            if (MessageBox.Show("您确定要删除吗?", "ccflow提示", MessageBoxButton.OKCancel)
                == MessageBoxResult.Cancel)
            {
                return;
            }
            WSDesignerSoapClient delMap = Glo.GetDesignerServiceInstance();

            delMap.DoTypeAsync("DelFrm", this.TB_No.Text, null, null, null, null);
            delMap.DoTypeCompleted += new EventHandler <DoTypeCompletedEventArgs>(delMap_DoTypeCompleted);
        }
Beispiel #13
0
        public void SaveEn()
        {
            string error = "";

            if (string.IsNullOrEmpty(this.TB_No.Text.Trim()))
            {
                error += "编号不能为空.";
            }

            if (string.IsNullOrEmpty(this.TB_Name.Text.Trim()))
            {
                error += "名称不能为空.";
            }

            string strs = "";

            strs += "@EnName=BP.Sys.MapData@PKVal=" + this.TB_No.Text;
            strs += "@No=" + this.TB_No.Text;
            strs += "@Name=" + this.TB_Name.Text;
            strs += "@PTable=" + this.TB_PTable.Text;
            strs += "@Tag=" + this.TB_URL.Text;

            ListBoxItem lb = this.DDL_FrmSort.SelectedItem as ListBoxItem;

            if (lb != null)
            {
                strs += "@FK_FrmSort=" + lb.Tag.ToString();
            }

            lb = this.DDL_FrmType.SelectedItem as ListBoxItem;
            if (lb != null)
            {
                strs += "@FrmType=" + lb.Tag.ToString();
            }

            lb = this.DDL_DBUrl.SelectedItem as ListBoxItem;
            if (lb != null)
            {
                strs += "@DBURL=" + lb.Tag.ToString();
            }

            strs += "@AppType=" + (int)this.HisAppType;
            strs += "@Designer=" + this.TB_Designer.Text;
            strs += "@DesignerContact=" + this.TB_DesignerContact.Text;
            strs += "@DesignerUnit=" + this.TB_DesignerUnit.Text;

            WSDesignerSoapClient daSaveEn = Glo.GetDesignerServiceInstance();

            daSaveEn.SaveEnAsync(strs);
            daSaveEn.SaveEnCompleted += new EventHandler <SaveEnCompletedEventArgs>(daSaveEn_SaveEnCompleted);
        }
Beispiel #14
0
 private void OKButton_Click(object sender, RoutedEventArgs e)
 {
     this.Btn_Save.IsEnabled = false;
     if (this.IsNew)
     {
         WSDesignerSoapClient daCheckID = Glo.GetDesignerServiceInstance();
         daCheckID.RunSQLReturnValIntAsync("SELECT count(*) FROM Sys_MapData WHERE No='" + this.TB_No.Text.Trim() + "'");
         daCheckID.RunSQLReturnValIntCompleted += new EventHandler <RunSQLReturnValIntCompletedEventArgs>(daCheckID_RunSQLReturnValIntCompleted);
     }
     else
     {
         this.SaveEn();
     }
 }
Beispiel #15
0
        void _Service_UploadfileCompleted(object sender, UploadfileCompletedEventArgs e)
        {
            if (e.Result.Contains("Error:"))
            {
                loadingWindow.Close();
                MessageBox.Show(e.Result, "Error", MessageBoxButton.OK);
                return;
            }

            WSDesignerSoapClient daLoadIt = Glo.GetDesignerServiceInstance();

            daLoadIt.FlowTemplete_LoadAsync((cbxFlowSortImport.SelectedItem as BindableObject).GetValue("NO"),
                                            e.Result, true);
            daLoadIt.FlowTemplete_LoadCompleted += _service_FlowTemplete_LoadCompleted;
        }
Beispiel #16
0
        public FrmLib()
        {
            this.MouseRightButtonDown += (sender, e) =>
            {
                e.Handled = true;
            };

            InitializeComponent();
            var client = Glo.GetDesignerServiceInstance();
            var sql    = "SELECT * FROM Sys_MapData WHERE AppType=0";

            client.RunSQLReturnTableCompleted += new EventHandler <RunSQLReturnTableCompletedEventArgs>(client_RunSQLReturnTableCompleted);
            client.RunSQLReturnTableAsync(sql, true);

            this.Grid1.LoadingRow   += Grid_LoadingRow;
            this.Grid1.UnloadingRow += Grid_UnloadingRow;

            this.RB_0.Checked += new RoutedEventHandler(RB_Checked);
            this.RB_1.Checked += new RoutedEventHandler(RB_Checked);
        }
Beispiel #17
0
        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            var selectedItem = tabControl.SelectedItem as TabItem;

            if (null == selectedItem)
            {
                return;
            }

            if (selectedItem == tabItem1)
            {
                if (buffer == null || buffer.Length <= 0 || file == null ||
                    this.comboBox1.SelectedIndex == -1)
                {
                    MessageBox.Show("请选择模板文件,或者选择导入的类别。", "提示", MessageBoxButton.OK);
                    return;
                }

                //调用服务上传
                try
                {
                    loadingWindow.Show();
                    WSDesignerSoapClient da = Glo.GetDesignerServiceInstance();
                    da.UploadfileCCFormAsync(buffer, file.Name, this.comboBox1.SelectedValue.ToString());
                    da.UploadfileCCFormCompleted += new EventHandler <UploadfileCCFormCompletedEventArgs>(da_UploadfileCCFormCompleted);
                }
                catch (Exception ex)
                {
                    this.DialogResult = false;
                    MessageBox.Show(ex.Message, "错误", MessageBoxButton.OK);
                }
            }

            if (selectedItem == tabItem2)
            {
                MessageBox.Show("此功能在施工中,敬请期待。或者访问http://templete.ccflow.org 流程与表单模板网下载到本机在导入。",
                                "Sorry", MessageBoxButton.OK);
            }
            this.DialogResult = false;
        }
Beispiel #18
0
        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            string pk = this.TB_No.Text;

            if (pk == "系统自动编号...")
            {
                pk = "";
            }
            int frmType = this.DDL_FrmType.SelectedIndex;

            if (frmType == 0 || frmType == 1)
            {
                if (this.TB_PTable.Text.Trim().Length == 0)
                {
                    MessageBox.Show("您需要输入物理表名");
                    return;
                }
            }
            else
            {
                if (this.TB_URL.Text.Trim().Length == 0)
                {
                    MessageBox.Show("您需要输入 URL ");
                    return;
                }
            }

            string strs = "@EnName=BP.BP.Frm@PKVal=" + pk + "@Name=" + this.TB_Name.Text;

            strs += "@PTable=" + this.TB_PTable.Text + "@FrmType=" + frmType;
            strs += "@FK_Flow=" + string.Empty;
            strs += "@URL=" + this.TB_URL.Text;
            strs += "@DBURL=" + this.DDL_DBUrl.SelectedIndex;
            var client = Glo.GetDesignerServiceInstance();

            client.DoAsync("SaveFlowFrm", strs, true);
            client.DoCompleted += new EventHandler <global::WF.WS.DoCompletedEventArgs>(client_DoCompleted);
        }