Example #1
0
        /// <summary>
        /// 获取当前用户能够操作的公司ID,以“,”分割
        /// </summary>
        /// <returns></returns>
        public static string GetOwnerCompanyId()
        {
            string allOwnerCompanyId = "";
            bool   bol = true;

            #region 加载所有公司
            try
            {
                string path    = "silverlightcache\\" + Utility.CurrentUser.EMPLOYEEID + "ID.txt";
                var    company = SLCache.GetCache <string>(path, 5);
                if (company != null)
                {
                    allOwnerCompanyId = company;
                    return(company);
                }
                else
                {
                    SMT.Saas.Tools.OrganizationWS.OrganizationServiceClient osc = new Saas.Tools.OrganizationWS.OrganizationServiceClient();
                    osc.GetCompanyViewAsync(Utility.CurrentUser.EMPLOYEEID, "3", "");
                    osc.GetCompanyViewCompleted += (obj, args) =>
                    {
                        if (args.Result != null)
                        {
                            string companylist = "";
                            foreach (var ent in args.Result)
                            {
                                companylist += "'" + ent.COMPANYID + "',";
                            }
                            allOwnerCompanyId = companylist.TrimEnd(',');
                            SLCache.SaveData <string>(companylist.TrimEnd(','), path);
                        }
                        bol = false;
                    };
                    //等异步完成
                    while (bol)
                    {
                        //等异步完成
                    }
                    ;
                    return(allOwnerCompanyId);
                }
            }
            catch (Exception ee)
            {
                SMT.SaaS.FrameworkUI.ChildWidow.ComfirmWindow.ConfirmationBox("错误信息", ee.Message, "确定");
                return(null);
            }
            #endregion
        }
Example #2
0
 public void GetChildCompanyID(string systemCode, string modelCode)
 {
     SMT.Saas.Tools.OrganizationWS.OrganizationServiceClient osc = new Saas.Tools.OrganizationWS.OrganizationServiceClient();
     #region 没有权限
     //osc.GetCompanyAllAsync("");
     ObservableCollection <string> ids = new ObservableCollection <string>();
     ids.Add(SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID);
     osc.GetChildCompanyByCompanyIDAsync(ids);
     osc.GetChildCompanyByCompanyIDCompleted += (obj, args) =>
     {
         if (args.Result != null)
         {
             //strAllOwnerCompanyId += "'" + usr.CompanyID + "',";
             var childCompanyID = "'" + SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID + "',";
             foreach (var companyID in args.Result)
             {
                 childCompanyID += "'" + companyID + "',";
             }
             childCompanyID = childCompanyID.TrimEnd(',');
             #region 条件
             string strFliter = "";
             int    pageCont  = 0;
             if (systemCode != string.Empty)
             {
                 strFliter += " AND c.SYSTEMCODE='" + systemCode + "'";
             }
             if (modelCode != string.Empty)
             {
                 strFliter += " AND c.MODELCODE='" + modelCode + "'";
             }
             if (txtFlowName.Text.Trim() != string.Empty)
             {
                 strFliter += " AND a.description like'%" + txtFlowName.Text.Trim() + "%'";
             }
             strFliter += " AND (b.companyid in (" + childCompanyID + ")";
             strFliter += " OR b.CREATECOMPANYID in (" + childCompanyID + "))";
             #endregion
             client.GetFlowDefineListAsync(dataPager1.PageSize, dataPager1.PageIndex, strFliter, "", pageCont);
         }
     };
     #endregion
 }
Example #3
0
 public void GetAllOwnerCompanyId()
 {
     allOwnerCompanyId = "";
     #region 加载所有公司
     try
     {
         string path    = "silverlightcache\\" + Utility.CurrentUser.EMPLOYEEID + "ID.txt";
         var    company = SLCache.GetCache <string>(path, 5);
         if (company != null)
         {
             allOwnerCompanyId = company;
             // return company;
         }
         else
         {
             SMT.Saas.Tools.OrganizationWS.OrganizationServiceClient osc = new Saas.Tools.OrganizationWS.OrganizationServiceClient();
             osc.GetCompanyViewAsync(Utility.CurrentUser.EMPLOYEEID, "3", "");
             osc.GetCompanyViewCompleted += (obj, args) =>
             {
                 if (args.Result != null)
                 {
                     string companylist = "";
                     foreach (var ent in args.Result)
                     {
                         companylist += "'" + ent.COMPANYID + "',";
                     }
                     allOwnerCompanyId = companylist.TrimEnd(',');
                     BindCompanyList1();
                     BindCompanyList2();
                     SLCache.SaveData <string>(companylist.TrimEnd(','), path);
                 }
             };
             System.Threading.Thread.Sleep(1000);//等异步完成
         }
     }
     catch (Exception ee)
     {
         ComfirmWindow.ConfirmationBox("错误信息", ee.Message, "确定");
     }
     #endregion
 }
Example #4
0
        public EntityBrowser(object editor)
        {
            BtnSaveSubmit.Click += new RoutedEventHandler(btnSubmit_Click);
            HrCommws = new Saas.Tools.HrCommonServiceWS.HrCommonServiceClient();
            Orgws = new Saas.Tools.OrganizationWS.OrganizationServiceClient();
            HrCommws.GetAppConfigByNameCompleted += new EventHandler<Saas.Tools.HrCommonServiceWS.GetAppConfigByNameCompletedEventArgs>(HrCommws_GetAppConfigByNameCompleted);
            Orgws.UpdateCheckStateCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(Orgws_UpdateCheckStateCompleted);
            InitializeComponent();

            EditorCtrl = editor as Control;
            EntityBrowseToolBar = this.ToolBarRow;
            // 判断当前加载项是否是流程
            if (editor.GetType().ToString() == "SMT.FlowDesigner.FlowPanel" || editor.GetType().ToString() == "SMT.FlowDesigner.TaskPanel")
            {
                TabContainer = new TabControl();
                Container.Children.Add(EditorCtrl);
                pnlContainer.Visibility = Visibility.Collapsed;
            }
            else
            {

                TabContainer = Common.Utility.FindChildControl<TabControl>(EditorCtrl);
                if (TabContainer == null)
                {
                    TabContainer = new TabControl();
                    TabItem item = new TabItem();
                    item.Header = Common.Utility.GetResourceStr("BASEINFO");

                    TabContainer.Style = (Style)Application.Current.Resources["TabControlStyle"];
                    item.Style = (Style)Application.Current.Resources["TabItemStyle"];

                    item.Content = EditorCtrl;
                    TabContainer.Items.Add(item);


                    pnlContainer.Children.Add(TabContainer);

                    PnlAudit.Visibility = Visibility.Collapsed;
                }
                else
                {
                    //加载当前的信息
                    pnlContainer.Children.Add(EditorCtrl);

                }
            }
            ViewContainer.Visibility = Visibility.Collapsed;
            if (editor is IEntityEditor)
                ((IEntityEditor)editor).OnUIRefreshed += new UIRefreshedHandler(editor_OnUIRefreshed);

            EntityEditor = editor;
            AddAuditControl();
            GenerateEntityTitle();
            //beyond 隐藏kpi
            AddKPIControl();
            //帮助注释掉
            //if (toolBarTop != null)
            //{
            //    toolBarTop.ButtonHelp.Click += new RoutedEventHandler(ButtonHelp_Click);
            //}
            //设置entitybrowser内部显示区域高度,以显示垂直进度条
            try
            {
                if (ParentWindow != null)
                {
                    SVShowContent.Width = ParentWindow.ActualWidth;
                    SVShowContent.Height = ParentWindow.ActualHeight - toolBarTop.ActualHeight
                        - toolBarBottom.ActualHeight - AuditCtrl.ActualHeight;
                }
            }
            catch (Exception ex)
            {
                SMT.SAAS.Main.CurrentContext.AppContext.SystemMessage(ex.ToString());

            }
        }
Example #5
0
 public void GetAllOwnerCompanyId()
 {
     allOwnerCompanyId = "";
     #region 加载所有公司
     try
     {
         string path = "silverlightcache\\" + Utility.CurrentUser.EMPLOYEEID + "ID.txt";
         var company = SLCache.GetCache<string>(path, 5);
         if (company != null)
         {
             allOwnerCompanyId = company;
             // return company;
         }
         else
         {
             SMT.Saas.Tools.OrganizationWS.OrganizationServiceClient osc = new Saas.Tools.OrganizationWS.OrganizationServiceClient();
             osc.GetCompanyViewAsync(Utility.CurrentUser.EMPLOYEEID, "3", "");
             osc.GetCompanyViewCompleted += (obj, args) =>
             {
                 if (args.Result != null)
                 {
                     string companylist = "";
                     foreach (var ent in args.Result)
                     {
                         companylist += "'" + ent.COMPANYID + "',";
                     }
                     allOwnerCompanyId = companylist.TrimEnd(',');
                     BindCompanyList1();
                     BindCompanyList2();
                     SLCache.SaveData<string>(companylist.TrimEnd(','), path);
                 }
             };
             System.Threading.Thread.Sleep(1000);//等异步完成
         }
     }
     catch (Exception ee)
     {
         ComfirmWindow.ConfirmationBox("错误信息", ee.Message, "确定");
     }
     #endregion
 }
Example #6
0
 public void GetChildCompanyID(string systemCode, string modelCode)
 {
     SMT.Saas.Tools.OrganizationWS.OrganizationServiceClient osc = new Saas.Tools.OrganizationWS.OrganizationServiceClient();
     #region 没有权限
     //osc.GetCompanyAllAsync("");
     ObservableCollection<string> ids = new ObservableCollection<string>();
     ids.Add(SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID);
     osc.GetChildCompanyByCompanyIDAsync(ids);
     osc.GetChildCompanyByCompanyIDCompleted += (obj, args) =>
     {
         if (args.Result != null)
         {
             //strAllOwnerCompanyId += "'" + usr.CompanyID + "',";
             var childCompanyID = "'" + SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID + "',";
             foreach (var companyID in args.Result)
             {
                 childCompanyID += "'" + companyID + "',";
             }
             childCompanyID = childCompanyID.TrimEnd(',');
             #region 条件
             string strFliter = "";
             int pageCont = 0;
             if (systemCode != string.Empty)
             {
                 strFliter += " AND c.SYSTEMCODE='" + systemCode + "'";
             }
             if (modelCode != string.Empty)
             {
                 strFliter += " AND c.MODELCODE='" + modelCode + "'";
             }
             if (txtFlowName.Text.Trim() != string.Empty)
             {
                 strFliter += " AND a.description like'%" + txtFlowName.Text.Trim() + "%'";
             }
             strFliter += " AND (b.companyid in (" + childCompanyID + ")";
             strFliter += " OR b.CREATECOMPANYID in (" + childCompanyID + "))";
             #endregion
             client.GetFlowDefineListAsync(dataPager1.PageSize, dataPager1.PageIndex, strFliter, "", pageCont);
         }
     };
     #endregion
 }