示例#1
0
        private string GetXmlString(string StrSource, T_HR_EMPLOYEECONTRACT 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;


            //string postLevelName = string.Empty;
            //SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY postLevelDict = (Application.Current.Resources["SYS_DICTIONARY"] as List<SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY>).Where(s => s.DICTIONCATEGORY == "POSTLEVLE" && s.DICTIONARYVALUE == employeepost.POSTLEVEL).FirstOrDefault();
            //postLevelName = postLevelDict == null ? "" : postLevelDict.DICTIONARYNAME;

            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_EMPLOYEECONTRACT", "CHECKSTATE", "1", checkState));
            //AutoList.Add(basedata("T_OA_APPROVALINFO", "OWNERCOMPANYID", approvalInfo.OWNERCOMPANYID, StrCompanyName));
            //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_EMPLOYEECONTRACT", "EMPLOYEEID", Info.T_HR_EMPLOYEE.EMPLOYEEID, Info.T_HR_EMPLOYEE.EMPLOYEECNAME));
            AutoList.Add(basedata("T_HR_EMPLOYEECONTRACT", "POSTLEVEL", EmployeePost.POSTLEVEL.ToString(), EmployeePost.POSTLEVEL.ToString()));
            AutoList.Add(basedata("T_HR_EMPLOYEECONTRACT", "EMPLOYEECNAME", Info.T_HR_EMPLOYEE.EMPLOYEECNAME, Info.T_HR_EMPLOYEE.EMPLOYEECNAME));
            AutoList.Add(basedata("T_HR_EMPLOYEECONTRACT", "OWNER", Info.T_HR_EMPLOYEE.EMPLOYEECNAME, Info.T_HR_EMPLOYEE.EMPLOYEECNAME));
            AutoList.Add(basedata("T_HR_EMPLOYEECONTRACT", "CREATEUSERNAME", createUserName, createUserName));
            AutoList.Add(basedata("T_HR_EMPLOYEECONTRACT", "AttachMent", Info.EMPLOYEECONTACTID, Info.EMPLOYEECONTACTID));

            AutoList.Add(basedata("T_HR_EMPLOYEECONTRACT", "OWNERCOMPANYID", Info.OWNERCOMPANYID, ownerCompanyName));
            AutoList.Add(basedata("T_HR_EMPLOYEECONTRACT", "OWNERDEPARTMENTID", Info.OWNERDEPARTMENTID, ownerDepartmentName));
            AutoList.Add(basedata("T_HR_EMPLOYEECONTRACT", "OWNERPOSTID", Info.OWNERPOSTID, ownerPostName));
            AutoList.Add(basedata("T_HR_EMPLOYEECONTRACT", "NOENDDATE", Info.NOENDDATE, Info.NOENDDATE == "0"?"否":"是"));
            string a = mx.TableToXml(Info, null, StrSource, AutoList);

            return(a);
        }
示例#2
0
        private string GetXmlString(string StrSource, T_HR_EMPLOYEEADDSUMBATCH Info)
        {
            Dictionary <string, string> systype = new Dictionary <string, string>();

            systype.Add("0", "员工加扣款");
            systype.Add("1", "员工代扣款");
            //systype.Add("2", "绩效奖金");
            //systype.Add("3", "其他......");

            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 AssignType = cbxkAssignedObjectType.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_EMPLOYEEADDSUMBATCH", "CHECKSTATE", "1", checkState));
            AutoList.Add(basedata("T_HR_EMPLOYEEADDSUMBATCH", "BALANCEOBJECTTYPE", Info.BALANCEOBJECTTYPE, AssignType != null ? AssignType.DICTIONARYNAME : ""));
            AutoList.Add(basedata("T_HR_EMPLOYEEADDSUMBATCH", "BALANCEOBJECTID", Info.BALANCEOBJECTID, lkAssignObject.TxtLookUp.Text));
            AutoList.Add(basedata("T_HR_EMPLOYEEADDSUMBATCH", "OWNERCOMPANYID", Info.OWNERCOMPANYID, ownerCompanyName));
            AutoList.Add(basedata("T_HR_EMPLOYEEADDSUMBATCH", "OWNERDEPARTMENTID", Info.OWNERDEPARTMENTID, ownerDepartmentName));
            AutoList.Add(basedata("T_HR_EMPLOYEEADDSUMBATCH", "OWNERPOSTID", Info.OWNERPOSTID, ownerPostName));
            AutoList.Add(basedata("T_HR_EMPLOYEEADDSUMBATCH", "BALANCESHORTDATE", Info.BALANCEYEAR + " - " + Info.BALANCEMONTH, Info.BALANCEYEAR + " - " + Info.BALANCEMONTH));//新加字段发薪年月
            foreach (var v in listDetail)
            {
                AutoList.Add(basedataForChild("T_HR_EMPLOYEEADDSUM", "SYSTEMTYPE", v.SYSTEMTYPE, systype[v.SYSTEMTYPE.ToString()], v.ADDSUMID));
                AutoList.Add(basedataForChild("T_HR_EMPLOYEEADDSUM", "CHECKSTATE", "1", checkState, v.ADDSUMID));
                AutoList.Add(basedataForChild("T_HR_EMPLOYEEADDSUM", "DEALDATE", v.DEALYEAR + " - " + v.DEALMONTH, v.DEALYEAR + " - " + v.DEALMONTH, v.ADDSUMID)); //新加字典加扣款年月
            }
            string a = mx.TableToXml(Info, listDetail, StrSource, AutoList);

            return(a);
        }
        /// <summary>
        /// 分配对象为员工时,检查选择的多个员工是否为同一公司
        /// </summary>
        /// <param name="ents"></param>
        private void CheckSelectedObj(List <ExtOrgObj> ents)
        {
            string strIds = string.Empty, strSelEmpNames = string.Empty, strMsg = string.Empty;

            List <string> entCompanyIds    = new List <string>();
            List <string> entPostIds       = new List <string>();
            List <string> entDepartmentIds = new List <string>();

            foreach (ExtOrgObj item in ents)
            {
                ExtOrgObj objPost = (ExtOrgObj)item.ParentObject;
                if (objPost == null)
                {
                    continue;
                }

                SMT.Saas.Tools.OrganizationWS.T_HR_POST entPost = objPost.ObjectInstance as SMT.Saas.Tools.OrganizationWS.T_HR_POST;
                if (entPost == null)
                {
                    continue;
                }

                //这句阻断,不知道为什么
                //if (entPost.T_HR_DEPARTMENT == null)
                //{
                //    continue;
                //}

                ExtOrgObj objDepartment = (ExtOrgObj)objPost.ParentObject;
                if (objDepartment == null)
                {
                    continue;
                }

                SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT entDepartment = objDepartment.ObjectInstance as SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT;
                if (entDepartment.T_HR_COMPANY == null)
                {
                    continue;
                }

                if (entPostIds.Contains(entPost.POSTID) == false)
                {
                    entPostIds.Add(entPost.POSTID);
                }

                if (entDepartmentIds.Contains(entDepartment.DEPARTMENTID) == false)
                {
                    entDepartmentIds.Add(entDepartment.DEPARTMENTID);
                }

                if (entCompanyIds.Contains(entDepartment.T_HR_COMPANY.COMPANYID) == false)
                {
                    entCompanyIds.Add(entDepartment.T_HR_COMPANY.COMPANYID);
                }

                SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE entEmp = item.ObjectInstance as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;
                strIds         += entEmp.EMPLOYEEID + ",";
                strSelEmpNames += entDepartment.T_HR_COMPANY.CNAME + "-"
                                  + entDepartment.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME + "-"
                                  + entPost.T_HR_POSTDICTIONARY.POSTNAME + "-" + entEmp.EMPLOYEECNAME + ";";
            }

            lkAssignObject.TxtLookUp.Text = strSelEmpNames;

            //entity.ASSIGNEDOBJECTTYPE = (Convert.ToInt32(AssignedObjectType.Personnel) + 1).ToString();
            entity.EMPLOYEEID   = strIds;
            entity.EMPLOYEENAME = strSelEmpNames;



            SetRecordOwner(entCompanyIds[0]);
        }