Exemplo n.º 1
0
        private void client_PendingDetailTasksCompleted(object sender, PendingDetailTasksCompletedEventArgs e)
        {
            try
            {
                if (e.Error == null)
                {
                    if (e.Result != null)
                    {
                        if (!string.IsNullOrEmpty(e.Result.MODELNAME))
                        {
                            Titel = e.Result.MODELNAME;
                        }
                        _currentEngineTask = e.Result;
                        if (_currentEngineTask == null)
                        {
                            string msg = "待办元数据错误,获取的值为空,根据历史经验,是没有配置默认消息导致,请配置后在模块打回此单据,重新提交。";
                            MessageBox.Show(msg);
                            return;
                        }
                        if (string.IsNullOrEmpty(Titel))
                        {
                            string msg = "待办元数据错误,获取的模块名为空,根据历史经验,是没有配置默认消息导致,请配置后在模块打回此单据,重新提交。MODELNAME=" + _currentEngineTask.MODELNAME;
                            SMT.SAAS.Main.CurrentContext.AppContext.SystemMessage(msg);
                        }
                        if (checkXmlFail(_currentEngineTask.APPLICATIONURL))
                        {
                            string msg = "待办元数据错误,元数据解析错误,根据历史经验,是没有配置默认消息导致,请配置后在模块打回此单据,重新提交。applicationUrl=" + _currentEngineTask.APPLICATIONURL;
                            MessageBox.Show(msg);
                            return;
                        }

                        applicationUrl = _currentEngineTask.APPLICATIONURL.Trim();

                        OpenFromXML(Titel, applicationUrl);
                    }
                }
                else
                {
                    SMT.SAAS.Main.CurrentContext.AppContext.SystemMessage("client_PendingDetailTasksCompleted error:" + e.Error.ToString());
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("待办任务打开异常,请查看系统日志!");
                Logging.Logger.Current.Log("10000", "Platform", "待办任务", "待办任务打开异常", ex, Logging.Category.Exception, Logging.Priority.High);
            }
        }
Exemplo n.º 2
0
        private void client_PendingDetailTasksCompleted(object sender, PendingDetailTasksCompletedEventArgs e)
        {
            try
            {
                if (e.Error == null)
                {
                    if (e.Result != null)
                    {
                        string titel = "";
                        if (!string.IsNullOrEmpty(e.Result.MODELNAME))
                        {
                            titel = e.Result.MODELNAME;
                        }

                        ViewModel.Context.MainPanel.SetTitel(titel);
                        _currentEngineTask = e.Result;
                        string messageContent = _currentEngineTask.APPLICATIONURL.Trim();
                        using (XmlReader reader = XmlReader.Create(new StringReader(messageContent)))
                        {
                            XElement xmlClient = XElement.Load(reader);
                            var temp = from c in xmlClient.DescendantsAndSelf("System")
                                       select c;
                            string AssemblyName = temp.Elements("AssemblyName").SingleOrDefault().Value.Trim();
                            string strUrl = temp.Elements("PageParameter").SingleOrDefault().Value.Trim();
                            string strOid = temp.Elements("ApplicationOrder").SingleOrDefault().Value.Trim();
                            if (AssemblyName == "GiftApplyMaster" || AssemblyName == "GiftPlan" || AssemblyName == "SumGiftPlan")
                            {
                                loading.Stop();
                                try
                                {
                                    HtmlWindow wd = HtmlPage.Window;
                                    strUrl = strUrl.Split(',')[0];
                                    if (strUrl.IndexOf('?') > -1)
                                    {
                                        strUrl = strUrl + "&uid=" + SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID + "&oid=" + strOid;
                                    }
                                    else
                                    {
                                        strUrl = strUrl + "?uid=" + SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID + "&oid=" + strOid;
                                    }
                                    string strHost = SMT.SAAS.Main.CurrentContext.Common.HostAddress.ToString().Split('/')[0];
                                    strUrl = "http://" + strHost + "/" + strUrl;
                                    Uri uri = new Uri(strUrl);
                                    HtmlPopupWindowOptions options = new HtmlPopupWindowOptions();
                                    options.Directories = false;
                                    options.Location = false;
                                    options.Menubar = false;
                                    options.Status = false;
                                    options.Toolbar = false;
                                    options.Status = false;
                                    options.Resizeable = true;
                                    options.Left = 280;
                                    options.Top = 100;
                                    options.Width = 800;
                                    options.Height = 600;
                                    // HtmlPage.PopupWindow(uri, AssemblyName, options);
                                    string strWindow = System.DateTime.Now.ToString("yyMMddHHmsssfff");
                                    wd.Navigate(uri, strWindow, "directories=no,fullscreen=no,menubar=no,resizable=yes,scrollbars=yes,status=no,titlebar=no,toolbar=no");
                                }
                                catch
                                {
                                    MessageBox.Show("模块链接异常:" + strUrl);
                                }
                            }
                            else
                            {

                                CheckeDepends(AssemblyName);
                            }
                        }
                    }

                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("待办任务打开异常,请查看系统日志!");
                Logging.Logger.Current.Log("10000", "Platform", "待办任务", "待办任务打开异常", ex, Logging.Category.Exception, Logging.Priority.High);
            }
        }
Exemplo n.º 3
0
        private void client_PendingDetailTasksCompleted(object sender, PendingDetailTasksCompletedEventArgs e)
        {
            try
            {
                if (e.Error == null)
                {
                    if (e.Result != null)
                    {
                        T_FLOW_ENGINEMSGLIST source = e.Result;
                        string sss = source.APPLICATIONURL.Trim();
                        if (sss.Length > 0)
                        {
                            using (XmlReader reader = XmlReader.Create(new StringReader(sss)))
                            {
                                XElement xmlClient = XElement.Load(reader);
                                var temp = from c in xmlClient.DescendantsAndSelf("System")
                                           select c;
                                string AssemblyName = temp.Elements("AssemblyName").SingleOrDefault().Value.Trim();
                                string PublicClass = temp.Elements("PublicClass").SingleOrDefault().Value.Trim();
                                string ProcessName = temp.Elements("ProcessName").SingleOrDefault().Value.Trim();
                                string PageParameter = temp.Elements("PageParameter").SingleOrDefault().Value.Trim();
                                string ApplicationOrder = temp.Elements("ApplicationOrder").SingleOrDefault().Value.Trim();
                                string FormType = temp.Elements("FormTypes").SingleOrDefault().Value.Trim();

                                string defaultVersion = " , Version=1.0.0.0, Culture=neutral, PublicKeyToken=null";
                                StringBuilder typeString = new StringBuilder();
                                typeString.Append(PublicClass);
                                typeString.Append(", ");
                                typeString.Append(AssemblyName);
                                typeString.Append(defaultVersion);

                                Type type = Type.GetType(typeString.ToString());

                                object instance = Activator.CreateInstance(type);

                                bool isKPI = false;
                                string TmpFieldValueString = string.Empty;
                                if (source.APPFIELDVALUE.Length > 0)
                                {
                                    TmpFieldValueString = source.APPFIELDVALUE;
                                    string[] valuerownode = TmpFieldValueString.Split('Ё');
                                    for (int j = 0; j < valuerownode.Length; j++)
                                    {
                                        if (valuerownode[j] != "")
                                        {
                                            string[] valuecolnode = valuerownode[j].Split('|');
                                            if (valuecolnode[0] == "IsKpi")
                                            {
                                                isKPI = valuecolnode[1] == "1" ? true : false;
                                            }
                                        }
                                    }
                                }

                                if (isKPI)
                                {
                                    TmpFieldValueString += "ЁMESSAGEID|" + _currentMessageID;
                                    Type[] types = new Type[] { typeof(string), typeof(string), typeof(string), typeof(string) };
                                    MethodInfo method = type.GetMethod(ProcessName, types);
                                    method.Invoke(null, BindingFlags.Static | BindingFlags.InvokeMethod, null, new object[] { ApplicationOrder, PageParameter, FormType, TmpFieldValueString }, null);
                                }
                                else
                                {

                                    Type[] types = new Type[] { typeof(string), typeof(string), typeof(string) };
                                    MethodInfo method = type.GetMethod(ProcessName, types);
                                    method.Invoke(null, BindingFlags.Static | BindingFlags.InvokeMethod, null, new object[] { ApplicationOrder, PageParameter, FormType }, null);

                                }
                            }
                        }
                    }

                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Exemplo n.º 4
0
        private void client_PendingDetailTasksCompleted(object sender, PendingDetailTasksCompletedEventArgs e)
        {
            try
            {
                if (e.Error == null)
                {
                    if (e.Result != null)
                    {
                        if (!string.IsNullOrEmpty(e.Result.MODELNAME))
                        {
                            Titel = e.Result.MODELNAME;
                        }                       
                        _currentEngineTask = e.Result;
                        if (_currentEngineTask==null)
                        {
                            string msg = "待办元数据错误,获取的值为空,根据历史经验,是没有配置默认消息导致,请配置后在模块打回此单据,重新提交。" ;
                            MessageBox.Show(msg);
                            return;
                        }
                        if (string.IsNullOrEmpty(Titel))
                        {
                            string msg = "待办元数据错误,获取的模块名为空,根据历史经验,是没有配置默认消息导致,请配置后在模块打回此单据,重新提交。MODELNAME=" + _currentEngineTask.MODELNAME;
                            SMT.SAAS.Main.CurrentContext.AppContext.SystemMessage(msg);
                        }
                        if (checkXmlFail(_currentEngineTask.APPLICATIONURL))
                        {
                            string msg = "待办元数据错误,元数据解析错误,根据历史经验,是没有配置默认消息导致,请配置后在模块打回此单据,重新提交。applicationUrl=" + _currentEngineTask.APPLICATIONURL;
                            MessageBox.Show(msg);
                            return;
                        }

                        applicationUrl = _currentEngineTask.APPLICATIONURL.Trim();

                        OpenFromXML(Titel, applicationUrl);
                    }

                }else
                {
                    SMT.SAAS.Main.CurrentContext.AppContext.SystemMessage("client_PendingDetailTasksCompleted error:" + e.Error.ToString());
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("待办任务打开异常,请查看系统日志!");               
                Logging.Logger.Current.Log("10000", "Platform", "待办任务", "待办任务打开异常", ex, Logging.Category.Exception, Logging.Priority.High);
            }
        }
Exemplo n.º 5
0
        private void client_PendingDetailTasksCompleted(object sender, PendingDetailTasksCompletedEventArgs e)
        {
            try
            {
                if (e.Error == null)
                {
                    if (e.Result != null)
                    {
                        string titel = "";
                        if (!string.IsNullOrEmpty(e.Result.MODELNAME))
                        {
                            titel = e.Result.MODELNAME;
                        }

                        ViewModel.Context.MainPanel.SetTitel(titel);
                        _currentEngineTask = e.Result;
                        string messageContent = _currentEngineTask.APPLICATIONURL.Trim();
                        using (XmlReader reader = XmlReader.Create(new StringReader(messageContent)))
                        {
                            XElement xmlClient = XElement.Load(reader);
                            var      temp      = from c in xmlClient.DescendantsAndSelf("System")
                                                 select c;
                            string AssemblyName = temp.Elements("AssemblyName").SingleOrDefault().Value.Trim();
                            string strUrl       = temp.Elements("PageParameter").SingleOrDefault().Value.Trim();
                            string strOid       = temp.Elements("ApplicationOrder").SingleOrDefault().Value.Trim();
                            if (AssemblyName == "GiftApplyMaster" || AssemblyName == "GiftPlan" || AssemblyName == "SumGiftPlan")
                            {
                                loading.Stop();
                                try
                                {
                                    HtmlWindow wd = HtmlPage.Window;
                                    strUrl = strUrl.Split(',')[0];
                                    if (strUrl.IndexOf('?') > -1)
                                    {
                                        strUrl = strUrl + "&uid=" + SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID + "&oid=" + strOid;
                                    }
                                    else
                                    {
                                        strUrl = strUrl + "?uid=" + SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID + "&oid=" + strOid;
                                    }
                                    string strHost = SMT.SAAS.Main.CurrentContext.Common.HostAddress.ToString().Split('/')[0];
                                    strUrl = "http://" + strHost + "/" + strUrl;
                                    Uri uri = new Uri(strUrl);
                                    HtmlPopupWindowOptions options = new HtmlPopupWindowOptions();
                                    options.Directories = false;
                                    options.Location    = false;
                                    options.Menubar     = false;
                                    options.Status      = false;
                                    options.Toolbar     = false;
                                    options.Status      = false;
                                    options.Resizeable  = true;
                                    options.Left        = 280;
                                    options.Top         = 100;
                                    options.Width       = 800;
                                    options.Height      = 600;
                                    // HtmlPage.PopupWindow(uri, AssemblyName, options);
                                    string strWindow = System.DateTime.Now.ToString("yyMMddHHmsssfff");
                                    wd.Navigate(uri, strWindow, "directories=no,fullscreen=no,menubar=no,resizable=yes,scrollbars=yes,status=no,titlebar=no,toolbar=no");
                                }
                                catch
                                {
                                    MessageBox.Show("模块链接异常:" + strUrl);
                                }
                            }
                            else
                            {
                                CheckeDepends(AssemblyName);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("待办任务打开异常,请查看系统日志!");
                Logging.Logger.Current.Log("10000", "Platform", "待办任务", "待办任务打开异常", ex, Logging.Category.Exception, Logging.Priority.High);
            }
        }
Exemplo n.º 6
0
        private void client_PendingDetailTasksCompleted(object sender, PendingDetailTasksCompletedEventArgs e)
        {
            try
            {
                if (e.Error == null)
                {
                    if (e.Result != null)
                    {
                        T_FLOW_ENGINEMSGLIST source = e.Result;
                        string sss = source.APPLICATIONURL.Trim();
                        if (sss.Length > 0)
                        {
                            using (XmlReader reader = XmlReader.Create(new StringReader(sss)))
                            {
                                XElement xmlClient = XElement.Load(reader);
                                var      temp      = from c in xmlClient.DescendantsAndSelf("System")
                                                     select c;
                                string AssemblyName     = temp.Elements("AssemblyName").SingleOrDefault().Value.Trim();
                                string PublicClass      = temp.Elements("PublicClass").SingleOrDefault().Value.Trim();
                                string ProcessName      = temp.Elements("ProcessName").SingleOrDefault().Value.Trim();
                                string PageParameter    = temp.Elements("PageParameter").SingleOrDefault().Value.Trim();
                                string ApplicationOrder = temp.Elements("ApplicationOrder").SingleOrDefault().Value.Trim();
                                string FormType         = temp.Elements("FormTypes").SingleOrDefault().Value.Trim();

                                string        defaultVersion = " , Version=1.0.0.0, Culture=neutral, PublicKeyToken=null";
                                StringBuilder typeString     = new StringBuilder();
                                typeString.Append(PublicClass);
                                typeString.Append(", ");
                                typeString.Append(AssemblyName);
                                typeString.Append(defaultVersion);

                                Type type = Type.GetType(typeString.ToString());

                                object instance = Activator.CreateInstance(type);

                                bool   isKPI = false;
                                string TmpFieldValueString = string.Empty;
                                if (source.APPFIELDVALUE.Length > 0)
                                {
                                    TmpFieldValueString = source.APPFIELDVALUE;
                                    string[] valuerownode = TmpFieldValueString.Split('Ё');
                                    for (int j = 0; j < valuerownode.Length; j++)
                                    {
                                        if (valuerownode[j] != "")
                                        {
                                            string[] valuecolnode = valuerownode[j].Split('|');
                                            if (valuecolnode[0] == "IsKpi")
                                            {
                                                isKPI = valuecolnode[1] == "1" ? true : false;
                                            }
                                        }
                                    }
                                }

                                if (isKPI)
                                {
                                    TmpFieldValueString += "ЁMESSAGEID|" + _currentMessageID;
                                    Type[]     types  = new Type[] { typeof(string), typeof(string), typeof(string), typeof(string) };
                                    MethodInfo method = type.GetMethod(ProcessName, types);
                                    method.Invoke(null, BindingFlags.Static | BindingFlags.InvokeMethod, null, new object[] { ApplicationOrder, PageParameter, FormType, TmpFieldValueString }, null);
                                }
                                else
                                {
                                    Type[]     types  = new Type[] { typeof(string), typeof(string), typeof(string) };
                                    MethodInfo method = type.GetMethod(ProcessName, types);
                                    method.Invoke(null, BindingFlags.Static | BindingFlags.InvokeMethod, null, new object[] { ApplicationOrder, PageParameter, FormType }, null);
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }