Пример #1
0
        /// <summary>
        /// 加载公司
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void orgClient_GetCompanyByIdCompleted(object sender, GetCompanyByIdCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY entCompany = e.Result;

                lkAssignObject.DataContext       = entCompany;
                lkAssignObject.DisplayMemberPath = "CNAME";
                if (entCompany != null)
                {
                    AttendMonthlyBatchBalance.BALANCEOBJECTNAME = entCompany.CNAME;

                    if (entCompany.COMPANYID != AttendMonthlyBatchBalance.OWNERCOMPANYID)
                    {
                        var temp = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts.Where(c => c.CompanyID == entCompany.COMPANYID);
                        if (temp != null && temp.Count() > 0)
                        {
                            AttendMonthlyBatchBalance.OWNERCOMPANYID    = temp.FirstOrDefault().CompanyID;
                            AttendMonthlyBatchBalance.OWNERDEPARTMENTID = temp.FirstOrDefault().DepartmentID;
                            AttendMonthlyBatchBalance.OWNERPOSTID       = temp.FirstOrDefault().PostID;
                        }
                        BindGrid();
                    }
                    else
                    {
                        BindGrid();
                    }
                }
            }
            else
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(e.Error.Message));
            }
        }
Пример #2
0
        /// <summary>
        /// 选择人员
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void LookUp_FindClick(object sender, EventArgs e)
        {
            #region ----多选人员
            OrganizationLookup lookup = new OrganizationLookup();

            lookup.SelectedObjType = OrgTreeItemTypes.Personnel;
            lookup.MultiSelected   = true;
            lookup.SelectedClick  += (obj, ev) =>
            {
                List <ExtOrgObj> ents = lookup.SelectedObj as List <ExtOrgObj>;

                foreach (var employeeInfo in ents)
                {
                    V_EmployeeAddsumView addSumInfo = new V_EmployeeAddsumView();
                    //人员重复跳过
                    var tmp = EmployeeAddsumInfoList.Where(s => s.EMPLOYEEID == employeeInfo.ObjectID).FirstOrDefault();
                    if (tmp != null)
                    {
                        continue;
                    }

                    //岗位
                    ExtOrgObj post     = (ExtOrgObj)employeeInfo.ParentObject;
                    string    postid   = post.ObjectID;
                    string    postName = post.ObjectName;

                    //部门
                    ExtOrgObj dept    = (ExtOrgObj)post.ParentObject;
                    string    deptid  = dept.ObjectID;
                    string    depName = dept.ObjectName;

                    //公司
                    SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY corp = (dept.ObjectInstance as SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT).T_HR_COMPANY;
                    string corpid      = corp.COMPANYID;
                    string companyName = corp.CNAME;

                    //员工信息
                    var temp = employeeInfo.ObjectInstance as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;

                    addSumInfo.ADDSUMID          = Guid.NewGuid().ToString();
                    addSumInfo.CompanyName       = companyName;
                    addSumInfo.PostName          = postName;
                    addSumInfo.DepartmentName    = depName;
                    addSumInfo.EMPLOYEECODE      = temp.EMPLOYEECODE;
                    addSumInfo.EMPLOYEEID        = temp.EMPLOYEEID;
                    addSumInfo.EMPLOYEENAME      = temp.EMPLOYEECNAME;// +"-" + postName + "-" + depName + "-" + companyName;
                    addSumInfo.OWNERID           = temp.EMPLOYEEID;
                    addSumInfo.OWNERCOMPANYID    = corpid;
                    addSumInfo.OWNERDEPARTMENTID = deptid;
                    addSumInfo.OWNERPOSTID       = postid;
                    EmployeeAddsumInfoList.Add(addSumInfo);
                }

                DtGrid.ItemsSource = EmployeeAddsumInfoList;
                SetProjectMoneySum();
            };

            lookup.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { });
            #endregion
        }
Пример #3
0
        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);
        }
Пример #4
0
        /// <summary>
        /// 选取分配对象
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void lkAssignObject_FindClick(object sender, EventArgs e)
        {
            if (cbxkAssignedObjectType.SelectedItem == null)
            {
                return;
            }

            T_SYS_DICTIONARY entDic = cbxkAssignedObjectType.SelectedItem as T_SYS_DICTIONARY;

            if (string.IsNullOrEmpty(entDic.DICTIONARYID) || string.IsNullOrEmpty(entDic.DICTIONCATEGORY) || string.IsNullOrEmpty(entDic.DICTIONARYVALUE.ToString()))
            {
                return;
            }

            OrganizationLookupForm lookup = new OrganizationLookupForm();

            if (entDic.DICTIONARYVALUE.ToString() == (Convert.ToInt32(AssignedObjectType.Company) + 1).ToString())
            {
                lookup.SelectedObjType = OrgTreeItemTypes.Company;
            }
            else if (entDic.DICTIONARYVALUE.ToString() == (Convert.ToInt32(AssignedObjectType.Department) + 1).ToString())
            {
                lookup.SelectedObjType = OrgTreeItemTypes.Department;
            }
            else if (entDic.DICTIONARYVALUE.ToString() == (Convert.ToInt32(AssignedObjectType.Post) + 1).ToString())
            {
                lookup.SelectedObjType = OrgTreeItemTypes.Post;
            }

            lookup.SelectedClick += (obj, ev) =>
            {
                lkAssignObject.DataContext = lookup.SelectedObj;

                if (lookup.SelectedObj is SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY)
                {
                    lkAssignObject.DisplayMemberPath = "CNAME";
                    SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY entCompany = lkAssignObject.DataContext as SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY;
                    BalanceObjectValue = entCompany.COMPANYID;
                }
                else if (lookup.SelectedObj is SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT)
                {
                    lkAssignObject.DisplayMemberPath = "T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME";
                    SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT entDepartment = lkAssignObject.DataContext as SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT;
                    BalanceObjectValue = entDepartment.DEPARTMENTID;
                }
                else if (lookup.SelectedObj is SMT.Saas.Tools.OrganizationWS.T_HR_POST)
                {
                    lkAssignObject.DisplayMemberPath = "T_HR_POSTDICTIONARY.POSTNAME";
                    SMT.Saas.Tools.OrganizationWS.T_HR_POST entPost = lkAssignObject.DataContext as SMT.Saas.Tools.OrganizationWS.T_HR_POST;
                    BalanceObjectValue = entPost.POSTID;
                }
            };

            lookup.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { });


            InitForm();
        }
Пример #5
0
        void LoadData()
        {
            loadbar.Start();
            int    pageCount = 0;
            string filter    = "";

            System.Collections.ObjectModel.ObservableCollection <string> paras = new System.Collections.ObjectModel.ObservableCollection <string>();

            TextBox txtEmpName = Utility.FindChildControl <TextBox>(expander, "txtEmpName");
            TextBox txtEmpCode = Utility.FindChildControl <TextBox>(expander, "txtEmpCode");

            if (!string.IsNullOrEmpty(txtEmpCode.Text.Trim()))
            {
                //filter += "EMPLOYEECODE==@" + paras.Count().ToString();
                filter += " @" + paras.Count().ToString() + ".Contains(EMPLOYEECODE)";
                paras.Add(txtEmpCode.Text.Trim());
            }
            if (!string.IsNullOrEmpty(txtEmpName.Text.Trim()))
            {
                if (!string.IsNullOrEmpty(filter))
                {
                    filter += " and ";
                }
                filter += " @" + paras.Count().ToString() + ".Contains(EMPLOYEECNAME)";
                paras.Add(txtEmpName.Text.Trim());
            }

            string       sType = "", sValue = "";
            TreeViewItem selectedItem = treeOrganization.SelectedItem as TreeViewItem;

            if (selectedItem != null)
            {
                string IsTag = selectedItem.Tag.ToString();
                switch (IsTag)
                {
                case "Company":
                    OrganizationWS.T_HR_COMPANY company = selectedItem.DataContext as OrganizationWS.T_HR_COMPANY;
                    sType  = "Company";
                    sValue = company.COMPANYID;
                    break;

                case "Department":
                    OrganizationWS.T_HR_DEPARTMENT department = selectedItem.DataContext as OrganizationWS.T_HR_DEPARTMENT;
                    sType  = "Department";
                    sValue = department.DEPARTMENTID;
                    break;

                case "Post":
                    OrganizationWS.T_HR_POST post = selectedItem.DataContext as OrganizationWS.T_HR_POST;
                    sType  = "Post";
                    sValue = post.POSTID;
                    break;
                }
            }
            // client.GetEmployeeViewsActivedPagingAsync(dataPager.PageIndex, dataPager.PageSize,"EMPLOYEECNAME", filter, paras, pageCount, sType, sValue,SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID);
            client.GetEmployeeViewsPagingAsync(dataPager.PageIndex, dataPager.PageSize, "EMPLOYEECNAME", filter, paras, pageCount, sType, sValue, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID);
        }
Пример #6
0
        private string GetXmlString(string StrSource, T_HR_POSTDICTIONARY Info)
        {
            decimal?stateValue = Convert.ToDecimal("1");
            string  checkState = string.Empty;

            SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY checkStateDict = (Application.Current.Resources["SYS_DICTIONARY"] as List <SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY>).Where(s => s.DICTIONCATEGORY == "CHECKSTATE" && s.DICTIONARYVALUE == stateValue).FirstOrDefault();
            checkState = checkStateDict == null ? "" : checkStateDict.DICTIONARYNAME;

            SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY    ownerCompany    = (Application.Current.Resources["SYS_CompanyInfo"] as List <SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY>).Where(s => s.COMPANYID == Info.OWNERCOMPANYID).FirstOrDefault();
            SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT ownerDepartment = (Application.Current.Resources["SYS_DepartmentInfo"] as List <SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT>).Where(s => s.DEPARTMENTID == Info.OWNERDEPARTMENTID).FirstOrDefault();
            SMT.Saas.Tools.OrganizationWS.T_HR_POST       ownerPost       = (Application.Current.Resources["SYS_PostInfo"] as List <SMT.Saas.Tools.OrganizationWS.T_HR_POST>).Where(s => s.POSTID == Info.OWNERPOSTID).FirstOrDefault();
            string ownerCompanyName    = string.Empty;
            string ownerDepartmentName = string.Empty;
            string ownerPostName       = string.Empty;

            if (ownerCompany != null)
            {
                ownerCompanyName = ownerCompany.CNAME;
            }
            if (ownerDepartment != null)
            {
                ownerDepartmentName = ownerDepartment.T_HR_DEPARTMENTDICTIONARY == null ? "" : ownerDepartment.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME;
            }
            if (ownerPost != null)
            {
                ownerPostName = ownerPost.T_HR_POSTDICTIONARY == null ? "" : ownerPost.T_HR_POSTDICTIONARY.POSTNAME;
            }

            //T_HR_POST fatherPost = lkPost.DataContext as T_HR_POST;
            SMT.SaaS.MobileXml.MobileXml             mx       = new SMT.SaaS.MobileXml.MobileXml();
            List <SMT.SaaS.MobileXml.AutoDictionary> AutoList = new List <SMT.SaaS.MobileXml.AutoDictionary>();

            AutoList.Add(basedata("T_HR_POSTDICTIONARY", "CHECKSTATE", "1", checkState));
            //AutoList.Add(basedata("T_HR_POST", "FATHERPOSTID", Info.FATHERPOSTID, fatherPost == null ? "" : fatherPost.T_HR_POSTDICTIONARY.POSTNAME));
            //AutoList.Add(basedata("T_HR_POST", "POSTNAME", Info.T_HR_POSTDICTIONARY.POSTNAME, Info.T_HR_POSTDICTIONARY.POSTNAME));
            //AutoList.Add(basedata("T_HR_POST", "POSTDICTIONARYID", Info.T_HR_POSTDICTIONARY.POSTDICTIONARYID, Info.T_HR_POSTDICTIONARY.POSTNAME));
            //AutoList.Add(basedata("T_HR_POST", "DEPARTMENTID", Info.T_HR_DEPARTMENT.DEPARTMENTID, lkDepart.TxtLookUp.Text));
            //AutoList.Add(basedata("T_HR_POST", "POSTCODE", txtPosCode.Text, txtPosCode.Text));
            //AutoList.Add(basedata("T_HR_POST", "UNDERNUMBER", txtManageNmber.Value.ToString(), ""));
            //AutoList.Add(basedata("T_HR_POST", "POSTNUMBER", nuPostNumber.Value.ToString(), ""));
            ////AutoList.Add(basedata("T_OA_APPROVALINFO", "OWNERDEPARTMENTID", approvalInfo.OWNERDEPARTMENTID, StrDepartmentName));
            ////AutoList.Add(basedata("T_OA_APPROVALINFO", "OWNERPOSTID", approvalInfo.OWNERPOSTID, StrPostName));
            ////AutoList.Add(basedata("T_OA_APPROVALINFO", "TYPEAPPROVAL", approvalInfo.TYPEAPPROVAL, StrApprovalTypeName));
            ////AutoList.Add(basedata("T_OA_APPROVALINFO", "CONTENT", approvalInfo.APPROVALID, approvalInfo.APPROVALID));
            ////AutoList.Add(basedata("T_OA_APPROVALINFO", "AttachMent", approvalInfo.APPROVALID, approvalInfo.APPROVALID));
            //AutoList.Add(basedata("T_HR_POST", "OWNERCOMPANYID", Info.OWNERCOMPANYID, ownerCompanyName));
            //AutoList.Add(basedata("T_HR_POST", "OWNERDEPARTMENTID", Info.OWNERDEPARTMENTID, ownerDepartmentName));
            //AutoList.Add(basedata("T_HR_POST", "OWNERPOSTID", Info.OWNERPOSTID, ownerPostName));
            string a = mx.TableToXml(Info, null, StrSource, AutoList);

            return(a);
        }
Пример #7
0
 /// <summary>
 /// 根据应用对象类型,对应用对象赋值(当前类型为公司)
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void clientOrg_GetCompanyByIdCompleted(object sender, SMT.Saas.Tools.OrganizationWS.GetCompanyByIdCompletedEventArgs e)
 {
     if (e.Error == null)
     {
         SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY entCompany = e.Result as SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY;
         lkAssignObject.DataContext       = entCompany;
         lkAssignObject.DisplayMemberPath = "CNAME";
     }
     else
     {
         Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(e.Error.Message));
     }
 }
Пример #8
0
 void Organ_GetCompanyByIdCompleted(object sender, GetCompanyByIdCompletedEventArgs e)
 {
     if (!e.Cancelled)
     {
         if (e.Result != null)
         {
             SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY company = new SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY();
             company         = e.Result;
             StrCompanyID    = company.COMPANYID;
             txtCompany.Text = company.CNAME;
         }
     }
 }
Пример #9
0
 void orgClient_GetCompanyByIdCompleted(object sender, GetCompanyByIdCompletedEventArgs e)
 {
     if (e.Error == null)
     {
         OrganizationWS.T_HR_COMPANY company = e.Result as OrganizationWS.T_HR_COMPANY;
         lkAssignObject.DisplayMemberPath = "CNAME";
         lkAssignObject.DataContext       = company;
     }
     else
     {
         ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
         //Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(e.Error.Message));
     }
 }
Пример #10
0
        private string GetXmlString(string StrSource, T_HR_ATTENDMONTHLYBATCHBALANCE Info)
        {
            string ownerCompanyName    = string.Empty;
            string ownerDepartmentName = string.Empty;
            string ownerPostName       = string.Empty;

            if (Application.Current.Resources["SYS_CompanyInfo"] != null)
            {
                SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY    ownerCompany    = (Application.Current.Resources["SYS_CompanyInfo"] as List <SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY>).Where(s => s.COMPANYID == Info.OWNERCOMPANYID).FirstOrDefault();
                SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT ownerDepartment = (Application.Current.Resources["SYS_DepartmentInfo"] as List <SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT>).Where(s => s.DEPARTMENTID == Info.OWNERDEPARTMENTID).FirstOrDefault();
                SMT.Saas.Tools.OrganizationWS.T_HR_POST       ownerPost       = (Application.Current.Resources["SYS_PostInfo"] as List <SMT.Saas.Tools.OrganizationWS.T_HR_POST>).Where(s => s.POSTID == Info.OWNERPOSTID).FirstOrDefault();
                if (ownerCompany != null)
                {
                    ownerCompanyName = ownerCompany.CNAME;
                }
                if (ownerDepartment != null)
                {
                    ownerDepartmentName = ownerDepartment.T_HR_DEPARTMENTDICTIONARY == null ? "" : ownerDepartment.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME;
                }
                if (ownerPost != null)
                {
                    ownerPostName = ownerPost.T_HR_POSTDICTIONARY == null ? "" : ownerPost.T_HR_POSTDICTIONARY.POSTNAME;
                }
            }
            decimal?stateValue = Convert.ToDecimal("1");
            string  checkState = string.Empty;

            SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY checkStateDict = (Application.Current.Resources["SYS_DICTIONARY"] as List <SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY>).Where(s => s.DICTIONCATEGORY == "CHECKSTATE" && s.DICTIONARYVALUE == stateValue).FirstOrDefault();
            checkState = checkStateDict == null ? "" : checkStateDict.DICTIONARYNAME;

            T_SYS_DICTIONARY objecttype = cbxkAssignedObjectType.SelectedItem as T_SYS_DICTIONARY;

            SMT.SaaS.MobileXml.MobileXml             mx       = new SMT.SaaS.MobileXml.MobileXml();
            List <SMT.SaaS.MobileXml.AutoDictionary> AutoList = new List <SMT.SaaS.MobileXml.AutoDictionary>();

            AutoList.Add(basedata("T_HR_ATTENDMONTHLYBATCHBALANCE", "CHECKSTATE", "1", checkState));

            AutoList.Add(basedata("T_HR_ATTENDMONTHLYBATCHBALANCE", "BALANCEOBJECTTYPE", Info.BALANCEOBJECTTYPE, objecttype == null ? "" : objecttype.DICTIONARYNAME.ToString()));
            AutoList.Add(basedata("T_HR_ATTENDMONTHLYBATCHBALANCE", "BALANCEOBJECTID", Info.BALANCEOBJECTID, lkAssignObject.TxtLookUp.Text));
            AutoList.Add(basedata("T_HR_ATTENDMONTHLYBATCHBALANCE", "BALANCEUNIT", Info.BALANCEOBJECTID, lkAssignObject.TxtLookUp.Text));

            AutoList.Add(basedata("T_HR_ATTENDMONTHLYBATCHBALANCE", "OWNERCOMPANYID", Info.OWNERCOMPANYID, ownerCompanyName));
            AutoList.Add(basedata("T_HR_ATTENDMONTHLYBATCHBALANCE", "OWNERDEPARTMENTID", Info.OWNERDEPARTMENTID, ownerDepartmentName));
            AutoList.Add(basedata("T_HR_ATTENDMONTHLYBATCHBALANCE", "OWNERPOSTID", Info.OWNERPOSTID, ownerPostName));
            AutoList.Add(basedata("T_HR_ATTENDMONTHLYBATCHBALANCE", "CURRENTEMPLOYEENAME", Common.CurrentLoginUserInfo.EmployeeName, Common.CurrentLoginUserInfo.EmployeeName));

            string a = mx.TableToXml(Info, entAMBList, StrSource, AutoList);

            return(a);
        }
Пример #11
0
        private void BindAssignObjectLookup()
        {
            if (SalarySolutionAssignView == null || SalarySolutionAssignView.SalarySolutionAssign == null)
            {
                lkAssignObject.DataContext = null;
                return;
            }
            switch (SalarySolutionAssignView.SalarySolutionAssign.ASSIGNEDOBJECTTYPE)
            {
            case "1":
                OrganizationWS.T_HR_COMPANY company = new OrganizationWS.T_HR_COMPANY();
                company.CNAME     = SalarySolutionAssignView.AssignObjectName;
                company.COMPANYID = SalarySolutionAssignView.SalarySolutionAssign.ASSIGNEDOBJECTID;
                lkAssignObject.DisplayMemberPath = "CNAME";
                lkAssignObject.DataContext       = company;
                break;

            case "2":
                OrganizationWS.T_HR_DEPARTMENT depart = new OrganizationWS.T_HR_DEPARTMENT();
                depart.DEPARTMENTID = SalarySolutionAssignView.SalarySolutionAssign.ASSIGNEDOBJECTID;
                depart.T_HR_DEPARTMENTDICTIONARY = new OrganizationWS.T_HR_DEPARTMENTDICTIONARY();
                depart.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME = SalarySolutionAssignView.AssignObjectName;
                lkAssignObject.DisplayMemberPath = "T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME";
                lkAssignObject.DataContext       = depart;
                break;

            case "3":
                OrganizationWS.T_HR_POST post = new OrganizationWS.T_HR_POST();
                post.POSTID = SalarySolutionAssignView.SalarySolutionAssign.ASSIGNEDOBJECTID;
                post.T_HR_POSTDICTIONARY          = new OrganizationWS.T_HR_POSTDICTIONARY();
                post.T_HR_POSTDICTIONARY.POSTNAME = SalarySolutionAssignView.AssignObjectName;
                lkAssignObject.DisplayMemberPath  = "T_HR_POSTDICTIONARY.POSTNAME";
                lkAssignObject.DataContext        = post;
                break;

            case "4":
                OrganizationWS.T_HR_EMPLOYEE employee = new OrganizationWS.T_HR_EMPLOYEE();
                employee.EMPLOYEEID              = SalarySolutionAssignView.SalarySolutionAssign.ASSIGNEDOBJECTID;
                employee.EMPLOYEECNAME           = SalarySolutionAssignView.AssignObjectName;
                lkAssignObject.DisplayMemberPath = "EMPLOYEECNAME";
                lkAssignObject.DataContext       = employee;
                break;

            default:
                lkAssignObject.DataContext = null;
                break;
            }
        }
Пример #12
0
        /// <summary>
        /// 将公司信息集合转换成标准结构的公司数据集合(V_COMPANY => T_HR_COMPANY),
        /// 并将转换后的数据集合存到内存中,然后再加载部门数据
        /// </summary>
        private void ReFillDataToCompany()
        {
            allCompanys = new List <SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY>();
            var ents = allCompanysView.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 = allCompanysView.Where(s => s.COMPANYID == ent.FATHERCOMPANYID).FirstOrDefault();
                    if (v_company != null)
                    {
                        company.T_HR_COMPANY2.CNAME = v_company.CNAME;
                    }
                }
                //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> >(RESCOMPANYINFOKEY, allCompanys);
            LoadDepartmentInfo();
        }
Пример #13
0
        /// <summary>
        /// 选择公司
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void lkCompanyName_FindClick(object sender, EventArgs e)
        {
            OrganizationLookup lookup = new OrganizationLookup();

            lookup.SelectedObjType = OrgTreeItemTypes.Company;
            lookup.MultiSelected   = false;

            lookup.SelectedClick += (obj, ev) =>
            {
                SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY ent = lookup.SelectedObj[0].ObjectInstance as SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY;
                if (ent != null)
                {
                    lkCompanyName.DataContext = ent;
                }
            };

            lookup.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { });
        }
Пример #14
0
        private TreeViewItem GetParentItemFromChild(TreeViewItem item, OrgTreeItemTypes parentType, string parentID)
        {
            TreeViewItem tmpItem = null;

            if (item.Tag != null && item.Tag.ToString() == parentType.ToString())
            {
                switch (parentType)
                {
                case OrgTreeItemTypes.Company:
                    SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY tmpOrg = item.DataContext as SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY;
                    if (tmpOrg != null)
                    {
                        if (tmpOrg.COMPANYID == parentID)
                        {
                            return(item);
                        }
                    }
                    break;

                case OrgTreeItemTypes.Department:
                    SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT tmpDep = item.DataContext as SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT;
                    if (tmpDep != null)
                    {
                        if (tmpDep.DEPARTMENTID == parentID)
                        {
                            return(item);
                        }
                    }
                    break;
                }
            }
            if (item.Items != null && item.Items.Count > 0)
            {
                foreach (TreeViewItem childitem in item.Items)
                {
                    tmpItem = GetParentItemFromChild(childitem, parentType, parentID);
                    if (tmpItem != null)
                    {
                        break;
                    }
                }
            }
            return(tmpItem);
        }
Пример #15
0
        private string GetXmlString(string StrSource, T_HR_EMPLOYEEADDSUM Info)
        {
            SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY    ownerCompany    = (Application.Current.Resources["SYS_CompanyInfo"] as List <SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY>).Where(s => s.COMPANYID == Info.OWNERCOMPANYID).FirstOrDefault();
            SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT ownerDepartment = (Application.Current.Resources["SYS_DepartmentInfo"] as List <SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT>).Where(s => s.DEPARTMENTID == Info.OWNERDEPARTMENTID).FirstOrDefault();
            SMT.Saas.Tools.OrganizationWS.T_HR_POST       ownerPost       = (Application.Current.Resources["SYS_PostInfo"] as List <SMT.Saas.Tools.OrganizationWS.T_HR_POST>).Where(s => s.POSTID == Info.OWNERPOSTID).FirstOrDefault();
            string ownerCompanyName    = string.Empty;
            string ownerDepartmentName = string.Empty;
            string ownerPostName       = string.Empty;

            if (ownerCompany != null)
            {
                ownerCompanyName = ownerCompany.CNAME;
            }
            if (ownerDepartment != null)
            {
                ownerDepartmentName = ownerDepartment.T_HR_DEPARTMENTDICTIONARY == null ? "" : ownerDepartment.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME;
            }
            if (ownerPost != null)
            {
                ownerPostName = ownerPost.T_HR_POSTDICTIONARY == null ? "" : ownerPost.T_HR_POSTDICTIONARY.POSTNAME;
            }

            decimal?stateValue = Convert.ToDecimal("1");
            string  checkState = string.Empty;

            SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY checkStateDict = (Application.Current.Resources["SYS_DICTIONARY"] as List <SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY>).Where(s => s.DICTIONCATEGORY == "CHECKSTATE" && s.DICTIONARYVALUE == stateValue).FirstOrDefault();
            checkState = checkStateDict == null ? "" : checkStateDict.DICTIONARYNAME;

            SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY SYSTEMTYPE = combProtectType.SelectedItem as SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY;
            SMT.SaaS.MobileXml.MobileXml             mx             = new SMT.SaaS.MobileXml.MobileXml();
            List <SMT.SaaS.MobileXml.AutoDictionary> AutoList       = new List <SMT.SaaS.MobileXml.AutoDictionary>();

            AutoList.Add(basedata("T_HR_EMPLOYEEADDSUM", "CHECKSTATE", "1", checkState));
            AutoList.Add(basedata("T_HR_EMPLOYEEADDSUM", "SYSTEMTYPE", SYSTEMTYPE != null ? SYSTEMTYPE.DICTIONARYVALUE.ToString() : "0", SYSTEMTYPE != null ? SYSTEMTYPE.DICTIONARYNAME : ""));
            AutoList.Add(basedata("T_HR_EMPLOYEEADDSUM", "EMPLOYEEID", Info.EMPLOYEEID, Info.EMPLOYEEID));
            AutoList.Add(basedata("T_HR_EMPLOYEEADDSUM", "EMPLOYEENAME", Info.EMPLOYEENAME, Info.EMPLOYEENAME));

            AutoList.Add(basedata("T_HR_EMPLOYEEADDSUM", "OWNERCOMPANYID", Info.OWNERCOMPANYID, ownerCompanyName));
            AutoList.Add(basedata("T_HR_EMPLOYEEADDSUM", "OWNERDEPARTMENTID", Info.OWNERDEPARTMENTID, ownerDepartmentName));
            AutoList.Add(basedata("T_HR_EMPLOYEEADDSUM", "OWNERPOSTID", Info.OWNERPOSTID, ownerPostName));
            string a = mx.TableToXml(Info, null, StrSource, AutoList);

            return(a);
        }
Пример #16
0
        private string GetXmlString(string StrSource, T_HR_DEPARTMENTDICTIONARY Info)
        {
            decimal?stateValue = Convert.ToDecimal("1");
            string  checkState = string.Empty;

            SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY checkStateDict = (Application.Current.Resources["SYS_DICTIONARY"] as List <SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY>).Where(s => s.DICTIONCATEGORY == "CHECKSTATE" && s.DICTIONARYVALUE == stateValue).FirstOrDefault();
            checkState = checkStateDict == null ? "" : checkStateDict.DICTIONARYNAME;

            SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY    ownerCompany    = (Application.Current.Resources["SYS_CompanyInfo"] as List <SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY>).Where(s => s.COMPANYID == Info.OWNERCOMPANYID).FirstOrDefault();
            SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT ownerDepartment = (Application.Current.Resources["SYS_DepartmentInfo"] as List <SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT>).Where(s => s.DEPARTMENTID == Info.OWNERDEPARTMENTID).FirstOrDefault();
            SMT.Saas.Tools.OrganizationWS.T_HR_POST       ownerPost       = (Application.Current.Resources["SYS_PostInfo"] as List <SMT.Saas.Tools.OrganizationWS.T_HR_POST>).Where(s => s.POSTID == Info.OWNERPOSTID).FirstOrDefault();
            string ownerCompanyName    = string.Empty;
            string ownerDepartmentName = string.Empty;
            string ownerPostName       = string.Empty;

            if (ownerCompany != null)
            {
                ownerCompanyName = ownerCompany.CNAME;
            }
            if (ownerDepartment != null)
            {
                ownerDepartmentName = ownerDepartment.T_HR_DEPARTMENTDICTIONARY == null ? "" : ownerDepartment.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME;
            }
            if (ownerPost != null)
            {
                ownerPostName = ownerPost.T_HR_POSTDICTIONARY == null ? "" : ownerPost.T_HR_POSTDICTIONARY.POSTNAME;
            }

            //T_HR_POST fatherPost = lkPost.DataContext as T_HR_POST;
            SMT.SaaS.MobileXml.MobileXml             mx       = new SMT.SaaS.MobileXml.MobileXml();
            List <SMT.SaaS.MobileXml.AutoDictionary> AutoList = new List <SMT.SaaS.MobileXml.AutoDictionary>();

            AutoList.Add(basedata("T_HR_DEPARTMENTDICTIONARY", "CHECKSTATE", "1", checkState));
            AutoList.Add(basedata("T_HR_DEPARTMENTDICTIONARY", "CREATEUSERNAME", createUserName, createUserName));
            string a = mx.TableToXml(Info, null, StrSource, AutoList);

            return(a);
        }
        public string GetFullOrgName(string depID)
        {
            List <SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY>    allCompanys    = Application.Current.Resources["SYS_CompanyInfo"] as List <SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY>;
            List <SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT> allDepartments = Application.Current.Resources["SYS_DepartmentInfo"] as List <SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT>;

            SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT department = new Saas.Tools.OrganizationWS.T_HR_DEPARTMENT();
            SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY    company    = new SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY();
            string orgName    = string.Empty;
            string fatherType = "0";
            string fatherID   = "";
            bool   hasFather  = false;

            department = (from c in allDepartments
                          where c.DEPARTMENTID == depID
                          select c).FirstOrDefault();
            if (department != null)
            {
                orgName += " - " + department.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME;
                if (!string.IsNullOrEmpty(department.FATHERTYPE) && !string.IsNullOrEmpty(department.FATHERID))
                {
                    fatherType = department.FATHERTYPE;
                    fatherID   = department.FATHERID;
                    hasFather  = true;
                }
                else
                {
                    hasFather = false;
                }
            }

            while (hasFather)
            {
                if (fatherType == "1" && !string.IsNullOrEmpty(fatherID))
                {
                    department = (from de in allDepartments
                                  where de.DEPARTMENTID == fatherID
                                  select de).FirstOrDefault();
                    if (department != null)
                    {
                        orgName += " - " + department.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME;
                        if (!string.IsNullOrEmpty(department.FATHERTYPE) && !string.IsNullOrEmpty(department.FATHERID))
                        {
                            fatherID   = department.FATHERID;
                            fatherType = department.FATHERTYPE;
                        }
                        else
                        {
                            hasFather = false;
                        }
                    }
                    else
                    {
                        hasFather = false;
                    }
                }
                else if (fatherType == "0" && !string.IsNullOrEmpty(fatherID))
                {
                    company = (from com in allCompanys
                               where com.COMPANYID == fatherID
                               select com).FirstOrDefault();

                    if (company != null)
                    {
                        orgName += " - " + company.CNAME;
                        if (!string.IsNullOrEmpty(company.FATHERTYPE) && !string.IsNullOrEmpty(company.FATHERID))
                        {
                            fatherID   = company.FATHERID;
                            fatherType = company.FATHERTYPE;
                        }
                        else
                        {
                            hasFather = false;
                        }
                    }
                    else
                    {
                        hasFather = false;
                    }
                }
                else
                {
                    hasFather = false;
                }
            }
            return(orgName);
        }
Пример #18
0
        /// <summary>
        /// 加载菜单数据
        /// </summary>
        private void LoadData()
        {
            //ServiceClient.GetSysRoleByTypeAsync(this.txtSearchSystemType.Text.Trim());
            string filter    = "";                                                                                    //查询过滤条件
            int    pageCount = 0;
            ObservableCollection <object> paras = new System.Collections.ObjectModel.ObservableCollection <object>(); //参数值
            ComboBox         cbxSystemType      = Utility.FindChildControl <ComboBox>(expander, "cbxSystemType");
            TextBox          RoleName           = Utility.FindChildControl <TextBox>(expander, "TxtRoleName");
            T_SYS_DICTIONARY dict        = cbxSystemType.SelectedItem as T_SYS_DICTIONARY;
            string           StrRoleName = "";

            StrRoleName = RoleName.Text;



            //if (!string.IsNullOrEmpty(txtEmpCode.Text.Trim()))
            //{
            //    //filter += "EMPLOYEECODE==@" + paras.Count().ToString();
            //    filter += " @" + paras.Count().ToString() + ".Contains(EMPLOYEECODE)";
            //    paras.Add(txtEmpCode.Text.Trim());
            //}


            string systype = "";

            if (dict != null)
            {
                systype = dict.DICTIONARYVALUE == null ? "" : dict.DICTIONARYVALUE.GetValueOrDefault().ToString();
            }
            if (!string.IsNullOrEmpty(systype))
            {
                if (!string.IsNullOrEmpty(filter))
                {
                    filter += " and ";
                }
                filter += "SYSTEMTYPE ==@" + paras.Count().ToString();//类型名称
                paras.Add(systype);
            }
            string       sValue       = "";
            TreeViewItem selectedItem = treeOrganization.SelectedItem as TreeViewItem;

            if (selectedItem != null)
            {
                string IsTag = selectedItem.Tag.ToString();
                switch (IsTag)
                {
                case "Company":
                    SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY company = selectedItem.DataContext as SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY;
                    //sType = "Company";
                    sValue = company.COMPANYID;
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    filter += "OWNERCOMPANYID ==@" + paras.Count().ToString();    //类型名称
                    paras.Add(sValue);
                    break;

                case "Department":
                    SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT department = selectedItem.DataContext as SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT;
                    //sType = "Department";
                    sValue = department.DEPARTMENTID;
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    filter += "OWNERDEPARTMENTID ==@" + paras.Count().ToString();    //类型名称
                    paras.Add(sValue);
                    break;
                }
            }
            if (string.IsNullOrEmpty(filter))
            {
                //默认为自己公司的角色
                filter += "OWNERCOMPANYID ==@" + paras.Count().ToString();//类型名称
                paras.Add(Common.CurrentLoginUserInfo.UserPosts[0].CompanyID);
            }

            if (!string.IsNullOrEmpty(StrRoleName))
            {
                if (!string.IsNullOrEmpty(filter))
                {
                    filter += " and ";
                }

                //filter += " @" + paras.Count().ToString() + ".Contains(ROLENAME)";//类型名称
                //filter += "ROLENAME  ^@" + paras.Count().ToString();//类型名称
                filter += " @" + paras.Count().ToString() + ".Contains(ROLENAME)";
                paras.Add(StrRoleName);
            }
            loadbar.Start();
            SMT.Saas.Tools.PermissionWS.LoginUserInfo loginUserInfo = new SMT.Saas.Tools.PermissionWS.LoginUserInfo();
            loginUserInfo.companyID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
            loginUserInfo.userID    = Common.CurrentLoginUserInfo.EmployeeID;
            //只能查看自己所在公司的角色
            //CompanyIDList.Clear();
            //CompanyIDList.Add(Common.CurrentLoginUserInfo.UserPosts);
            //if (Common.CurrentLoginUserInfo.UserPosts.Count() > 0)
            //{
            //    foreach (var str in Common.CurrentLoginUserInfo.UserPosts)
            //    {
            //        CompanyIDList.Add(str.CompanyID);
            //    }
            //}
            ServiceClient.GetSysRoleInfosPagingByCompanyIDsAsync(dataPager.PageIndex, dataPager.PageSize, "CREATEDATE",
                                                                 filter, paras, pageCount, loginUserInfo, CompanyIDList);
        }
Пример #19
0
        void DocDistrbuteClient_GetDocDistrbuteInfosCompleted(object sender, GetDocDistrbuteInfosCompletedEventArgs e)
        {
            try
            {
                if (e.Error == null)
                {
                    if (e.Result != null)
                    {
                        List <SMT.SaaS.OA.UI.SmtOACommonOfficeService.T_OA_DISTRIBUTEUSER> distributeList = e.Result.ToList();

                        foreach (var h in distributeList)
                        {
                            object obj = new object();
                            SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj extOrgObj = new SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj();
                            if (h.VIEWTYPE == ((int)SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Company).ToString())
                            {
                                SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY tmp = new SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY();
                                tmp.COMPANYID = h.VIEWER;
                                //tmp.CNAME = "";
                                tmp.CNAME = Utility.GetCompanyName(tmp.COMPANYID);
                                obj       = tmp;
                            }
                            else if (h.VIEWTYPE == ((int)SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Department).ToString())
                            {
                                SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT tmp = new SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT();
                                tmp.DEPARTMENTID = h.VIEWER;
                                SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENTDICTIONARY tmpdict = new SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENTDICTIONARY();
                                //tmpdict.DEPARTMENTNAME = "";
                                tmpdict.DEPARTMENTNAME        = Utility.GetDepartmentName(h.VIEWER);
                                tmp.T_HR_DEPARTMENTDICTIONARY = tmpdict;
                                obj = tmp;
                            }
                            else if (h.VIEWTYPE == ((int)SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Post).ToString())
                            {
                                SMT.Saas.Tools.OrganizationWS.T_HR_POST tmp = new SMT.Saas.Tools.OrganizationWS.T_HR_POST();
                                tmp.POSTLEVEL = System.Convert.ToDecimal(h.VIEWER);
                                SMT.Saas.Tools.OrganizationWS.T_HR_POSTDICTIONARY tmpdict = new SMT.Saas.Tools.OrganizationWS.T_HR_POSTDICTIONARY();
                                //tmpdict.POSTNAME = "";
                                tmpdict.POSTNAME        = Utility.GetPostName(h.VIEWER);
                                tmp.T_HR_POSTDICTIONARY = tmpdict;

                                obj = tmp;
                            }
                            else if (h.VIEWTYPE == ((int)SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Personnel).ToString())
                            {
                                SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE tmp = new SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE();
                                tmp.EMPLOYEEID    = h.VIEWER;
                                tmp.EMPLOYEECNAME = Utility.GetDistrbuteUserName(tmp.EMPLOYEEID, vemployeeObj);
                                obj = tmp;
                                //T_HR_EMPLOYEE tmp = new T_HR_EMPLOYEE();
                                //tmp.EMPLOYEEID = h.VIEWER;
                                //tmp.EMPLOYEECNAME = "";
                                //obj = tmp;
                            }
                            extOrgObj.ObjectInstance = obj;

                            issuanceExtOrgObj.Add(extOrgObj);
                        }
                        BindData();
                    }
                }
                else
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), e.Error.Message);
                }
            }
            catch (Exception ex)
            {
                //HtmlPage.Window.Alert(ex.ToString());
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(ex.Message.ToString()));
            }
        }
Пример #20
0
        void DocDistrbuteClient_GetDocDistrbuteInfosCompleted(object sender, GetDocDistrbuteInfosCompletedEventArgs e)
        {
            try
            {
                if (e.Error == null)
                {
                    if (e.Result != null)
                    {
                        distributeList = e.Result;

                        
                        

                        foreach (var h in distributeList)
                        {
                            object obj = new object();
                            SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj extOrgObj = new SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj();
                            if (h.VIEWTYPE == ((int)SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Company).ToString())
                            {
                                SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY tmp = new SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY();
                                tmp.COMPANYID = h.VIEWER;

                                tmp.CNAME = Utility.GetCompanyName(tmp.COMPANYID);
                                obj = tmp;
                                StrCompanyIDsList.Add(h.VIEWER);
                            }
                            else if (h.VIEWTYPE == ((int)SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Department).ToString())
                            {
                                SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT tmp = new SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT();
                                tmp.DEPARTMENTID = h.VIEWER;
                                SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENTDICTIONARY tmpdict = new SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENTDICTIONARY();
                                tmpdict.DEPARTMENTNAME = Utility.GetDepartmentName(h.VIEWER);
                                tmp.T_HR_DEPARTMENTDICTIONARY = tmpdict;
                                obj = tmp;
                                StrDepartmentIDsList.Add(h.VIEWER);
                            }
                            else if (h.VIEWTYPE == ((int)SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Post).ToString())
                            {
                                SMT.Saas.Tools.OrganizationWS.T_HR_POST tmp = new SMT.Saas.Tools.OrganizationWS.T_HR_POST();
                                tmp.POSTLEVEL = System.Convert.ToDecimal(h.VIEWER);
                                SMT.Saas.Tools.OrganizationWS.T_HR_POSTDICTIONARY tmpdict = new SMT.Saas.Tools.OrganizationWS.T_HR_POSTDICTIONARY();
                                tmpdict.POSTNAME = Utility.GetPostName(h.VIEWER);
                                tmp.T_HR_POSTDICTIONARY = tmpdict;
                                
                                obj = tmp;
                                StrPositionIDsList.Add(h.VIEWER);
                            }
                            else if (h.VIEWTYPE == ((int)SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Personnel).ToString())
                            {
                                SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE tmp = new SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE();
                                tmp.EMPLOYEEID = h.VIEWER;
                                tmp.EMPLOYEECNAME = Utility.GetDistrbuteUserName(tmp.EMPLOYEEID,vemployeeObj);
                                obj = tmp;
                                if (!(StrStaffList.IndexOf(h.VIEWER) >0))
                                {
                                    StaffList.Add(h.VIEWER);
                                }
                            }
                            extOrgObj.ObjectInstance = obj;
                            issuanceExtOrgObj.Add(extOrgObj);
                        }
                        //personclient.GetEmployeeDetailByParasAsync(StrCompanyIDsList, StrDepartmentIDsList, StrPositionIDsList, StaffList);
                        //RefreshUI(RefreshedTypes.ShowProgressBar);
                        //personclient.GetEmployeeIDsByParasAsync(StrCompanyIDsList,StrDepartmentIDsList,StrPositionIDsList);
                        //StaffList.Clear();//将对象员工清除
                        //personclient.GetEmployeeIDsWithParasAsync(StrCompanyIDsList, true, StrDepartmentIDsList, true, StrPositionIDsList);
                        BindData();
                    }
                }
                else
                {
                    //HtmlPage.Window.Alert(e.Error.ToString());

                    //Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), e.Error.Message);
                    ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
                }
            }
            catch (Exception ex)
            {
                //HtmlPage.Window.Alert(ex.ToString());
                //Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(ex.Message.ToString()));
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
            }
        }
Пример #21
0
        void organClient_GetALLCompanyViewCompleted(object sender, GetALLCompanyViewCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                if (e.Result != null)
                {
                    List<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;
                            company.T_HR_COMPANY2.CNAME = entTemps.Where(s => s.COMPANYID == ent.FATHERCOMPANYID).FirstOrDefault().CNAME;
                        }
                        company.FATHERID = ent.FATHERID;
                        company.FATHERTYPE = ent.FATHERTYPE;
                        company.CHECKSTATE = ent.CHECKSTATE;
                        company.EDITSTATE = ent.EDITSTATE;
                        allCompanys.Add(company);
                    }
                    if (App.Current.Resources["SYS_CompanyInfo"] != null)
                    {
                        App.Current.Resources.Remove("SYS_CompanyInfo");
                        App.Current.Resources.Add("SYS_CompanyInfo", allCompanys);
                    }
                    else
                    {
                        App.Current.Resources.Add("SYS_CompanyInfo", allCompanys);
                    }

                    
                }
            }
        }
Пример #22
0
        private void BindAssignObjectLookup()
        {
            if (SalarySolutionAssignView == null || SalarySolutionAssignView.SalarySolutionAssign == null)
            {
                lkAssignObject.DataContext = null;
                return;

            }
            switch (SalarySolutionAssignView.SalarySolutionAssign.ASSIGNEDOBJECTTYPE)
            {
                case "1":
                    OrganizationWS.T_HR_COMPANY company = new OrganizationWS.T_HR_COMPANY();
                    company.CNAME = SalarySolutionAssignView.AssignObjectName;
                    company.COMPANYID = SalarySolutionAssignView.SalarySolutionAssign.ASSIGNEDOBJECTID;
                    lkAssignObject.DisplayMemberPath = "CNAME";
                    lkAssignObject.DataContext = company;
                    break;

                case "2":
                    OrganizationWS.T_HR_DEPARTMENT depart = new OrganizationWS.T_HR_DEPARTMENT();
                    depart.DEPARTMENTID = SalarySolutionAssignView.SalarySolutionAssign.ASSIGNEDOBJECTID;
                    depart.T_HR_DEPARTMENTDICTIONARY = new OrganizationWS.T_HR_DEPARTMENTDICTIONARY();
                    depart.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME = SalarySolutionAssignView.AssignObjectName;
                    lkAssignObject.DisplayMemberPath = "T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME";
                    lkAssignObject.DataContext = depart;
                    break;

                case "3":
                    OrganizationWS.T_HR_POST post = new OrganizationWS.T_HR_POST();
                    post.POSTID = SalarySolutionAssignView.SalarySolutionAssign.ASSIGNEDOBJECTID;
                    post.T_HR_POSTDICTIONARY = new OrganizationWS.T_HR_POSTDICTIONARY();
                    post.T_HR_POSTDICTIONARY.POSTNAME = SalarySolutionAssignView.AssignObjectName;
                    lkAssignObject.DisplayMemberPath = "T_HR_POSTDICTIONARY.POSTNAME";
                    lkAssignObject.DataContext = post;
                    break;

                case "4":
                    OrganizationWS.T_HR_EMPLOYEE employee = new OrganizationWS.T_HR_EMPLOYEE();
                    employee.EMPLOYEEID = SalarySolutionAssignView.SalarySolutionAssign.ASSIGNEDOBJECTID;
                    employee.EMPLOYEECNAME = SalarySolutionAssignView.AssignObjectName;
                    lkAssignObject.DisplayMemberPath = "EMPLOYEECNAME";
                    lkAssignObject.DataContext = employee;
                    break;

                default:
                    lkAssignObject.DataContext = null;
                    break;
            }

        }
Пример #23
0
        void DocDistrbuteClient_GetDocDistrbuteInfosCompleted(object sender, GetDocDistrbuteInfosCompletedEventArgs e)
        {
            try
            {
                if (e.Error == null)
                {
                    if (e.Result != null)
                    {
                        List<SMT.SaaS.OA.UI.SmtOACommonOfficeService.T_OA_DISTRIBUTEUSER> distributeList = e.Result.ToList();

                        foreach (var h in distributeList)
                        {
                            object obj = new object();
                            SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj extOrgObj = new SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj();
                            if (h.VIEWTYPE == ((int)SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Company).ToString())
                            {
                                SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY tmp = new SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY();
                                tmp.COMPANYID = h.VIEWER;
                                //tmp.CNAME = "";
                                tmp.CNAME = Utility.GetCompanyName(tmp.COMPANYID);
                                obj = tmp;
                            }
                            else if (h.VIEWTYPE == ((int)SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Department).ToString())
                            {
                                SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT tmp = new SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT();
                                tmp.DEPARTMENTID = h.VIEWER;
                                SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENTDICTIONARY tmpdict = new SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENTDICTIONARY();
                                //tmpdict.DEPARTMENTNAME = "";
                                tmpdict.DEPARTMENTNAME = Utility.GetDepartmentName(h.VIEWER);
                                tmp.T_HR_DEPARTMENTDICTIONARY = tmpdict;
                                obj = tmp;
                            }
                            else if (h.VIEWTYPE == ((int)SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Post).ToString())
                            {
                                SMT.Saas.Tools.OrganizationWS.T_HR_POST tmp = new SMT.Saas.Tools.OrganizationWS.T_HR_POST();
                                tmp.POSTLEVEL = System.Convert.ToDecimal(h.VIEWER);
                                SMT.Saas.Tools.OrganizationWS.T_HR_POSTDICTIONARY tmpdict = new SMT.Saas.Tools.OrganizationWS.T_HR_POSTDICTIONARY();
                                //tmpdict.POSTNAME = "";
                                tmpdict.POSTNAME = Utility.GetPostName(h.VIEWER);
                                tmp.T_HR_POSTDICTIONARY = tmpdict;

                                obj = tmp;
                            }
                            else if (h.VIEWTYPE == ((int)SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Personnel).ToString())
                            {
                                SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE tmp = new SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE();
                                tmp.EMPLOYEEID = h.VIEWER;
                                tmp.EMPLOYEECNAME = Utility.GetDistrbuteUserName(tmp.EMPLOYEEID, vemployeeObj);
                                obj = tmp;
                                //T_HR_EMPLOYEE tmp = new T_HR_EMPLOYEE();
                                //tmp.EMPLOYEEID = h.VIEWER;
                                //tmp.EMPLOYEECNAME = "";
                                //obj = tmp;
                            }
                            extOrgObj.ObjectInstance = obj;

                            issuanceExtOrgObj.Add(extOrgObj);
                        }
                        BindData();
                    }
                }
                else
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), e.Error.Message);
            }
            catch (Exception ex)
            {
                //HtmlPage.Window.Alert(ex.ToString());
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(ex.Message.ToString()));
            }
        }
Пример #24
0
        void Organ_GetCompanyByIdCompleted(object sender, GetCompanyByIdCompletedEventArgs e)
        {
            if (!e.Cancelled)
            {
                if (e.Result != null)
                {
                    SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY company = new SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY();
                    company = e.Result;
                    StrCompanyID = company.COMPANYID;
                    txtCompany.Text = company.CNAME;

                }
            }
        } 
Пример #25
0
        void LoadData()
        {
            loadbar.Start();
            int    pageCount = 0;
            string filter    = "";

            System.Collections.ObjectModel.ObservableCollection <object> paras = new System.Collections.ObjectModel.ObservableCollection <object>();

            TextBox txtEmpName = Utility.FindChildControl <TextBox>(expander, "txtEmpName");
            TextBox txtEmpCode = Utility.FindChildControl <TextBox>(expander, "txtEmpCode");

            if (!string.IsNullOrEmpty(txtEmpCode.Text.Trim()))
            {
                //filter += "EMPLOYEECODE==@" + paras.Count().ToString();
                filter += " @" + paras.Count().ToString() + ".Contains(EMPLOYEECODE)";
                paras.Add(txtEmpCode.Text.Trim());
            }
            if (!string.IsNullOrEmpty(ListEmployeeids))
            {
                //if (!string.IsNullOrEmpty(filter))
                //{
                //    filter += " and ";
                //}
                //filter += " @" + paras.Count().ToString() + ".Contains(EMPLOYEEID)";
                if (ListEmployeeids.IndexOf(',') > 0)
                {
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    string[] ArrEmployeeids = ListEmployeeids.Split(',');
                    if (ArrEmployeeids.Count() > 1)
                    {
                        filter += "( ";
                        for (int i = 0; i < ArrEmployeeids.Count(); i++)
                        {
                            if (i > 0)
                            {
                                filter += " or ";
                            }
                            filter += " @" + paras.Count().ToString() + ".Contains(EMPLOYEEID)";
                            paras.Add(ArrEmployeeids[i].ToString());
                        }
                        filter += " ) ";
                    }
                }
                else
                {
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    filter += " @" + paras.Count().ToString() + ".Contains(EMPLOYEEID)";
                    paras.Add(ListEmployeeids);
                }
                //filter += " EMPLOYEEID.Contains(@" + paras.Count().ToString() + ")";
                //paras.Add(ListEmployeeids);
            }
            if (!string.IsNullOrEmpty(txtEmpName.Text.Trim()))
            {
                if (!string.IsNullOrEmpty(filter))
                {
                    filter += " and ";
                }
                filter += " @" + paras.Count().ToString() + ".Contains(EMPLOYEECNAME)";
                paras.Add(txtEmpName.Text.Trim());
            }

            string       sType = "", sValue = "";
            TreeViewItem selectedItem = treeOrganization.SelectedItem as TreeViewItem;

            if (selectedItem != null)
            {
                string IsTag = selectedItem.Tag.ToString();
                OrganizationWS.T_HR_COMPANY company = selectedItem.DataContext as OrganizationWS.T_HR_COMPANY;
                sType  = "Company";
                sValue = company.COMPANYID;
            }
            client.GetEmployeeViewsWithOutPermissionsAsync(dataPager.PageIndex, dataPager.PageSize, "EMPLOYEECNAME", filter, paras, pageCount, sType, sValue);
        }
        public string GetFullOrgName(string depID)
        {
            List<SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY> allCompanys = Application.Current.Resources["SYS_CompanyInfo"] as List<SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY>;
            List<SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT> allDepartments = Application.Current.Resources["SYS_DepartmentInfo"] as List<SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT>;
            SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT department = new Saas.Tools.OrganizationWS.T_HR_DEPARTMENT();
            SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY company = new SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY();
            string orgName = string.Empty;
            string fatherType = "0";
            string fatherID = "";
            bool hasFather = false;

            department = (from c in allDepartments
                          where c.DEPARTMENTID == depID
                          select c).FirstOrDefault();
            if (department != null)
            {
                orgName += " - " + department.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME;
                if (!string.IsNullOrEmpty(department.FATHERTYPE) && !string.IsNullOrEmpty(department.FATHERID))
                {
                    fatherType = department.FATHERTYPE;
                    fatherID = department.FATHERID;
                    hasFather = true;
                }
                else
                {
                    hasFather = false;
                }
            }

            while (hasFather)
            {
                if (fatherType == "1" && !string.IsNullOrEmpty(fatherID))
                {
                    department = (from de in allDepartments
                                  where de.DEPARTMENTID == fatherID
                                  select de).FirstOrDefault();
                    if (department != null)
                    {
                        orgName += " - " + department.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME;
                        if (!string.IsNullOrEmpty(department.FATHERTYPE) && !string.IsNullOrEmpty(department.FATHERID))
                        {
                            fatherID = department.FATHERID;
                            fatherType = department.FATHERTYPE;
                        }
                        else
                        {
                            hasFather = false;
                        }
                    }
                    else
                    {
                        hasFather = false;
                    }
                }
                else if (fatherType == "0" && !string.IsNullOrEmpty(fatherID))
                {
                    company = (from com in allCompanys
                               where com.COMPANYID == fatherID
                               select com).FirstOrDefault();

                    if (company != null)
                    {
                        orgName += " - " + company.CNAME;
                        if (!string.IsNullOrEmpty(company.FATHERTYPE) && !string.IsNullOrEmpty(company.FATHERID))
                        {
                            fatherID = company.FATHERID;
                            fatherType = company.FATHERTYPE;
                        }
                        else
                        {
                            hasFather = false;
                        }
                    }
                    else
                    {
                        hasFather = false;
                    }

                }
                else
                {
                    hasFather = false;
                }

            }
            return orgName;
        }