Example #1
0
        private void HyperlinkButton_Click(object sender, RoutedEventArgs e)
        {
            loading.Start();
            T_FLOW_ENGINEMSGLIST source = (sender as HyperlinkButton).DataContext as T_FLOW_ENGINEMSGLIST;

            _currentMessageID = source.MESSAGEID.ToString();

            client.PendingDetailTasksAsync(source.MESSAGEID.ToString());
        }
Example #2
0
        void client_PendingCacheTasksParmsPageIndexCompleted(object sender, PendingCacheTasksParmsPageIndexCompletedEventArgs e)
        {
            try
            {
                if (e.Error == null)
                {
                    // IsAutofresh :是否是自动刷新,如果是自动刷新值为true,手动刷新为false
                    //HaveNewTask:该参数是返回给门户的字段,是自动刷新,引擎缓存发现该用户没有新的待办将返回false,并且返回列表数据为null。引擎缓存如果发现该用户有新的待办将返回true,并且返回新的列表。
                    if (e.IsAutofresh && !e.HaveNewTask)
                    {
                        return;
                    }
                    if (e.Result != null)
                    {
                        pageerVM.PageCount = e.pageCount;

                        List <T_FLOW_ENGINEMSGLIST> result = new List <T_FLOW_ENGINEMSGLIST>();
                        foreach (var item in e.Result)
                        {
                            T_FLOW_ENGINEMSGLIST temp = item;
                            temp.CREATEDATE    = item.CREATEDATE + " " + item.CREATETIME;
                            temp.OPERATIONDATE = item.OPERATIONDATE + " " + item.OPERATIONTIME;
                            result.Add(item);
                        }
                        Resulted.ItemsSource = null;
                        Results.ItemsSource  = null;
                        switch (_state)
                        {
                        case "Close":
                            Resulted.ItemsSource = result; break;

                        case "open":
                            //Results.ItemsSource = result.OrderBy(item => item.CREATEDATE); break;
                            Results.ItemsSource = result; break;

                        default:
                            break;
                        }
                    }
                    else
                    {
                        Resulted.ItemsSource = null;
                        Results.ItemsSource  = null;
                        pageerVM.PageCount   = 0;
                    }
                }
            }
            finally
            {
                if (_refdateTimer != null && _state == "open")
                {
                    _refdateTimer.Start();
                }
            }
        }
Example #3
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);
            }
        }
Example #4
0
        /// <summary>
        /// 解析待办任务
        /// </summary>
        /// <param name="engineTask"></param>
        private void ResolverTask(T_FLOW_ENGINEMSGLIST engineTask)
        {
            try
            {
                #region 解析代码任务的内容
                string messageContent = engineTask.APPLICATIONURL.Trim();

                if (messageContent.Length > 0)
                {
                    SMT.SAAS.Main.CurrentContext.AppContext.SystemMessage("ResolverTask(messageContent):" + messageContent);
                    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 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";

                        //  if (AssemblyName == "SMT.FB.UI")
                        //      defaultVersion = " , Version=1.1.1.1230, 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());

                        bool isKPI = false;
                        string TmpFieldValueString = string.Empty;
                        if (engineTask.APPFIELDVALUE.Length > 0)
                        {
                            TmpFieldValueString = engineTask.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), typeof(Border) };
                            MethodInfo method = type.GetMethod(ProcessName, types);

                            if (method == null)
                                throw new Exception(string.Format("未找到匹配的公共方法,请检测是否存在方法签名为{0}(string,string,string,string,Border);的公共方法", ProcessName));


                            method.Invoke(null, BindingFlags.Static | BindingFlags.InvokeMethod, null, new object[] { ApplicationOrder, PageParameter, FormType, TmpFieldValueString, borTaskContent }, null);
                        }
                        else
                        {
                            borTaskContent.Child = null;

                            Type[] types = new Type[] { typeof(string), typeof(string), typeof(string), typeof(Border) };

                            MethodInfo method = type.GetMethod(ProcessName, types);

                            if (method == null)
                                throw new Exception(string.Format("未找到匹配的公共方法,请检测是否存在方法签名为{0}(string,string,string,Border);的公共方法", ProcessName));

                            method.Invoke(null, BindingFlags.Static | BindingFlags.InvokeMethod, null, new object[] { ApplicationOrder, PageParameter, FormType, borTaskContent }, null);

                        }

                    }
                }
                #endregion
            }
            catch (Exception ex)
            {
                MessageBox.Show("待办任务打开异常,请查看系统日志!");
                Logging.Logger.Current.Log("10000", "Platform", "待办任务", "待办任务打开异常", ex, Logging.Category.Exception, Logging.Priority.High);
            }
            finally
            {
                loading.Stop();
            }
        }
Example #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);
            }
        }
Example #6
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);
            }
        }
Example #7
0
        /// <summary>
        /// 解析待办任务
        /// </summary>
        /// <param name="engineTask"></param>
        private void ResolverTask(T_FLOW_ENGINEMSGLIST engineTask)
        {
            try
            {
                #region 解析代码任务的内容
                string messageContent = engineTask.APPLICATIONURL.Trim();

                if (messageContent.Length > 0)
                {
                    SMT.SAAS.Main.CurrentContext.AppContext.SystemMessage("ResolverTask(messageContent):" + messageContent);
                    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 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";

                        //  if (AssemblyName == "SMT.FB.UI")
                        //      defaultVersion = " , Version=1.1.1.1230, 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());

                        bool   isKPI = false;
                        string TmpFieldValueString = string.Empty;
                        if (engineTask.APPFIELDVALUE.Length > 0)
                        {
                            TmpFieldValueString = engineTask.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), typeof(Border) };
                            MethodInfo method = type.GetMethod(ProcessName, types);

                            if (method == null)
                            {
                                throw new Exception(string.Format("未找到匹配的公共方法,请检测是否存在方法签名为{0}(string,string,string,string,Border);的公共方法", ProcessName));
                            }


                            method.Invoke(null, BindingFlags.Static | BindingFlags.InvokeMethod, null, new object[] { ApplicationOrder, PageParameter, FormType, TmpFieldValueString, borTaskContent }, null);
                        }
                        else
                        {
                            borTaskContent.Child = null;

                            Type[] types = new Type[] { typeof(string), typeof(string), typeof(string), typeof(Border) };

                            MethodInfo method = type.GetMethod(ProcessName, types);

                            if (method == null)
                            {
                                throw new Exception(string.Format("未找到匹配的公共方法,请检测是否存在方法签名为{0}(string,string,string,Border);的公共方法", ProcessName));
                            }

                            method.Invoke(null, BindingFlags.Static | BindingFlags.InvokeMethod, null, new object[] { ApplicationOrder, PageParameter, FormType, borTaskContent }, null);
                        }
                    }
                }
                #endregion
            }
            catch (Exception ex)
            {
                MessageBox.Show("待办任务打开异常,请查看系统日志!");
                Logging.Logger.Current.Log("10000", "Platform", "待办任务", "待办任务打开异常", ex, Logging.Category.Exception, Logging.Priority.High);
            }
            finally
            {
                loading.Stop();
            }
        }
Example #8
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);
            }
        }
Example #9
0
        private void HyperlinkButton_Click(object sender, RoutedEventArgs e)
        {
            T_FLOW_ENGINEMSGLIST source = (sender as HyperlinkButton).DataContext as T_FLOW_ENGINEMSGLIST;

            ShowTask(source.MESSAGEID, source.APPLICATIONURL);
        }
Example #10
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());
            }
        }
Example #11
0
        private void client_PendingMainTasksParmsCompleted(object sender, PendingCacheMainTasksParmsCompletedEventArgs e)
        {
            try
            {
                if (loading != null)
                {
                    loading.Stop();
                }

                // IsAutofresh :是否是自动刷新,如果是自动刷新值为true,手动刷新为false
                // HaveNewTask:该参数是返回给门户的字段,是自动刷新,
                //引擎缓存发现该用户没有新的待办将返回false,并且返回列表数据为null。
                //引擎缓存如果发现该用户有新的待办将返回true,并且返回新的列表。
                if (e.IsAutofresh && !e.HaveNewTask)
                {
                    return;
                }
                if (e.Result != null)
                {
                    List <T_FLOW_ENGINEMSGLIST> result = new List <T_FLOW_ENGINEMSGLIST>();
                    foreach (var item in e.Result)
                    {
                        T_FLOW_ENGINEMSGLIST temp = item;

                        temp.CREATEDATE    = item.CREATEDATE + " " + item.CREATETIME;
                        temp.OPERATIONDATE = item.OPERATIONDATE + " " + item.OPERATIONTIME;
                        result.Add(item);
                    }

                    switch (_state)
                    {
                    case "Close":
                        Resulted.ItemsSource = result.OrderByDescending(item => item.OPERATIONDATE); break;

                    case "open":
                        //Results.ItemsSource = result.OrderBy(item => item.CREATEDATE); break;
                        Results.ItemsSource = result; break;

                    default:
                        break;
                    }
                }
                else
                {
                    Resulted.ItemsSource = null;
                    Results.ItemsSource  = null;
                }
            }
            catch (Exception ex)
            {
                Logging.Logger.Current.Log("10000", "Platform", "待办任务", "读取待办任务异常", ex, Logging.Category.Exception, Logging.Priority.High);
            }
            finally
            {
                //_endTime = DateTime.Now;
                //WriterLog();
                if (_refdateTimer != null && _state == "open")
                {
                    _refdateTimer.Start();
                }
            }
        }