示例#1
0
 void CompanyDocWebPart_Loaded(object sender, RoutedEventArgs e)
 {
     //RefreshUI(RefreshedTypes.ShowProgressBar);//打开进度圈
     //loadbar.Start();
     organClient.GetALLCompanyViewAsync("");
     Utility.InitFileLoad("CompanyDoc", TmpSendoc, FormTypes.Browse, uploadFile);
 }
示例#2
0
文件: SystemInit.cs 项目: jjg0519/OA
        private void LoadCompanyInfo()
        {
            organClient.GetALLCompanyViewCompleted += (o, e) =>
            {
                if (e.Error == null)
                {
                    if (e.Result != null)
                    {
                        List <SMT.Saas.Tools.OrganizationWS.V_COMPANY> entTemps = e.Result.ToList();
                        allCompanys = new List <SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY>();
                        var ents = entTemps.OrderBy(c => c.FATHERID);
                        //把公司的视图集合转换为公司实体集合
                        foreach (var ent in ents)
                        {
                            SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY company = new SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY();
                            company.COMPANYID = ent.COMPANYID;
                            company.CNAME     = ent.CNAME;
                            company.ENAME     = ent.ENAME;
                            if (!string.IsNullOrEmpty(ent.BRIEFNAME))
                            {
                                company.BRIEFNAME = ent.BRIEFNAME;
                            }
                            else
                            {
                                company.BRIEFNAME = ent.CNAME;
                            }
                            company.COMPANRYCODE = ent.COMPANRYCODE;
                            company.SORTINDEX    = ent.SORTINDEX;
                            if (!string.IsNullOrEmpty(ent.FATHERCOMPANYID))
                            {
                                company.T_HR_COMPANY2           = new SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY();
                                company.T_HR_COMPANY2.COMPANYID = ent.FATHERCOMPANYID;
                                //modify by 安凯航 2011年9月5日
                                //在父公司ID为空时,不做处理
                                V_COMPANY v_company = entTemps.Where(s => s.COMPANYID == ent.FATHERCOMPANYID).FirstOrDefault();
                                if (v_company != null)
                                {
                                    company.T_HR_COMPANY2.CNAME = v_company.CNAME;
                                }
                                else
                                {
                                    //throw new Exception("v_company");
                                }
                            }
                            //end modify;
                            company.FATHERID   = ent.FATHERID;
                            company.FATHERTYPE = ent.FATHERTYPE;
                            company.CHECKSTATE = ent.CHECKSTATE;
                            company.EDITSTATE  = ent.EDITSTATE;
                            allCompanys.Add(company);
                        }
                        //把公司实体集合存入缓存
                        AddToResourceDictionary <List <SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY> >(ConstStrings.RES_COMPANYINFO_KEY, allCompanys);
                        LoadDepartmentInfo();
                    }
                }
            };

            organClient.GetALLCompanyViewAsync(_UserEmployeeID);
        }
示例#3
0
        /// <summary>
        /// 加载公司数据
        /// </summary>
        public void LoadCompanyInfo()
        {
            organClient.GetALLCompanyViewCompleted += (o, e) =>
            {
                if (e.Error == null)
                {
                    if (e.Result != null)
                    {
                        allCompanysView = e.Result.ToList();
                        ReFillDataToCompany();
                    }
                }
            };

            if (!Application.Current.Resources.Contains("SYS_CompanyInfo"))
            {
                organClient.GetALLCompanyViewAsync(SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID);
            }
            else
            {
                LoadDepartmentInfo();
            }
            //if (V_CompanyInfoVM.IsExists(SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.SysUserID) == false)
            //{
            //    organClient.GetALLCompanyViewAsync(SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID);
            //}
            //else
            //{
            //    GetCompanysByLocal(SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.SysUserID);
            //}
        }
示例#4
0
 //绑定树
 private void BindTree()
 {
     if (Application.Current.Resources.Contains("ORGTREESYSCompanyInfo"))
     {
         // allCompanys = Application.Current.Resources["ORGTREESYSCompanyInfo"] as List<SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY>;
         BindCompany();
     }
     else
     {
         //orgClient.GetCompanyActivedAsync(SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID);
         orgClient.GetALLCompanyViewAsync(SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID);
     }
 }
示例#5
0
 /// <summary>
 /// 绑定树型控件
 /// </summary>
 private void BindTree()
 {
     //触发获取正常的公司
     if (Application.Current.Resources["ORGTREESYSCompanyInfo"] == null)
     {
         loadbar.Start();
         // client.GetCompanyActivedAsync(SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID);
         client.GetALLCompanyViewAsync(SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID);
     }
     else
     {
         BindCompany();
     }
 }