Exemplo n.º 1
0
        /// <summary>
        /// 将岗位信息集合转换成标准结构的部岗位数据集合(V_DEPARTMENT => T_HR_DEPARTMENT),
        /// 并将转换后的数据集合存到内存中,然后再加载岗位数据
        /// </summary>
        private void ReFillDataToPost()
        {
            allPosts = new List <SMT.Saas.Tools.OrganizationWS.T_HR_POST>();
            //把岗位视图集合转换为岗位实体集合
            foreach (var ent in allPostsView)
            {
                SMT.Saas.Tools.OrganizationWS.T_HR_POST pt = new SMT.Saas.Tools.OrganizationWS.T_HR_POST();
                pt.POSTID       = ent.POSTID;
                pt.FATHERPOSTID = ent.FATHERPOSTID;
                pt.CHECKSTATE   = ent.CHECKSTATE;
                pt.EDITSTATE    = ent.EDITSTATE;

                pt.T_HR_POSTDICTIONARY = new SMT.Saas.Tools.OrganizationWS.T_HR_POSTDICTIONARY();
                pt.T_HR_POSTDICTIONARY.POSTDICTIONARYID = Guid.NewGuid().ToString();
                pt.T_HR_POSTDICTIONARY.POSTNAME         = ent.POSTNAME;

                pt.T_HR_DEPARTMENT = new SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT();
                pt.T_HR_DEPARTMENT = allDepartments.Where(s => s.DEPARTMENTID == ent.DEPARTMENTID).FirstOrDefault();

                allPosts.Add(pt);
            }
            //把岗位实体集合存入缓存和独立存储
            AddToResourceDictionary <List <SMT.Saas.Tools.OrganizationWS.T_HR_POST> >(RESPOSTINFOKEY, allPosts);
            if (OnGetOrgCompleted != null)
            {
                OnGetOrgCompleted(this, null);
            }
            // personelClient.GetEmployeeDetailViewByIDAsync(_UserEmployeeID);

            //第三阶段优化
            //SaveOrganizationByLocal(SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.SysUserID);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 加载岗位
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void orgClient_GetPostByIdCompleted(object sender, GetPostByIdCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                SMT.Saas.Tools.OrganizationWS.T_HR_POST entPost = e.Result;
                lkAssignObject.DataContext       = entPost;
                lkAssignObject.DisplayMemberPath = "T_HR_POSTDICTIONARY.POSTNAME";
                if (entPost != null)
                {
                    AttendMonthlyBatchBalance.BALANCEOBJECTNAME = entPost.T_HR_POSTDICTIONARY.POSTNAME;

                    if (entPost.POSTID != AttendMonthlyBatchBalance.OWNERPOSTID)
                    {
                        var temp = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts.Where(c => c.PostID == entPost.POSTID);
                        if (temp != null && temp.Count() > 0)
                        {
                            AttendMonthlyBatchBalance.OWNERCOMPANYID    = temp.FirstOrDefault().CompanyID;
                            AttendMonthlyBatchBalance.OWNERDEPARTMENTID = temp.FirstOrDefault().DepartmentID;
                            AttendMonthlyBatchBalance.OWNERPOSTID       = temp.FirstOrDefault().PostID;
                        }
                        BindGrid();
                    }
                }
            }
            else
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(e.Error.Message));
            }
        }
Exemplo n.º 3
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();
        }
Exemplo n.º 4
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);
        }
Exemplo n.º 5
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);
        }
Exemplo n.º 6
0
 void orgClient_GetPostByIdCompleted(object sender, GetPostByIdCompletedEventArgs e)
 {
     if (e.Error == null)
     {
         OrganizationWS.T_HR_POST post = e.Result as OrganizationWS.T_HR_POST;
         lkAssignObject.DisplayMemberPath = "T_HR_POSTDICTIONARY.POSTNAME";
         lkAssignObject.DataContext       = post;
     }
     else
     {
         ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
     }
 }
Exemplo n.º 7
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);
        }
Exemplo n.º 8
0
 /// <summary>
 /// 根据应用对象类型,对应用对象赋值(当前类型为岗位)
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void clientOrg_GetPostByIdCompleted(object sender, SMT.Saas.Tools.OrganizationWS.GetPostByIdCompletedEventArgs e)
 {
     RefreshUI(RefreshedTypes.HideProgressBar);
     if (e.Error == null)
     {
         OrganizationWS.T_HR_POST entPost = e.Result as OrganizationWS.T_HR_POST;
         lkAssignObject.DataContext       = entPost;
         lkAssignObject.DisplayMemberPath = "T_HR_POSTDICTIONARY.POSTNAME";
     }
     else
     {
         Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(e.Error.Message));
     }
 }
Exemplo n.º 9
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;
            }
        }
Exemplo n.º 10
0
        private void LoadPostInfo()
        {
            organClient.GetAllPostViewCompleted += (o, e) =>
            {
                if (e.Error == null)
                {
                    if (e.Result != null)
                    {
                        List <SMT.Saas.Tools.OrganizationWS.V_POST> vpostList = e.Result.ToList();
                        allPosts = new List <SMT.Saas.Tools.OrganizationWS.T_HR_POST>();
                        //把岗位视图集合转换为岗位实体集合
                        foreach (var ent in vpostList)
                        {
                            SMT.Saas.Tools.OrganizationWS.T_HR_POST pt = new SMT.Saas.Tools.OrganizationWS.T_HR_POST();
                            pt.POSTID       = ent.POSTID;
                            pt.FATHERPOSTID = ent.FATHERPOSTID;
                            pt.CHECKSTATE   = ent.CHECKSTATE;
                            pt.EDITSTATE    = ent.EDITSTATE;

                            pt.T_HR_POSTDICTIONARY = new SMT.Saas.Tools.OrganizationWS.T_HR_POSTDICTIONARY();
                            pt.T_HR_POSTDICTIONARY.POSTDICTIONARYID = Guid.NewGuid().ToString();
                            pt.T_HR_POSTDICTIONARY.POSTNAME         = ent.POSTNAME;

                            pt.T_HR_DEPARTMENT = new SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT();
                            pt.T_HR_DEPARTMENT = allDepartments.Where(s => s.DEPARTMENTID == ent.DEPARTMENTID).FirstOrDefault();

                            allPosts.Add(pt);
                        }
                        //把岗位实体集合存入缓存和独立存储
                        AddToResourceDictionary <List <SMT.Saas.Tools.OrganizationWS.T_HR_POST> >(ConstStrings.RES_POSTINFO_KEY, allPosts);
                        // personelClient.GetEmployeeDetailViewByIDAsync(_UserEmployeeID);
                    }
                    //personelClient.GetEmployeeDetailViewByIDAsync(_UserEmployeeID);

                    //默认获取以下,用户是否有发新闻的权限

                    //已经作废
                    _commServices.GetCustomPermission(_SysUserID, "NEWSPUBLISH");
                }
                else
                {
                    //errorPanel.Visibility = Visibility.Visible;
                    //loadingfoPanel.Visibility = Visibility.Collapsed;
                    //ExceptionManager.SendException(Resource.MSG_100014_WCF_ERROR, "PF", "LoadPostInfo", "1000014", e.Error);
                }
            };
            organClient.GetAllPostViewAsync(_UserEmployeeID);
        }
Exemplo n.º 11
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);
        }
Exemplo n.º 12
0
        private void lkPost_FindClick(object sender, EventArgs e)
        {
            //OrganizationLookupForm lookup = new OrganizationLookupForm();
            OrganizationLookup lookup = new OrganizationLookup();

            lookup.SelectedObjType = OrgTreeItemTypes.Post;
            lookup.SelectedClick  += (obj, ev) =>
            {
                OrganizationWS.T_HR_POST ent = lookup.SelectedObj[0].ObjectInstance as OrganizationWS.T_HR_POST;

                if (ent != null)
                {
                    HandlePostChanged(ent);
                    orclient.GetPostNumberAsync(ent.POSTID);
                }
            };

            lookup.Show <string>(DialogMode.Default, Common.ParentLayoutRoot, "", (result) => { });
        }
Exemplo n.º 13
0
        private void BindEmployeeByTreeViewItem(TreeViewItem item)
        {
            if (item == null)
            {
                return;
            }
            ExtOrgObj tmp = new ExtOrgObj();

            tmp = item.DataContext as ExtOrgObj;
            if (tmp.ObjectType == OrgTreeItemTypes.Personnel)
            {
                foreach (var h in ((PersonnelWS.T_HR_EMPLOYEE)tmp.ObjectInstance).T_HR_EMPLOYEEPOST)
                {
                    PersonnelWS.T_HR_POST    tmpPost_P = new PersonnelWS.T_HR_POST();
                    OrganizationWS.T_HR_POST tmpPost_O = new OrganizationWS.T_HR_POST();
                    tmpPost_O = BindEmployeePost(item);
                }
            }
        }
Exemplo n.º 14
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);
        }
Exemplo n.º 15
0
        private void HandlePostChanged(OrganizationWS.T_HR_POST ent)
        {
            lkPost.DataContext = ent;
            T_HR_POST temp = new T_HR_POST();

            temp.POSTID            = ent.POSTID;
            EmployeePost.T_HR_POST = temp;
            companyID = ent.T_HR_DEPARTMENT.T_HR_COMPANY.COMPANYID;
            //txtCompanyName.Text = ent.T_HR_DEPARTMENT.T_HR_COMPANY.CNAME;
            //txtDepartment.Text = ent.T_HR_DEPARTMENT.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME;
            SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT fartherdep = ent.T_HR_DEPARTMENT;
            string orgname = ent.T_HR_POSTDICTIONARY.POSTNAME + GetFullOrgName(fartherdep);

            lkPost.TxtLookUp.Text     = orgname;
            SysUser.OWNERCOMPANYID    = ent.T_HR_DEPARTMENT.T_HR_COMPANY.COMPANYID;
            SysUser.OWNERDEPARTMENTID = ent.T_HR_DEPARTMENT.DEPARTMENTID;
            SysUser.OWNERPOSTID       = ent.POSTID;

            Employee.OWNERCOMPANYID    = companyID;
            Employee.OWNERDEPARTMENTID = ent.T_HR_DEPARTMENT.DEPARTMENTID;
            Employee.OWNERPOSTID       = ent.POSTID;
            Employee.OWNERID           = Employee.EMPLOYEEID;

            EmployeeEntry.OWNERCOMPANYID    = companyID;
            EmployeeEntry.OWNERDEPARTMENTID = ent.T_HR_DEPARTMENT.DEPARTMENTID;
            EmployeeEntry.OWNERPOSTID       = ent.POSTID;

            foreach (T_SYS_DICTIONARY item in cbxPostLevel.Items)
            {
                if (item.DICTIONARYVALUE == ent.POSTLEVEL)
                {
                    cbxPostLevel.SelectedItem = item;
                    break;
                }
            }
        }
Exemplo n.º 16
0
 private void AddDistributeObjList(SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj issuanceExtOrgObj, string issuanceID)
 {
     SMT.SaaS.OA.UI.SmtOAPersonOfficeService.T_OA_DISTRIBUTEUSER distributeTmp = new SMT.SaaS.OA.UI.SmtOAPersonOfficeService.T_OA_DISTRIBUTEUSER();
     distributeTmp.DISTRIBUTEUSERID = Guid.NewGuid().ToString();
     distributeTmp.MODELNAME        = "EmployeeSurveyDistribute";
     distributeTmp.FORMID           = issuanceID;
     distributeTmp.VIEWTYPE         = ((int)GetObjectType(issuanceExtOrgObj)).ToString();
     if (distributeTmp.VIEWTYPE == ((int)IssuanceObjectType.Post).ToString())    //如果是选择岗位,则保存岗位级别
     {
         SMT.Saas.Tools.OrganizationWS.T_HR_POST hr = (SMT.Saas.Tools.OrganizationWS.T_HR_POST)issuanceExtOrgObj.ObjectInstance;
         if (!string.IsNullOrEmpty(hr.POSTLEVEL.ToString()))
         {
             distributeTmp.VIEWER = hr.POSTLEVEL.ToString();
         }
         else
         {
             distributeTmp.VIEWER = hr.T_HR_POSTDICTIONARY.POSTLEVEL.ToString();
         }
     }
     else
     {
         distributeTmp.VIEWER = issuanceExtOrgObj.ObjectID;
     }
     distributeTmp.CREATEDATE         = DateTime.Now;
     distributeTmp.CREATEUSERID       = Common.CurrentLoginUserInfo.EmployeeID;
     distributeTmp.CREATEUSERNAME     = Common.CurrentLoginUserInfo.EmployeeName;
     distributeTmp.CREATEPOSTID       = Common.CurrentLoginUserInfo.UserPosts[0].PostID;
     distributeTmp.CREATEDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
     distributeTmp.CREATECOMPANYID    = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
     distributeTmp.OWNERID            = Common.CurrentLoginUserInfo.EmployeeID;
     distributeTmp.OWNERNAME          = Common.CurrentLoginUserInfo.EmployeeName;
     distributeTmp.OWNERPOSTID        = Common.CurrentLoginUserInfo.UserPosts[0].PostID;
     distributeTmp.OWNERDEPARTMENTID  = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
     distributeTmp.OWNERCOMPANYID     = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
     distributeLists.Add(distributeTmp);
 }
Exemplo n.º 17
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()));
            }
        }
Exemplo n.º 18
0
 private void BindEmployeeByTreeViewItem(TreeViewItem item)
 {
     if (item == null)
         return;
     ExtOrgObj tmp = new ExtOrgObj();
     tmp = item.DataContext as ExtOrgObj;
     if (tmp.ObjectType == OrgTreeItemTypes.Personnel)
     {
         foreach (var h in ((PersonnelWS.T_HR_EMPLOYEE)tmp.ObjectInstance).T_HR_EMPLOYEEPOST)
         {
             PersonnelWS.T_HR_POST tmpPost_P = new PersonnelWS.T_HR_POST();
             OrganizationWS.T_HR_POST tmpPost_O = new OrganizationWS.T_HR_POST();
             tmpPost_O = BindEmployeePost(item);
         }
     }
 }
Exemplo n.º 19
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);
            }
        }
Exemplo n.º 20
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;
            }

        }
Exemplo n.º 21
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()));
            }
        }