Пример #1
0
        private void lkOrg_FindClick(object sender, EventArgs e)
        {
            SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup lookup = new SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup();
            lookup.SelectedObjType = SMT.SaaS.FrameworkUI.OrgTreeItemTypes.All;
            lookup.MultiSelected   = false;
            lookup.SelectedClick  += (o, ev) =>
            {
                if (lookup.SelectedObj.Count > 0)
                {
                    List <ExtOrgObj> list = new List <ExtOrgObj>();
                    string           text = " ";

                    foreach (ExtOrgObj obj in lookup.SelectedObj)
                    {
                        list.Add(obj);

                        text = text.Trim() + ";" + obj.ObjectName;
                    }
                    SMT.FBAnalysis.UI.CommonTools.MultiValuesItem <ExtOrgObj> item = new SMT.FBAnalysis.UI.CommonTools.MultiValuesItem <ExtOrgObj>();
                    item.Values = list;
                    item.Text   = text.Substring(1);
                    //item.Text = text.Substring(text.LastIndexOf(";") + 1);
                    lkOrg.SelectItem        = item;
                    lkOrg.DataContext       = item;
                    lkOrg.DisplayMemberPath = "Text";
                }
            };
            lookup.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { }, true, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID);
        }
Пример #2
0
 private void AddOrganizeObj()
 {
     SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup lookup = new SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup();
     lookup.SelectedObjType = SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Company;
     lookup.SelectedClick  += (obj, ev) =>
     {
         List <ExtOrgObj> ent = lookup.SelectedObj as List <ExtOrgObj>;
         if (ent != null && ent.Count > 0)
         {
             if (issuanceExtOrgObj.Count() > 0)
             {
                 foreach (var q in ent)
                 {
                     var ents = from entorg in issuanceExtOrgObj
                                where entorg.ObjectID == q.ObjectID
                                select entorg;
                     if (ents.Count() == 0)
                     {
                         issuanceExtOrgObj.Add(q);
                     }
                 }
             }
             else
             {
                 issuanceExtOrgObj = ent;
             }
             BindData();
         }
     };
     lookup.MultiSelected       = true;
     lookup.SelectSameGradeOnly = true;
     lookup.Show();
 }
 /// <summary>
 /// 弹出选择分发范围的lookup,并在选择后绑定到DataGrid
 /// </summary>
 private void SelectViewer()
 {
     SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup lookup = new SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup();
     lookup.SelectedObjType = SMT.SaaS.FrameworkUI.OrgTreeItemTypes.All;
     lookup.SelectedClick  += (obj, ev) =>
     {
         List <SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj> ent = lookup.SelectedObj as List <SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj>;
         if (ent != null && ent.Count > 0)
         {
             lookupObjectList = ent;
             if (actionTypes != FormTypes.Browse && actionTypes != FormTypes.Audit)
             {
                 distributeuserList.Clear();
             }
             foreach (var data in lookupObjectList)
             {
                 distributeuserList.Add(new T_OA_DISTRIBUTEUSER {
                     VIEWTYPE = data.ObjectType.ToString(), VIEWER = data.ObjectName
                 });
             }
             BindingDataGrid();
         }
         else
         {
             ShowMessage("error", "ERROR", "ERROR", "", false);
             return;
         }
     };
     lookup.MultiSelected = false;
     lookup.Show();
 }
Пример #4
0
 private void AddIssuanObj()
 {
     SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup lookup = new SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup();
     lookup.SelectedObjType = SMT.SaaS.FrameworkUI.OrgTreeItemTypes.All;
     lookup.SelectedClick  += (obj, ev) =>
     {
         List <ExtOrgObj> ent = lookup.SelectedObj as List <ExtOrgObj>;
         if (ent != null && ent.Count > 0)
         {
             issuanceExtOrgObj = ent;
             BindData();
         }
     };
     lookup.MultiSelected       = true;
     lookup.SelectSameGradeOnly = true;
     lookup.Show();
 }
Пример #5
0
        private void AddMembersObj()
        {
            SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup lookup = new SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup();
            lookup.SelectedObjType = SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Personnel;

            lookup.SelectedClick += (obj, ev) =>
            {
                List <ExtOrgObj> ent = lookup.SelectedObj as List <ExtOrgObj>;
                if (ent != null && ent.Count > 0)
                {
                    foreach (var h in ent)
                    {
                        V_EMPLOYEEVIEW view = new V_EMPLOYEEVIEW();
                        SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj userInfo = ent.FirstOrDefault();

                        SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj post = (SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj)userInfo.ParentObject;
                        view.OWNERPOSTID = post.ObjectID;
                        view.POSTNAME    = post.ObjectName;//岗位

                        SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj dept = (SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj)post.ParentObject;
                        view.OWNERDEPARTMENTID = dept.ObjectID;
                        view.DEPARTMENTNAME    = dept.ObjectName;//部门

                        SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY corp = (dept.ObjectInstance as SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT).T_HR_COMPANY;
                        view.OWNERCOMPANYID = corp.COMPANYID;
                        view.COMPANYNAME    = corp.CNAME;//公司

                        SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE emp = userInfo.ObjectInstance as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;
                        view.EMPLOYEEID    = emp.EMPLOYEEID;
                        view.EMPLOYEECNAME = emp.EMPLOYEECNAME;

                        listEmpolyeeView.Add(view);
                    }
                    //issuanceExtOrgObj = ent;
                    tmpMeetingMember = ent;
                    // personclient.GetEmployeeDetailByIDsAsync(StrStaffList);
                    BindData();
                }
            };
            lookup.MultiSelected       = true;
            lookup.SelectSameGradeOnly = true;
            lookup.Show();
        }
        private void AddIssuanObj()
        {
            entall = new List <ExtOrgObj>();
            SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup lookup = new SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup();
            lookup.SelectedObjType = SMT.SaaS.FrameworkUI.OrgTreeItemTypes.All;
            lookup.SelectedClick  += (obj, ev) =>
            {
                List <ExtOrgObj> ent = lookup.SelectedObj as List <ExtOrgObj>;
                if (ent != null && ent.Count > 0)
                {
                    //issuanceExtOrgObj = ent;
                    foreach (var h in ent)
                    {
                        if (h.ObjectType == SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Company)//公司
                        {
                            StrCompanyIDsList.Add(h.ObjectID);
                        }
                        if (h.ObjectType == SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Department)//部门
                        {
                            StrDepartmentIDsList.Add(h.ObjectID);
                        }
                        if (h.ObjectType == SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Post)//岗位
                        {
                            StrPositionIDsList.Add(h.ObjectID);
                        }
                        if (h.ObjectType == SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Personnel)
                        {
                            StaffList.Add(h.ObjectID);
                        }
                    }


                    personnerClient.GetEmployeeIDsByParasAsync(StrCompanyIDsList, StrDepartmentIDsList, StrPositionIDsList);
                }
            };
            lookup.MultiSelected       = true;
            lookup.SelectSameGradeOnly = true;
            lookup.Show();
        }
Пример #7
0
        /// <summary>
        /// 选择员工
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void LookUp_FindClick(object sender, EventArgs e)
        {
            //lookup.Show<string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) =>{});
            OrganizationLookup lookup = new OrganizationLookup();

            lookup.SelectedObjType = OrgTreeItemTypes.Personnel;
            lookup.SelectedClick += (obj, ev) =>
            {
                List<SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj> ent = lookup.SelectedObj as List<SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj>;
                if (ent != null && ent.Count > 0)
                {
                    SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj userInfo = ent.FirstOrDefault();

                    SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj post = (SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj)userInfo.ParentObject;
                    string postid = post.ObjectID;
                    string postName = post.ObjectName;//岗位

                    SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj dept = (SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj)post.ParentObject;
                    string deptid = dept.ObjectID;
                    string deptName = 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 corpName = corp.CNAME;//公司

                    SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE emp = userInfo.ObjectInstance as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;


                    string StrEmployee = userInfo.ObjectName + "-" + post.ObjectName + "-" + dept.ObjectName + "-" + corp.CNAME;
                    lkEmployeeName.TxtLookUp.Text = StrEmployee;
                    lkEmployeeName.DataContext = emp;
                    ToolTipService.SetToolTip(lkEmployeeName.TxtLookUp, StrEmployee);

                    if (ent != null)
                    {
                        RefreshUI(RefreshedTypes.ShowProgressBar);
                        clientAtt.GetAbnormRecordByEmployeeIDAsync(emp.EMPLOYEEID);
                    }
                }
            };

            lookup.Show<string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { });
        }
Пример #8
0
        /// <summary>
        /// 选择考勤方案应用对象
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void lkAssignObject_FindClick(object sender, EventArgs e)
        { 
            OrganizationLookup lookup = new OrganizationLookup();           
            lookup.SelectedObjType = OrgTreeItemTypes.Personnel;
            lookup.MultiSelected = true;
            lookup.SelectedClick += (obj, ev) =>
            {
                List<ExtOrgObj> ents = lookup.SelectedObj as List<ExtOrgObj>;
                if (ents == null)
                {
                    return;
                }

                if (ents.Count() == 0)
                {
                    return;
                }
               
                txtErrorMsg.Text = string.Empty;
                string strCheckCompanyId = string.Empty;


                if (lookup.SelectedObjType == OrgTreeItemTypes.Personnel)
                {
                    SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE ent = lookup.SelectedObj[0].ObjectInstance as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;
                    if (ent == null)
                    {
                        return;
                    }
                    CheckSelectedObj(ents);

                }
                else
                {
                    MessageBox.Show("只能选择员工!");
                }
                
            };

            lookup.Show<string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { });
        }
        /// <summary>
        /// 权限范围(组织架构)之添加公司事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SelectCompany_Click(object sender, RoutedEventArgs e)
        {
            SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup lookup = new SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup();
            lookup.SelectedObjType = SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Company;
            lookup.SelectedClick += (obj, ev) =>
            {
                List<ExtOrgObj> entExtOrgObjs = lookup.SelectedObj as List<ExtOrgObj>;
                if (entExtOrgObjs == null)
                {
                    return;
                }

                if (entExtOrgObjs.Count() == 0)
                {
                    return;
                }

                List<T_HR_COMPANY> entCompanyList = Application.Current.Resources["SYS_CompanyInfo"] as List<T_HR_COMPANY>;
                //List<T_HR_DEPARTMENT> entDepartmentList = Application.Current.Resources["SYS_DepartmentInfo"] as List<T_HR_DEPARTMENT>;
                //List<T_HR_POST> entPostList = Application.Current.Resources["SYS_PostInfo"] as List<T_HR_POST>;

                List<T_HR_COMPANY> entCompanyChecks = new List<T_HR_COMPANY>();
                if (DtGridCompany.ItemsSource != null)
                {
                    foreach (T_HR_COMPANY com in DtGridCompany.ItemsSource)
                    {
                        entCompanyChecks.Add(com);
                    }
                }
                List<T_HR_COMPANY> entCompanyAdds = new List<T_HR_COMPANY>();

                List<ExtOrgObj> ListExtOrgCompanyObj = new List<ExtOrgObj>();



                if (entCompanyList.Count() == 0)
                {
                    return;
                }

                if (entCompanyChecks == null)
                {
                    entCompanyChecks = new List<T_HR_COMPANY>();
                }



                foreach (ExtOrgObj item in entExtOrgObjs)
                {
                    T_HR_COMPANY entCompay = item.ObjectInstance as T_HR_COMPANY;

                    var c = from o in entCompanyChecks
                            where o.COMPANYID == entCompay.COMPANYID
                            select o;

                    if (c.Count() > 0)
                    {
                        continue;
                    }

                    var q = from o in entCompanyList
                            where o.COMPANYID == entCompay.COMPANYID
                            select o;

                    if (q.Count() > 0)
                    {
                        var entAdd = from ent in entCompanyAdds
                                     where ent.COMPANYID == entCompay.COMPANYID
                                     select ent;
                        if (entAdd.Count() == 0 || entCompanyAdds.Count() == 0)
                        {
                            entCompanyAdds.Add(q.FirstOrDefault());
                            ListExtOrgCompanyObj.Add(item);
                        }
                    }
                }

                entCompanyAdds.AddRange(entCompanyChecks);

                DtGridCompany.ItemsSource = entCompanyAdds;
                AddCustomPermissionByExtOrgObj(ListExtOrgCompanyObj);
            };

            lookup.MultiSelected = true;
            lookup.SelectSameGradeOnly = true;
            lookup.Show();
        }
Пример #10
0
        private void LookUp_FindClick(object sender, EventArgs e)
        {
            #region
            OrganizationLookup lookup = new OrganizationLookup();

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

                if (ent != null && ent.Count > 0)
                {
                    ExtOrgObj companyInfo = ent.FirstOrDefault();
                    ExtOrgObj post = (ExtOrgObj)companyInfo.ParentObject;
                    string postid = post.ObjectID;
                    ExtOrgObj dept = (ExtOrgObj)post.ParentObject;
                    string deptid = dept.ObjectID;
                    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;

                    T_HR_EMPLOYEE temp = new T_HR_EMPLOYEE();
                    temp = ent.FirstOrDefault().ObjectInstance as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;

                    lkEmployeeName.DataContext = temp;
                    Employee.FATHEREMPLOYEEID = temp.EMPLOYEEID;
                }

            };

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

        }
Пример #11
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

        }
Пример #12
0
        private void lkSelectObj_FindClick(object sender, EventArgs e)
        {

            string userID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
            string perm = (((int)FormTypes.Browse) + 1).ToString();   //zl 3.1
            OrganizationLookup ogzLookup = new OrganizationLookup();
            ogzLookup.MultiSelected = false;
            ogzLookup.SelectedObjType = OrgTreeItemTypes.Company;

            ogzLookup.SelectedClick += (o, ev) =>
            {
                StrCompanyIDs = "";
                List<ExtOrgObj> ent = ogzLookup.SelectedObj as List<ExtOrgObj>;
                if (ent.Count() == 0)
                {
                    return;
                }
                List<ExtOrgObj> entall = new List<ExtOrgObj>();
                if (ent != null && ent.Count > 0)
                {
                    foreach (var h in ent)
                    {
                        if (h.ObjectType == SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Company)//公司
                        {
                            StrCompanyIDs = h.ObjectID;
                            //先添加总公司
                            ExtOrgObj obj2 = new ExtOrgObj();
                            obj2.ObjectID = h.ObjectID;
                            obj2.ObjectName = h.ObjectName;
                            obj2.ObjectType = SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Company;
                            entall.Add(obj2);
                            lkSelectObj.DataContext = (SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY)h.ObjectInstance;
                            lkSelectObj.DisplayMemberPath = "CNAME";
                        }
                    }
                }
            };
            ogzLookup.Show<string>(DialogMode.ApplicationModal, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { }, true, userID);
        }
 /// <summary>
 /// 选择发布对象
 /// </summary>
 private void SelectViewer()
 {
     SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup lookup = new SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup();
     lookup.SelectedObjType = SMT.SaaS.FrameworkUI.OrgTreeItemTypes.All;
     lookup.SelectedClick += (obj, ev) =>
     {
         List<SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj> ent = lookup.SelectedObj as List<SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj>;
         if (ent != null && ent.Count > 0)
         {
             lookupObjectList = ent;
             if (actionTypes != FormTypes.Browse && actionTypes != FormTypes.Audit)
             {
                 distributeuserList.Clear();
             }
             foreach (var data in lookupObjectList)
             {
                 distributeuserList.Add(new T_OA_DISTRIBUTEUSER { VIEWTYPE = data.ObjectType.ToString(), VIEWER = data.ObjectName });
             }
             BindingDataGrid();
         }
         else
         {
             ShowMessage(true, "ERROR", "ERROR", "");
             return;
         }
     };
     lookup.MultiSelected = false;
     lookup.Show();
 }
 private void AddIssuanObj()
 {
     entall = new List<ExtOrgObj>();
     SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup lookup = new SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup();
     lookup.SelectedObjType = SMT.SaaS.FrameworkUI.OrgTreeItemTypes.All;
     lookup.SelectedClick += (obj, ev) =>
     {
         List<ExtOrgObj> ent = lookup.SelectedObj as List<ExtOrgObj>;
         if (ent != null && ent.Count > 0)
         {
             //issuanceExtOrgObj = ent;
             foreach (var h in ent)
             {
                 if (h.ObjectType == SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Company)//公司
                 {
                     StrCompanyIDsList.Add(h.ObjectID);                            
                 }
                 if (h.ObjectType == SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Department)//部门
                 {
                     StrDepartmentIDsList.Add(h.ObjectID);                            
                 }
                 if (h.ObjectType == SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Post)//岗位
                 {
                     StrPositionIDsList.Add(h.ObjectID);
                 }
                 if (h.ObjectType == SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Personnel)
                 {
                     StaffList.Add(h.ObjectID);                            
                 }
             }
             
             
             personnerClient.GetEmployeeIDsByParasAsync(StrCompanyIDsList,StrDepartmentIDsList,StrPositionIDsList);
         }
     };
     lookup.MultiSelected = true;
     lookup.SelectSameGradeOnly = true;
     lookup.Show();
 }
Пример #15
0
        private void LookUp_FindClick(object sender, EventArgs e)
        {
            //Dictionary<string, string> cols = new Dictionary<string, string>();
            //cols.Add("EMPLOYEECODE", "T_HR_EMPLOYEE.EMPLOYEECODE");
            //cols.Add("EMPLOYEECNAME", "T_HR_EMPLOYEE.EMPLOYEECNAME");
            //cols.Add("EMPLOYEEENAME", "T_HR_EMPLOYEE.EMPLOYEEENAME");
            //LookupForm lookup = new LookupForm(SMT.Saas.Tools.OrganizationWS.EntityNames.Employee,
            //    typeof(SMT.Saas.Tools.OrganizationWS.V_EMPLOYEEPOST[]), cols);

            //lookup.SelectedClick += (o, ev) =>
            //{
            //    SMT.Saas.Tools.OrganizationWS.V_EMPLOYEEPOST ent = lookup.SelectedObj as SMT.Saas.Tools.OrganizationWS.V_EMPLOYEEPOST;;

            //    if (ent != null)
            //    {
            //        lkEmployeeName.DataContext = ent.T_HR_EMPLOYEE;
            //        client.GetEmployeeEntryByEmployeeIDAsync(ent.T_HR_EMPLOYEE.EMPLOYEEID);
            //    }
            //};

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

            lookup.SelectedObjType = OrgTreeItemTypes.Personnel;
            lookup.SelectedClick += (obj, ev) =>
            {
                List<SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj> ent = lookup.SelectedObj as List<SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj>;
                if (ent != null && ent.Count > 0)
                {
                    SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj userInfo = ent.FirstOrDefault();

                    SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj post = (SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj)userInfo.ParentObject;
                    string postid = post.ObjectID;
                    string postName = post.ObjectName;//岗位

                    SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj dept = (SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj)post.ParentObject;
                    string deptid = dept.ObjectID;
                    string deptName = 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 corpName = corp.CNAME;//公司

                    SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE emp = userInfo.ObjectInstance as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;

                    T_HR_EMPLOYEEPOST empPost = emp.T_HR_EMPLOYEEPOST.Where(t => t.T_HR_POST.POSTID == postid).FirstOrDefault();
                    if (empPost == null)
                    {
                        ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("CAUTION"), "检测员工当前岗位异常,请重试",
                                                  Utility.GetResourceStr("CONFIRM"), MessageIcon.Information);
                        return;
                    }

                    if (empPost.ISAGENCY == "1")
                    {
                        ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("CAUTION"), "员工兼职岗位不能转正",
                                                                         Utility.GetResourceStr("CONFIRM"), MessageIcon.Information);
                        return;
                    }

                    string StrEmployee = userInfo.ObjectName + "-" + post.ObjectName + "-" + dept.ObjectName + "-" + corp.CNAME;
                    lkEmployeeName.TxtLookUp.Text = StrEmployee;
                    lkEmployeeName.DataContext = emp;
                    ToolTipService.SetToolTip(lkEmployeeName.TxtLookUp, StrEmployee);

                    if (ent != null)
                    {
                        //client.GetEmployeeEntryByEmployeeIDAsync(ent.EMPLOYEEID);
                        client.GetEmployeeEntryByEmployeeIDAndCOMPANYIDAsync(emp.EMPLOYEEID, emp.OWNERCOMPANYID);
                        client.GetEmployeePostByEmployeeIDAsync(emp.EMPLOYEEID);
                    }
                }


                //SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE ent = lookup.SelectedObj[0].ObjectInstance as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;

                //if (ent != null)
                //{
                //    lkEmployeeName.DataContext = ent;
                //    //client.GetEmployeeEntryByEmployeeIDAsync(ent.EMPLOYEEID);
                //    client.GetEmployeeEntryByEmployeeIDAndCOMPANYIDAsync(ent.EMPLOYEEID, ent.OWNERCOMPANYID);
                //    client.GetEmployeePostByEmployeeIDAsync(ent.EMPLOYEEID);
                //}
            };

            lookup.Show<string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { });
        }
Пример #16
0
        private void AddMembersObj()
        {
            SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup lookup = new SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup();
            lookup.SelectedObjType = SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Personnel;
            
            lookup.SelectedClick += (obj, ev) =>
            {
                List<ExtOrgObj> ent = lookup.SelectedObj as List<ExtOrgObj>;
                if (ent != null && ent.Count > 0)
                {

                    foreach (var h in ent)
                    {
                        V_EMPLOYEEVIEW view = new V_EMPLOYEEVIEW();
                        SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj userInfo = ent.FirstOrDefault();

                        SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj post = (SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj)userInfo.ParentObject;
                        view.OWNERPOSTID = post.ObjectID;
                        view.POSTNAME = post.ObjectName;//岗位

                        SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj dept = (SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj)post.ParentObject;
                        view.OWNERDEPARTMENTID = dept.ObjectID;
                        view.DEPARTMENTNAME = dept.ObjectName;//部门

                        SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY corp = (dept.ObjectInstance as SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT).T_HR_COMPANY;
                        view.OWNERCOMPANYID = corp.COMPANYID;
                        view.COMPANYNAME  = corp.CNAME;//公司

                        SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE emp = userInfo.ObjectInstance as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;
                        view.EMPLOYEEID = emp.EMPLOYEEID;
                        view.EMPLOYEECNAME = emp.EMPLOYEECNAME;

                        listEmpolyeeView.Add(view);
                    }
                    //issuanceExtOrgObj = ent;
                    tmpMeetingMember = ent;                    
                   // personclient.GetEmployeeDetailByIDsAsync(StrStaffList);  
                    BindData();
                }
            };
            lookup.MultiSelected = true;
            lookup.SelectSameGradeOnly = true;
            lookup.Show();
        }
        /// <summary>
        /// 权限范围(组织架构)之添加岗位事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SelectPost_Click(object sender, RoutedEventArgs e)
        {
            SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup lookup = new SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup();
            lookup.SelectedObjType = SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Post;
            lookup.SelectedClick += (obj, ev) =>
            {
                List<ExtOrgObj> entExtOrgObjs = lookup.SelectedObj as List<ExtOrgObj>;
                if (entExtOrgObjs == null)
                {
                    return;
                }

                if (entExtOrgObjs.Count() == 0)
                {
                    return;
                }

                List<T_HR_POST> entPostList = Application.Current.Resources["SYS_PostInfo"] as List<T_HR_POST>;
                List<T_HR_POST> entChecks = DtGridPost.ItemsSource as List<T_HR_POST>;
                List<T_HR_POST> entPostAdds = new List<T_HR_POST>();
                List<ExtOrgObj> ListExtOrgPostObj = new List<ExtOrgObj>();

                if (entPostList == null)
                {
                    return;
                }

                if (entPostList.Count() == 0)
                {
                    return;
                }

                if (entChecks == null)
                {
                    entChecks = new List<T_HR_POST>();
                }

                foreach (ExtOrgObj item in entExtOrgObjs)
                {
                    T_HR_POST entPost = item.ObjectInstance as T_HR_POST;

                    var t = from o in entChecks
                            where o.POSTID == entPost.POSTID
                            select o;

                    if (t.Count() > 0)
                    {
                        continue;
                    }

                    var q = from c in entPostList
                            where c.POSTID == entPost.POSTID
                            select c;

                    if (q.Count() > 0)
                    {
                        T_HR_POST entAdd = SetNewPostEntity(q.FirstOrDefault());
                        entPostAdds.Add(entAdd);
                        ListExtOrgPostObj.Add(item);
                    }
                }

                entPostAdds.AddRange(entChecks);

                DtGridPost.ItemsSource = entPostAdds;
                AddCustomPermissionByExtOrgObj(ListExtOrgPostObj);
            };
            lookup.MultiSelected = true;
            lookup.SelectSameGradeOnly = true;
            lookup.Show();
        }
Пример #18
0
 private void AddOrganizeObj()
 {
     SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup lookup = new SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup();
     lookup.SelectedObjType = SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Company;
     lookup.SelectedClick += (obj, ev) =>
     {
         List<ExtOrgObj> ent = lookup.SelectedObj as List<ExtOrgObj>;
         if (ent != null && ent.Count > 0)
         {
             if (issuanceExtOrgObj.Count() > 0)
             {
                 foreach (var q in ent)
                 {
                     var ents = from entorg in issuanceExtOrgObj
                                where entorg.ObjectID == q.ObjectID
                                select entorg;
                     if (ents.Count()== 0)
                         issuanceExtOrgObj.Add(q);
                 }
             }
             else
             {
                 issuanceExtOrgObj = ent;
             }
             BindData();
         }
     };
     lookup.MultiSelected = true;
     lookup.SelectSameGradeOnly = true;
     lookup.Show();
 }
Пример #19
0
        private void btnFindRecordMember_Click(object sender, RoutedEventArgs e)
        {

            SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup lookup = new SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup();
            lookup.SelectedObjType = SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Personnel;
            lookup.SelectedClick += (obj, ev) =>
            {
                List<SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj> ent = lookup.SelectedObj as List<SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj>;
                if (ent != null && ent.Count > 0)
                {
                    SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj companyInfo = ent.FirstOrDefault();
                    //tmpHostMember = companyInfo;
                    StrRecordID = companyInfo.ObjectID;
                    tbxRecordMembers.Text = companyInfo.ObjectName;                    
                }
            };
            lookup.MultiSelected = false;
            lookup.Show();


        }
Пример #20
0
        private void btnFindHostMember_Click(object sender, RoutedEventArgs e)
        {

            SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup lookup = new SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup();
            lookup.SelectedObjType = SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Personnel;
            lookup.SelectedClick += (obj, ev) =>
            {
                List<SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj> ent = lookup.SelectedObj as List<SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj>;
                if (ent != null && ent.Count > 0)
                {
                    SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj companyInfo = ent.FirstOrDefault();
                    //tmpHostMember = companyInfo;
                    StrHostID = companyInfo.ObjectID;
                    personclient.GetEmployeeByIDAsync(StrHostID);//获取主持人的电话
                    personclient.GetEmployeeByIDCompleted += new EventHandler<GetEmployeeByIDCompletedEventArgs>(personclient_GetEmployeeByIDCompleted);
                    tbxHostMembers.Text = companyInfo.ObjectName;
                    //CompanyObject.Text = companyInfo.ObjectName;
                }
            };
            lookup.MultiSelected = false;
            lookup.Show();

            
        }
Пример #21
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) => { });
        }
Пример #22
0
        private void AddIssuanObj()
        {
            entall = new List<ExtOrgObj>();
            SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup lookup = new SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup();
            lookup.SelectedObjType = SMT.SaaS.FrameworkUI.OrgTreeItemTypes.All;
            lookup.SelectedClick += (obj, ev) =>
            {
                List<ExtOrgObj> ent = lookup.SelectedObj as List<ExtOrgObj>;
                if (ent != null && ent.Count > 0)
                {
                    //issuanceExtOrgObj = ent;
                    foreach (var h in ent)
                    {
                        if (h.ObjectType == SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Company)//公司
                        {
                            StrCompanyIDsList.Add(h.ObjectID);
                            //先添加总公司
                            ExtOrgObj obj2 = new ExtOrgObj();
                            obj2.ObjectID = h.ObjectID;
                            obj2.ObjectName = h.ObjectName;
                            obj2.ObjectType = SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Company;
                            var ExistEnts = from ext in entall
                                            where ext.ObjectID == obj2.ObjectID
                                            && ext.ObjectType == SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Company
                                            select ext;
                            if (ExistEnts.Count() == 0)
                            {
                                entall.Add(obj2);
                            }
                            //entall.Add(obj2);
                            List<SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY> listcompany = App.Current.Resources["SYS_CompanyInfo"] as List<SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY>;
                           var company= listcompany.Where(t=>t.EDITSTATE=="1");//过滤,选出已生效的公司信息
                           listcompany = company.ToList();
                            var ents = from childcompany in listcompany
                                       where childcompany.T_HR_COMPANY2 != null && childcompany.T_HR_COMPANY2.COMPANYID == h.ObjectID
                                       select childcompany;
                            if (ents != null)
                            {
                                if (ents.Count() > 0)
                                {
                                    GetCompanyExtOrgObj(listcompany,ents.ToList());
                                //    ents.ToList().ForEach(item =>
                                //    {
                                //        if (!StrCompanyIDsList.Contains(item.COMPANYID))
                                //        {
                                //            StrCompanyIDsList.Add(item.COMPANYID);
                                //            //issuanceExtOrgObj.Add(item);
                                //            ExtOrgObj obj1 = new ExtOrgObj();
                                //            obj1.ObjectID = item.COMPANYID;
                                //            obj1.ObjectName = item.CNAME;
                                //            obj1.ObjectType = SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Company;
                                //            entall.Add(obj1);
                                //            #region 2级子公司
                                            
                                //            var entsChilds = from childcompany in listcompany
                                //                             where childcompany.T_HR_COMPANY2 != null && childcompany.T_HR_COMPANY2.COMPANYID == item.COMPANYID
                                //                             select childcompany;
                                //            if (entsChilds.Count() > 0)
                                //            {
                                //                entsChilds.ToList().ForEach(child =>
                                //                {
                                //                    StrCompanyIDsList.Add(child.COMPANYID);
                                //                    //issuanceExtOrgObj.Add(item);
                                //                    ExtOrgObj objSecond = new ExtOrgObj();
                                //                    objSecond.ObjectID = child.COMPANYID;
                                //                    objSecond.ObjectName = child.CNAME;
                                //                    objSecond.ObjectType = SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Company;
                                //                    var ExistEnts = from ext in entall
                                //                                    where ext.ObjectID == child.COMPANYID
                                //                                    && ext.ObjectType == SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Company
                                //                                    select ext;
                                //                    if (ExistEnts.Count() == 0)
                                //                    {
                                //                        entall.Add(objSecond);
                                //                    }
                                //                });

                                //            }

                                //            #endregion
                                //        }
                                //    });
                                }
                            }
                            

                        }
                        if (h.ObjectType == SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Department)//部门
                        {
                            StrDepartmentIDsList.Add(h.ObjectID);
                            ExtOrgObj objDepart = new ExtOrgObj();
                            objDepart.ObjectID = h.ObjectID;
                            objDepart.ObjectName = h.ObjectName;
                            objDepart.ObjectType = SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Department;
                            var ExistEnts = from ext in entall
                                            where ext.ObjectID == objDepart.ObjectID
                                            && ext.ObjectType == SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Department
                                            select ext;
                            if (ExistEnts.Count() == 0)
                            {
                                entall.Add(objDepart);
                            }
                        }
                        if (h.ObjectType == SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Post)//岗位
                        {
                            StrPositionIDsList.Add(h.ObjectID);
                        }
                        if (h.ObjectType == SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Personnel)
                        {
                            StaffList.Add(h.ObjectID);
                            ExtOrgObj objPerson = new ExtOrgObj();
                            objPerson.ObjectID = h.ObjectID;
                            objPerson.ObjectName = h.ObjectName;
                            objPerson.ObjectType = SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Personnel;
                            var ExistEnts = from ext in entall
                                            where ext.ObjectID == objPerson.ObjectID
                                            && ext.ObjectType == SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Personnel
                                            select ext;
                            if (ExistEnts.Count() == 0)
                            {
                                entall.Add(objPerson);
                            }
                        }
                    }
                    issuanceExtOrgObj = entall;
                    //personclient.GetEmployeeDetailByParasAsync(StrCompanyIDsList, StrDepartmentIDsList, StrPositionIDsList, StaffList);
                    //personclient.GetEmployeeIDsByParasAsync(StrCompanyIDsList, StrDepartmentIDsList, StrPositionIDsList);
                    //StaffList.Clear();
                    //personclient.GetEmployeeIDsWithParasAsync(StrCompanyIDsList,true, StrDepartmentIDsList,true, StrPositionIDsList);
                    BindData();
                }
            };
            lookup.MultiSelected = true;
            lookup.SelectSameGradeOnly = true;
            lookup.Show();
        }
Пример #23
0
        private void LookUp_FindClick(object sender, EventArgs e)
        {
            #region
            //Dictionary<string, string> cols = new Dictionary<string, string>();
            //cols.Add("EMPLOYEECODE", "T_HR_EMPLOYEE.EMPLOYEECODE");
            //cols.Add("EMPLOYEECNAME", "T_HR_EMPLOYEE.EMPLOYEECNAME");
            //cols.Add("EMPLOYEEENAME", "T_HR_EMPLOYEE.EMPLOYEEENAME");
            //LookupForm lookup = new LookupForm(SMT.Saas.Tools.OrganizationWS.EntityNames.Employee,
            //    typeof(SMT.Saas.Tools.OrganizationWS.V_EMPLOYEEPOST[]), cols);

            //lookup.SelectedClick += (o, ev) =>
            //{
            //    SMT.Saas.Tools.OrganizationWS.V_EMPLOYEEPOST ent = lookup.SelectedObj as SMT.Saas.Tools.OrganizationWS.V_EMPLOYEEPOST; ;

            //    if (ent != null)
            //    {
            //        lkEmployeeName.DataContext = ent.T_HR_EMPLOYEE;
            //    }
            //};

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

            lookup.SelectedObjType = OrgTreeItemTypes.Personnel;
            lookup.SelectedClick += (obj, ev) =>
            {
                SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE ent = lookup.SelectedObj[0].ObjectInstance as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;

                if (ent != null)
                {
                    lkEmployeeName.DataContext = ent;
                }
            };

            lookup.Show<string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { });
        }
Пример #24
0
        private void LookUp_FindClick(object sender, EventArgs e)
        {
            OrganizationLookup lookup = new OrganizationLookup();

            lookup.SelectedObjType = OrgTreeItemTypes.Company;
            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)
                {
                    lkCompany.DataContext = ent;
                    Pension.COMPANYID = ent.COMPANYID;
                    pension.OWNERCOMPANYID = ent.COMPANYID;
                }
            };

            lookup.Show<string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { });
        }
Пример #25
0
        private void lkObject_FindClick(object sender, EventArgs e)
        {
            string userID = DataCore.CurrentUser.Value.ToString();
            string perm = ((int)Permissions.Browse).ToString();
            string entity = this.DefaultEntity.OrderType.Name;
            OrganizationLookup ogzLookup = new OrganizationLookup(userID, perm, entity);
            ogzLookup.MultiSelected = true;
            ogzLookup.SelectedObjType = OrgTreeItemTypes.All;


            FrameworkElement plRoot = CommonFunction.ParentLayoutRoot;

            ogzLookup.SelectedClick += (o, ev) =>
            {
                if (ogzLookup.SelectedObj.Count > 0)
                {
                    List<ExtOrgObj> list = new List<ExtOrgObj>();
                    string text = " ";

                    foreach (ExtOrgObj obj in ogzLookup.SelectedObj)
                    {
                        list.Add(obj);

                        text = text.Trim() + ";" + obj.ObjectName;

                    }
                    MultiValuesItem<ExtOrgObj> item = new MultiValuesItem<ExtOrgObj>();
                    item.Values = list;
                    item.Text = text.Substring(1);
                    lkObject.SelectItem = item;
                    lkObject.DataContext = item;
                    lkObject.DisplayMemberPath = "Text";

                    //lkObject.TxtLookUp.Text = text.Substring(1);
                }
            };
            ogzLookup.Show<string>(DialogMode.ApplicationModal, plRoot, "", (result) => { });
        }
Пример #26
0
        /// <summary>
        /// 选择员工
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void lkEmpName_FindClick(object sender, EventArgs e)
        {
            OrganizationLookup lookup = new OrganizationLookup();

            lookup.SelectedObjType = OrgTreeItemTypes.Personnel;
            lookup.SelectedClick += (obj, ev) =>
            {
                SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE ent = lookup.SelectedObj[0].ObjectInstance as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;
                if (ent != null)
                {
                    lkEmpName.DataContext = ent;
                }
            };

            lookup.Show<string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { });
        }
Пример #27
0
 private void PostsObject_FindClick(object sender, RoutedEventArgs e)
 {
     SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup lookup = new SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup();
     lookup.SelectedObjType = SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Department;
     lookup.SelectedClick += (obj, ev) =>
     {
         List<SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj> ent = lookup.SelectedObj as List<SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj>;
         if (ent != null && ent.Count > 0)
         {
             SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj companyInfo = ent.FirstOrDefault();
             PostsObject.Text = companyInfo.ObjectName;
             StrDepartmentID = companyInfo.ObjectID;
         }
     };
     lookup.MultiSelected = false;
     lookup.Show();
 }
Пример #28
0
        private void btnFindMember_Click(object sender, RoutedEventArgs e)
        {
            OrganizationLookup lookupmember = new OrganizationLookup();
            
            
            lookupmember.MultiSelected = true;
            lookupmember.SelectedObjType = SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Personnel;
            lookupmember.SelectedClick += (o, ev) =>
            {
                //SMT.SaaS.FrameworkUI.Common.OrganizationWS.T_HR_POST ent = lookupmember.SelectedObj[0].ObjectInstance as SMT.SaaS.FrameworkUI.Common.OrganizationWS.T_HR_POST;
                List<SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj> ent = lookupmember.SelectedObj as List<SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj>;
                if (ent != null)
                {
                    tmpMeetingMember = ent;
                    HandlePostChanged(ent);
                }
                else
                {
                    tmpMeetingMember = null;
                }

            };
           
            lookupmember.ShowDialog();
            //lookupmember.Show();
        }
Пример #29
0
        private void lkSelectObj_FindClick(object sender, EventArgs e)
        {

            string userID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
            string perm = (((int)FormTypes.Browse) + 1).ToString();   //zl 3.1
            //string entity = "MonthlyBudgetAnalysis";
            //OrganizationLookup ogzLookup = new OrganizationLookup(userID, perm, entity);
            OrganizationLookup ogzLookup = new OrganizationLookup();
            ogzLookup.MultiSelected = true;
            ogzLookup.SelectedObjType = OrgTreeItemTypes.Company;
            //ogzLookup.ShowMessageForSelectOrganization();

            ogzLookup.SelectedClick += (o, ev) =>
            {
                StrCompanyIDsList.Clear();
                List<ExtOrgObj> ent = ogzLookup.SelectedObj as List<ExtOrgObj>;
                if (ent.Count() == 0)
                {
                    return;
                }
                List<ExtOrgObj> entall = new List<ExtOrgObj>();
                if (ent != null && ent.Count > 0)
                {
                    //issuanceExtOrgObj = ent;
                    string StrCompanyName = "";
                    foreach (var h in ent)
                    {
                        if (h.ObjectType == SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Company)//公司
                        {
                            StrCompanyIDsList.Add(h.ObjectID);
                            //先添加总公司
                            ExtOrgObj obj2 = new ExtOrgObj();
                            obj2.ObjectID = h.ObjectID;
                            obj2.ObjectName = h.ObjectName;
                            obj2.ObjectType = SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Company;
                            entall.Add(obj2);
                            lkSelectObj.DataContext = (SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY)h.ObjectInstance;
                            lkSelectObj.DisplayMemberPath = "CNAME";
                            StrCompanyName += h.ObjectName + ",";                            

                        }
                    }
                    if (!string.IsNullOrEmpty(StrCompanyName))
                    {
                        StrCompanyName = StrCompanyName.Substring(0,StrCompanyName.Length-1);
                    }
                    ToolTipService.SetToolTip(lkSelectObj.TxtLookUp,StrCompanyName);

                }
            };

            ogzLookup.Show<string>(DialogMode.ApplicationModal, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { }, true, userID);
                
            
        }
Пример #30
0
        private void LookUp_FindClick(object sender, EventArgs e)
        {
            try
            {
                #region
                //Dictionary<string, string> cols = new Dictionary<string, string>();
                //cols.Add("EMPLOYEECODE", "T_HR_EMPLOYEE.EMPLOYEECODE");
                //cols.Add("EMPLOYEECNAME", "T_HR_EMPLOYEE.EMPLOYEECNAME");
                //cols.Add("EMPLOYEEENAME", "T_HR_EMPLOYEE.EMPLOYEEENAME");
                //LookupForm lookup = new LookupForm(SMT.Saas.Tools.OrganizationWS.EntityNames.Employee,
                //    typeof(SMT.Saas.Tools.OrganizationWS.V_EMPLOYEEPOST[]), cols);

                //lookup.SelectedClick += (o, ev) =>
                //{
                //    SMT.Saas.Tools.OrganizationWS.V_EMPLOYEEPOST ent = lookup.SelectedObj as SMT.Saas.Tools.OrganizationWS.V_EMPLOYEEPOST;

                //    if (ent != null)
                //    {
                //        lkEmployeeName.DataContext = ent.T_HR_EMPLOYEE;
                //    }
                //};

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

                lookup.SelectedObjType = OrgTreeItemTypes.Personnel;
                lookup.SelectedClick += (obj, ev) =>
                {
                    SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE ent = lookup.SelectedObj[0].ObjectInstance as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;
                    DtBorrowMoney.ItemsSource = null;
                    if (ent != null)
                    {
                        employeePostSelcected = null;
                        lkEmployeeName.DataContext = ent;
                        client.GetPostsActivedByEmployeeIDAsync(ent.EMPLOYEEID);
                        //fbClient.GetLeavingUserAsync(LeftOffice.T_HR_EMPLOYEE.EMPLOYEEID);
                        GetEmployeeViewsPaging();
                        RefreshUI(RefreshedTypes.HideProgressBar);
                    }

                };

                lookup.Show<string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { });
            }
            catch (Exception ex)
            {
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("请正确选择员工"),
                 Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
            }
        }
Пример #31
0
        private void lkOrg_FindClick(object sender, EventArgs e)
        {
            string userID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
            string perm = (((int)FormTypes.Browse) + 1).ToString();   //zl 3.1
            string entity = "MonthlyBudgetAnalysis";
            OrganizationLookup ogzLookup = new OrganizationLookup(userID, perm, entity);
            ogzLookup.MultiSelected = false;
            ogzLookup.SelectedObjType = OrgTreeItemTypes.All;
            ogzLookup.ShowMessageForSelectOrganization();

            ogzLookup.SelectedClick += (o, ev) =>
            {
                ExtOrgObj objSel = ogzLookup.SelectedObj.FirstOrDefault();
                if (objSel.ObjectInstance == null)
                {
                    return;
                }

                int iTempOrgType = -1;
                switch (objSel.ObjectType)
                {
                    case OrgTreeItemTypes.Company:
                        lkOrg.DataContext = (SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY)objSel.ObjectInstance;
                        lkOrg.DisplayMemberPath = "CNAME";
                        strOrgType = "COMPANY";
                        strOrgId = objSel.ObjectID;
                        iTempOrgType = OrgTreeItemTypes.Company.ToInt32();
                        break;
                    case OrgTreeItemTypes.Department:
                        lkOrg.DataContext = (SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT)objSel.ObjectInstance;
                        lkOrg.DisplayMemberPath = "T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME";
                        strOrgType = "DEPARTMENT";
                        strOrgId = objSel.ObjectID;
                        iTempOrgType = OrgTreeItemTypes.Department.ToInt32();
                        break;
                    case OrgTreeItemTypes.Post:
                        lkOrg.DataContext = (SMT.Saas.Tools.OrganizationWS.T_HR_POST)objSel.ObjectInstance;
                        lkOrg.DisplayMemberPath = "T_HR_POSTDICTIONARY.POSTNAME";
                        strOrgType = "POST";
                        strOrgId = objSel.ObjectID;
                        iTempOrgType = OrgTreeItemTypes.Post.ToInt32();
                        break;
                    case OrgTreeItemTypes.Personnel:
                        lkOrg.DataContext = (SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE)objSel.ObjectInstance;
                        lkOrg.DisplayMemberPath = "EMPLOYEECNAME";
                        strOrgType = "PERSONNAL";
                        strOrgId = objSel.ObjectID;
                        iTempOrgType = OrgTreeItemTypes.Personnel.ToInt32();
                        break;
                }

                lkSubject.DataContext = null;
            };
            ogzLookup.Show<string>(DialogMode.ApplicationModal, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { }, true, userID);
        }
Пример #32
0
        //#region 打印按钮
        //void btnPrint_Click(object sender, RoutedEventArgs e)
        //{
        //    var obj = DaGr.SelectedItems;
        //    if (obj == null || obj.Count == 0)
        //    {
        //        ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("SELECTERROR", "PRINT"), Utility.GetResourceStr("CONFIRMBUTTON"), MessageIcon.Exclamation);
        //        return;
        //    }
        //    if (BorrowApply != null)
        //    {
        //        LoanBillReport DetailWin = new LoanBillReport(BorrowApply.BORROWAPPLYMASTERID);
        //        CommonReportsView browser = new CommonReportsView(null, DetailWin, DetailWin.view) { EntityEditor = DetailWin };
        //        browser.Show<string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { }, true, BorrowApply.BORROWAPPLYMASTERID);                
        //    }
        //    else
        //    {
        //        ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "PRINT"), Utility.GetResourceStr("CONFIRMBUTTON"));
        //        return;
        //    }
        //}
        //#endregion


        #region 申请人LookUp
        private void lkOrg_FindClick(object sender, EventArgs e)
        {
            SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup lookup = new SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup();
            lookup.SelectedObjType = SMT.SaaS.FrameworkUI.OrgTreeItemTypes.All;
            lookup.MultiSelected = false;
            lookup.SelectedClick += (o, ev) =>
            {
                if (lookup.SelectedObj.Count > 0)
                {
                    List<ExtOrgObj> list = new List<ExtOrgObj>();
                    string text = " ";

                    foreach (ExtOrgObj obj in lookup.SelectedObj)
                    {
                        list.Add(obj);

                        text = text.Trim() + ";" + obj.ObjectName;

                    }
                    SMT.FBAnalysis.UI.CommonTools.MultiValuesItem<ExtOrgObj> item = new SMT.FBAnalysis.UI.CommonTools.MultiValuesItem<ExtOrgObj>();
                    item.Values = list;
                    item.Text = text.Substring(1);
                    //item.Text = text.Substring(text.LastIndexOf(";")+1);
                    lkOrg.SelectItem = item;
                    lkOrg.DataContext = item;
                    lkOrg.DisplayMemberPath = "Text";
                }
            };
            lookup.Show<string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { }, true, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID);
        }
Пример #33
0
        void dGrid_ToolBarItemClick(object sender, ToolBarItemClickEventArgs e)
        {
            if (e.Action != Actions.Add)
            {
                return;
            }
            e.Action = Actions.Cancel;
            string perm = "3";
            string entity = typeof(T_FB_PERSONMONEYASSIGNMASTER).Name;
            if (this.EditForm.OperationType == OperationTypes.Edit)
            {
                perm = ((int)Permissions.Edit).ToString();
            }
            else if (this.EditForm.OperationType == OperationTypes.Add)
            {
                perm = ((int)Permissions.Add).ToString();
            }
            else
            {
                perm = ((int)Permissions.Browse).ToString();
            }

            string userID = DataCore.CurrentUser.Value.ToString();
            OrganizationLookup ogzLookup = new OrganizationLookup(userID, perm, entity);

            ogzLookup.SelectedObjType = OrgTreeItemTypes.Company;

            FrameworkElement plRoot = CommonFunction.ParentLayoutRoot;

            ogzLookup.SelectedClick += (o, ea) =>
            {
                if (ogzLookup.SelectedObj.Count > 0)
                {
                    var assignDetail = this.OrderEntity.GetRelationFBEntities(typeof(T_FB_SUMSETTINGSDETAIL).Name);
                    var selectedObjects = ogzLookup.SelectedObj;
                    selectedObjects.ForEach(obj =>
                        {
                            ITextValueItem cdata = DataCore.FindReferencedData<CompanyData>(obj.ObjectID);
                                                       
                            T_FB_SUMSETTINGSDETAIL detail = new T_FB_SUMSETTINGSDETAIL();
                            detail.SUMSETTINGSDETAILID = Guid.NewGuid().ToString();
                            detail.T_FB_SUMSETTINGSMASTER = this.OrderEntity.Entity as T_FB_SUMSETTINGSMASTER;
                            detail.EDITSTATES =1;
                            detail.OWNERCOMPANYID = cdata.Value.ToString();
                            detail.OWNERCOMPANYNAME = cdata.Text;
                            detail.CREATEDATE = DateTime.Now;
                            detail.CREATEUSERID = DataCore.CurrentUser.ID.ToString();
                            detail.CREATEUSERNAME = DataCore.CurrentUser.Text.ToString();

                            FBEntity fbEntity = detail.ToFBEntity();
                            fbEntity.FBEntityState = FBEntityState.Added;
                            assignDetail.Add(fbEntity);
                        });

                }
            };
            ogzLookup.Show<string>(DialogMode.ApplicationModal, plRoot, "", (result) => { });
        }
Пример #34
0
        /// <summary>
        /// 选择员工
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void LookUp_FindClick(object sender, EventArgs e)
        {
            //Dictionary<string, string> cols = new Dictionary<string, string>();
            //cols.Add("EMPLOYEECODE", "T_HR_EMPLOYEE.EMPLOYEECODE");
            //cols.Add("EMPLOYEECNAME", "T_HR_EMPLOYEE.EMPLOYEECNAME");
            //cols.Add("EMPLOYEEENAME", "T_HR_EMPLOYEE.EMPLOYEEENAME");
            //LookupForm lookup = new LookupForm(SMT.Saas.Tools.OrganizationWS.EntityNames.Employee,
            //    typeof(SMT.Saas.Tools.OrganizationWS.V_EMPLOYEEPOST[]), cols);

            //lookup.SelectedClick += (o, ev) =>
            //{
            //    SMT.Saas.Tools.OrganizationWS.V_EMPLOYEEPOST ent = lookup.SelectedObj as SMT.Saas.Tools.OrganizationWS.V_EMPLOYEEPOST; ;

            //    if (ent != null)
            //    {
            //        lkEmployeeName.DataContext = ent.T_HR_EMPLOYEE;
            //    }
            //};

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

            lookup.SelectedObjType = OrgTreeItemTypes.Personnel;
            lookup.SelectedClick += (obj, ev) =>
            {
                SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE ent = lookup.SelectedObj[0].ObjectInstance as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;

                if (ent != null)
                {
                    lkEmployeeName.DataContext = ent;
                    //  SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE temp = lkEmployeeName.DataContext as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;
                    T_HR_EMPLOYEE entity = new T_HR_EMPLOYEE();
                    entity.EMPLOYEEID = ent.EMPLOYEEID;
                    entity.EMPLOYEECNAME = ent.EMPLOYEECNAME;
                    entity.OWNERPOSTID = ent.OWNERPOSTID;
                    entity.OWNERDEPARTMENTID = ent.OWNERDEPARTMENTID;
                    entity.OWNERCOMPANYID = ent.OWNERCOMPANYID;

                    PensionMaster.OWNERCOMPANYID = ent.OWNERCOMPANYID;
                    PensionMaster.OWNERDEPARTMENTID = ent.OWNERDEPARTMENTID;
                    PensionMaster.OWNERPOSTID = ent.OWNERPOSTID;
                    PensionMaster.OWNERID = ent.EMPLOYEEID; //ent.OWNERID; ownerid为空 改成employeeid
                    PensionMaster.T_HR_EMPLOYEE = entity;
                }
            };

            lookup.Show<string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { });
        }
Пример #35
0
 /// <summary>
 /// 添加发布对象
 /// </summary>
 private void AddIssuanObj()
 {
     SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup lookup = new SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup();
     lookup.SelectedObjType = SMT.SaaS.FrameworkUI.OrgTreeItemTypes.All;
     lookup.SelectedClick += (obj, ev) =>
     {
         List<ExtOrgObj> ent = lookup.SelectedObj as List<ExtOrgObj>;
         if (ent != null && ent.Count > 0)
         {
             issuanceExtOrgObj = ent;
             BindData();
         }
     };
     lookup.MultiSelected = true;
     lookup.SelectSameGradeOnly = true;
     lookup.Show();
 }
Пример #36
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;
            }

            OrganizationLookup lookup = new OrganizationLookup();
            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;
                lookup.MultiSelected = true;
            }
            else if (entDic.DICTIONARYVALUE.ToString() == (Convert.ToInt32(AssignedObjectType.Post) + 1).ToString())
            {
                lookup.SelectedObjType = OrgTreeItemTypes.Post;
            }
            else if (entDic.DICTIONARYVALUE.ToString() == (Convert.ToInt32(AssignedObjectType.Personnel) + 1).ToString())
            {
                lookup.SelectedObjType = OrgTreeItemTypes.Personnel;
                lookup.MultiSelected = true;
            }

            lookup.SelectedClick += (obj, ev) =>
            {
                List<ExtOrgObj> ents = lookup.SelectedObj as List<ExtOrgObj>;
                if (ents == null)
                {
                    return;
                }

                if (ents.Count() == 0)
                {
                    return;
                }
               
                txtErrorMsg.Text = string.Empty;
                string strCheckCompanyId = string.Empty;

                if (lookup.SelectedObjType == OrgTreeItemTypes.Company)
                {
                    SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY ent = lookup.SelectedObj[0].ObjectInstance as SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY;
                    if (ent != null)
                    {
                        lkAssignObject.DataContext = ent;
                        lkAssignObject.DisplayMemberPath = "CNAME";

                        tbAssignedObjectID.Text = ent.COMPANYID;
                        entAttendanceSolutionAsign.ASSIGNEDOBJECTTYPE = (Convert.ToInt32(AssignedObjectType.Company) + 1).ToString();
                        entAttendanceSolutionAsign.ASSIGNEDOBJECTID = ent.COMPANYID;

                        SetRecordOwner(ent.COMPANYID);
                    }
                }
                else if (lookup.SelectedObjType == OrgTreeItemTypes.Department)
                {
                    SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT ent = lookup.SelectedObj[0].ObjectInstance as SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT;
                    if (ent != null)
                    {
                        //lkAssignObject.DataContext = ent;
                        //lkAssignObject.DisplayMemberPath = "T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME";
                        //tbAssignedObjectID.Text = ent.DEPARTMENTID;

                        //entAttendanceSolutionAsign.ASSIGNEDOBJECTTYPE = (Convert.ToInt32(AssignedObjectType.Department) + 1).ToString();
                        //entAttendanceSolutionAsign.ASSIGNEDOBJECTID = ent.DEPARTMENTID;

                        //SetRecordOwner(ent.T_HR_COMPANY.COMPANYID);
                        CheckSelectedIsSameCompany(ents);
                    }
                }
                else if (lookup.SelectedObjType == OrgTreeItemTypes.Post)
                {
                    SMT.Saas.Tools.OrganizationWS.T_HR_POST ent = lookup.SelectedObj[0].ObjectInstance as SMT.Saas.Tools.OrganizationWS.T_HR_POST;
                    if (ent != null)
                    {
                        lkAssignObject.DataContext = ent;
                        lkAssignObject.DisplayMemberPath = "T_HR_POSTDICTIONARY.POSTNAME";
                        tbAssignedObjectID.Text = ent.POSTID;

                        entAttendanceSolutionAsign.ASSIGNEDOBJECTTYPE = (Convert.ToInt32(AssignedObjectType.Post) + 1).ToString();
                        entAttendanceSolutionAsign.ASSIGNEDOBJECTID = ent.POSTID;

                        SetRecordOwner(ent.T_HR_DEPARTMENT.T_HR_COMPANY.COMPANYID);
                        
                    }
                }
                else if (lookup.SelectedObjType == OrgTreeItemTypes.Personnel)
                {
                    SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE ent = lookup.SelectedObj[0].ObjectInstance as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;
                    if (ent == null)
                    {
                        return;
                    }
                    CheckSelectedObj(ents);
                    
                }
                
            };

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