Esempio n. 1
0
        void ayTools_InitAsyncCompleted(object sender, EventArgs e)
        {
            loading.Stop();
            PendingTaskManager manager = new PendingTaskManager(_currentSourceMsgID, _state);
            using (XmlReader reader = XmlReader.Create(new StringReader(_currentXmlObj)))
            {
                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")
                {

                    try
                    {
                        HtmlWindow wd = HtmlPage.Window;
                        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
                {
                    if (ViewModel.Context.MainPanel != null)
                    {
                        if (ViewModel.Context.MainPanel.DefaultContent != null)
                        {
                            IWebpart webpart = ViewModel.Context.MainPanel.DefaultContent as IWebpart;
                            if (webpart != null)
                                webpart.Stop();

                        }
                        Stop();
                        ViewModel.Context.MainPanel.Navigation(manager, "待办任务");
                    }
                }
            }
        }
Esempio n. 2
0
        void ayTools_InitAsyncCompleted(object sender, EventArgs e)
        {
            loading.Stop();
            PendingTaskManager manager = new PendingTaskManager(_currentSourceMsgID, _state);

            using (XmlReader reader = XmlReader.Create(new StringReader(_currentXmlObj)))
            {
                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")
                {
                    try
                    {
                        HtmlWindow wd = HtmlPage.Window;
                        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
                {
                    if (ViewModel.Context.MainPanel != null)
                    {
                        if (ViewModel.Context.MainPanel.DefaultContent != null)
                        {
                            IWebpart webpart = ViewModel.Context.MainPanel.DefaultContent as IWebpart;
                            if (webpart != null)
                            {
                                webpart.Stop();
                            }
                        }
                        Stop();
                        ViewModel.Context.MainPanel.Navigation(manager, "待办任务");
                    }
                }
            }
        }