Пример #1
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
        }
Пример #2
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();
        }
Пример #3
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.SelectedClick  += (obj, ev) =>
            {
                //  SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE ent = lookup.SelectedObj[0].ObjectInstance as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;
                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;
                    //  fromPostLevel=(post as SMT.Saas.Tools.OrganizationWS.T_HR_POST).POSTLEVEL.ToString();

                    ExtOrgObj dept   = (ExtOrgObj)post.ParentObject;
                    string    deptid = dept.ObjectID;

                    // ExtOrgObj corp = (ExtOrgObj)dept.ParentObject;
                    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;
                }
            };

            lookup.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { });
            #endregion
        }
Пример #4
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);
        }
Пример #5
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) => { });
        }
Пример #6
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);
        }
Пример #7
0
        /// <summary>
        /// 选择员工
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void LookUp_FindClick(object sender, EventArgs e)
        {
            OrganizationLookup lookup = new 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 userInfo = ent.FirstOrDefault();

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

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

                    SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE emp = userInfo.ObjectInstance as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;
                    empId = emp.EMPLOYEEID;
                    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);
                }
            };

            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 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) => { });
        }
Пример #9
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) => { });
        }
Пример #10
0
        void SelectView()//获取发布对象
        {
            OrganizationLookup lookup = new OrganizationLookup();

            lookup.SelectedObjType = SMT.SaaS.FrameworkUI.OrgTreeItemTypes.All;
            lookup.SelectedClick  += (obj, sender) =>
            {
                List <ExtOrgObj> ent = lookup.SelectedObj as List <ExtOrgObj>;
                if (ent != null && ent.Count > 0)
                {
                    lookupObjectList = ent;
                    BindingDataGrid();
                }
            };
            lookup.MultiSelected       = true;
            lookup.SelectSameGradeOnly = true;
            lookup.Show();
        }
Пример #11
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) => { });
        }
Пример #12
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) => { });
        }
Пример #13
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) => { });
        }
Пример #14
0
        /// <summary>
        /// 设定计算薪资的岗位
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void lkBalancePost_FindClick(object sender, EventArgs e)
        {
            OrganizationLookup lookup = new OrganizationLookup();

            lookup.SelectedObjType = OrgTreeItemTypes.Post;
            lookup.MultiSelected   = false;
            lookup.SelectedClick  += (obj, ev) =>
            {
                List <ExtOrgObj> ent = lookup.SelectedObj as List <ExtOrgObj>;
                if (ent != null)
                {
                    SMT.Saas.Tools.OrganizationWS.T_HR_POST post = ent[0].ObjectInstance as SMT.Saas.Tools.OrganizationWS.T_HR_POST;
                    lkBalancePost.DataContext = post;
                    string strPostInfoName = string.Empty;
                    if (post != null)
                    {
                        if (post.T_HR_POSTDICTIONARY != null)
                        {
                            strPostInfoName = post.T_HR_POSTDICTIONARY.POSTNAME;
                        }

                        if (post.T_HR_DEPARTMENT != null)
                        {
                            if (post.T_HR_DEPARTMENT.T_HR_DEPARTMENTDICTIONARY != null)
                            {
                                strPostInfoName = strPostInfoName + " - " + post.T_HR_DEPARTMENT.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME + " - " + post.T_HR_DEPARTMENT.T_HR_COMPANY.CNAME;

                                if (post.T_HR_DEPARTMENT.T_HR_COMPANY != null)
                                {
                                    strPostInfoName = strPostInfoName + " - " + post.T_HR_DEPARTMENT.T_HR_COMPANY.CNAME;
                                }
                            }
                        }
                    }
                    lkBalancePost.TxtLookUp.Text = strPostInfoName;
                    entAttendanceSolution.AUTOLEFTOFFICERECEIVEPOST = post.POSTID;
                    entAttendanceSolution.LEFTOFFICERECEIVEPOSTNAME = strPostInfoName;
                    //SalaryArchive.BALANCEPOSTNAME = strPostInfoName;
                }
            };

            lookup.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { });
        }
        /// <summary>
        /// 获取发布对象,弹出组织架构窗体
        /// </summary>
        void SelectView()
        {
            OrganizationLookup lookup = new 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 < 1)
                {
                    ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("GETDATAFAILED"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                    return;
                }
                lookupObjectList = ent;
                BindingDataGrid();
            };
            lookup.MultiSelected       = true;
            lookup.SelectSameGradeOnly = true;
            lookup.Show();
        }
Пример #16
0
        /// <summary>
        /// 组织架构选择
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void lkOrg_FindClick(object sender, EventArgs e)
        {
            OrganizationLookup lookup = new OrganizationLookup();

            lookup.MultiSelected   = true;
            lookup.SelectedObjType = OrgTreeItemTypes.All;
            lookup.ShowMessageForSelectOrganization();

            lookup.SelectedClick += (obj, ev) =>
            {
                List <ExtOrgObj> entList = lookup.SelectedObj as List <ExtOrgObj>;

                var se = new OrgSelectEntity(entList);

                lkOrg.DataContext       = se;
                lkOrg.DisplayMemberPath = "Text";
                var iTempOrgType = (int)se.SelectedOrgType;
                if (iTempOrgType == 0 || iTempOrgType == 1)
                {
                    dgQueryResult.Visibility    = System.Windows.Visibility.Visible;
                    dgPerQueryResult.Visibility = System.Windows.Visibility.Collapsed;
                }
                else if (iTempOrgType == 2 || iTempOrgType == 3)
                {
                    dgQueryResult.Visibility    = System.Windows.Visibility.Collapsed;
                    dgPerQueryResult.Visibility = System.Windows.Visibility.Visible;
                }
                else
                {
                    dgQueryResult.Visibility    = System.Windows.Visibility.Visible;
                    dgPerQueryResult.Visibility = System.Windows.Visibility.Collapsed;
                }

                lkSubject.DataContext = null;
                if (dataPager.PageIndex != 1)
                {
                    dataPager.PageIndex = 1;
                }
            };
            lookup.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { });
        }
Пример #17
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) => { });
        }
        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);
        }
Пример #19
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) =>
            {
                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;
                    EmployeePost = ent.T_HR_EMPLOYEEPOST.Where(t => t.ISAGENCY == "0").FirstOrDefault();
                    client.GetEmployeeEntryByEmployeeIDAsync(ent.EMPLOYEEID);
                }
            };

            lookup.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { });
        }
Пример #20
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) => { });
        }
Пример #21
0
        public void InitOrgObjectData()
        {
            string perm   = "3";
            string entity = ReferencedDataInfo.OrderInfo.Type;

            if (OperationType == OperationTypes.Edit)
            {
                perm = ((int)Permissions.Edit).ToString();
            }
            else if (OperationType == OperationTypes.Add)
            {
                perm = ((int)Permissions.Add).ToString();
            }
            else
            {
                perm = ((int)Permissions.Browse).ToString();
            }

            string userID = DataCore.CurrentUser.Value.ToString();
            //             BF06E969-1B2C-4a89-B0AE-A91CA1244053
            OrganizationLookup ogzLookup = new OrganizationLookup(userID, perm, entity);

            ogzLookup.SelectedObjType = OrgTreeItemTypes.Company;

            FrameworkElement plRoot = CommonFunction.ParentLayoutRoot;

            ogzLookup.SelectedClick += (o, e) =>
            {
                if (ogzLookup.SelectedObj.Count > 0)
                {
                    ITextValueItem item = null;

                    var sItem = ogzLookup.SelectedObj[0];

                    //下拨公司只能是公司,其他机构类型都不可以
                    if (sItem.ObjectType == OrgTreeItemTypes.Company)
                    {
                        string         id    = sItem.ObjectID;
                        ITextValueItem cdata = DataCore.FindReferencedData <CompanyData>(id);
                        item = cdata;
                    }

                    #region 废弃代码
                    //if (sItem.ObjectType == OrgTreeItemTypes.Personnel)
                    //{
                    //    EmployeerData eData = new EmployeerData();
                    //    eData.Value = sItem.ObjectID;
                    //    eData.Text = sItem.ObjectName;
                    //    ExtOrgObj post = sItem.ParentObject as ExtOrgObj;
                    //    ExtOrgObj dept = post.ParentObject as ExtOrgObj;

                    //    // ExtOrgObj com = dept.ParentObject as ExtOrgObj;
                    //    ITextValueItem pdata = DataCore.FindReferencedData<PostData>(post.ObjectID);
                    //    ITextValueItem ddata = DataCore.FindReferencedData<DepartmentData>(dept.ObjectID);
                    //    ITextValueItem cdata = (ddata as DepartmentData).Company;

                    //    eData.Company = cdata as CompanyData;
                    //    eData.Department = ddata as DepartmentData;
                    //    eData.Post = pdata as PostData;
                    //    item = eData;
                    //}
                    //else if (sItem.ObjectType == OrgTreeItemTypes.Department)
                    //{
                    //    string id = sItem.ObjectID;
                    //    item = DataCore.FindReferencedData<DepartmentData>(id);
                    //}
                    #endregion 废弃代码


                    MyOrgObjectData sValue = null;
                    if (item != null)
                    {
                        sValue = new MyOrgObjectData {
                            OrgObject = item as OrgObjectData
                        };
                    }
                    this.SelectItem = sValue;
                }
            };
            ogzLookup.Show <string>(DialogMode.ApplicationModal, plRoot, "", (result) => { });
        }
Пример #22
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 + 1).ToString();
            }
            else
            {
                perm = ((int)Permissions.Browse).ToString();
            }

            string userID = DataCore.CurrentUser.Value.ToString();
            //             BF06E969-1B2C-4a89-B0AE-A91CA1244053
            OrganizationLookup ogzLookup = new OrganizationLookup();

            ogzLookup.SelectedObjType = OrgTreeItemTypes.Personnel;
            ogzLookup.MultiSelected   = true;

            FrameworkElement plRoot = CommonFunction.ParentLayoutRoot;

            try
            {
                ogzLookup.SelectedClick += (o, ea) =>
                {
                    if (ogzLookup.SelectedObj.Count > 0)
                    {
                        //处理岗位及下拨
                        SMT.Saas.Tools.PersonnelWS.PersonnelServiceClient pe = new SMT.Saas.Tools.PersonnelWS.PersonnelServiceClient();
                        ObservableCollection <SMT.Saas.Tools.PersonnelWS.V_EMPLOYEEFUNDS> vlistpostinfo = new ObservableCollection <SMT.Saas.Tools.PersonnelWS.V_EMPLOYEEFUNDS>();

                        var assignDetail = this.OrderEntity.GetRelationFBEntities(typeof(T_FB_PERSONMONEYASSIGNDETAIL).Name);

                        var selectedObjects = ogzLookup.SelectedObj;
                        selectedObjects.ForEach(obj =>
                        {
                            ExtOrgObj post = obj.ParentObject as ExtOrgObj;
                            ExtOrgObj dept = post.ParentObject as ExtOrgObj;

                            // ExtOrgObj com = dept.ParentObject as ExtOrgObj;
                            ITextValueItem pdata = DataCore.FindReferencedData <PostData>(post.ObjectID);
                            ITextValueItem ddata = DataCore.FindReferencedData <DepartmentData>(dept.ObjectID);
                            ITextValueItem cdata = (ddata as DepartmentData).Company;

                            var existDetail = assignDetail.FirstOrDefault(item =>
                            {
                                T_FB_PERSONMONEYASSIGNDETAIL cd = item.Entity as T_FB_PERSONMONEYASSIGNDETAIL;
                                return(cd.OWNERID == obj.ObjectID && cd.OWNERPOSTID == pdata.Value.ToString());
                            });

                            T_FB_PERSONMONEYASSIGNDETAIL detail = new T_FB_PERSONMONEYASSIGNDETAIL();
                            if (existDetail != null)
                            {
                                detail.PERSONBUDGETAPPLYDETAILID    = (existDetail.Entity as T_FB_PERSONMONEYASSIGNDETAIL).PERSONBUDGETAPPLYDETAILID;
                                detail.T_FB_PERSONMONEYASSIGNMASTER = this.OrderEntity.Entity as T_FB_PERSONMONEYASSIGNMASTER;
                            }
                            else
                            {
                                detail.PERSONBUDGETAPPLYDETAILID    = Guid.NewGuid().ToString();
                                detail.T_FB_PERSONMONEYASSIGNMASTER = this.OrderEntity.Entity as T_FB_PERSONMONEYASSIGNMASTER;
                                detail.BUDGETMONEY = 0;
                            }

                            // start 添加岗位级别,用于排序
                            var employee1 = obj.ObjectInstance as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;
                            if (employee1 != null)
                            {
                                var ep = employee1.T_HR_EMPLOYEEPOST.FirstOrDefault();
                                if (ep != null)
                                {
                                    detail.POSTLEVEL = ep.POSTLEVEL;
                                }
                            }


                            // end

                            detail.OWNERID             = obj.ObjectID;
                            detail.OWNERNAME           = obj.ObjectName;
                            detail.OWNERPOSTID         = pdata.Value.ToString();
                            detail.OWNERPOSTNAME       = pdata.Text;
                            detail.OWNERDEPARTMENTID   = ddata.Value.ToString();
                            detail.OWNERDEPARTMENTNAME = ddata.Text;
                            detail.OWNERCOMPANYID      = cdata.Value.ToString();
                            detail.OWNERCOMPANYNAME    = cdata.Text;

                            //SMT.Saas.Tools.PersonnelWS.V_EMPLOYEEPOSTFORFB vpostinfo = new SMT.Saas.Tools.PersonnelWS.V_EMPLOYEEPOSTFORFB();
                            //vpostinfo.PERSONBUDGETAPPLYDETAILID = detail.PERSONBUDGETAPPLYDETAILID;
                            //vpostinfo.OWNERID = detail.OWNERID;
                            //vpostinfo.OWNERPOSTID = detail.OWNERPOSTID;
                            //vlistpostinfo.Add(vpostinfo);

                            SMT.Saas.Tools.PersonnelWS.V_EMPLOYEEFUNDS vpostinfo = new SMT.Saas.Tools.PersonnelWS.V_EMPLOYEEFUNDS();

                            vpostinfo.EMPLOYEEID = detail.OWNERID;
                            vpostinfo.POSTID     = detail.OWNERPOSTID;
                            vpostinfo.COMPANYID  = detail.OWNERCOMPANYID;
                            vlistpostinfo.Add(vpostinfo);

                            if (existDetail != null)
                            {
                                return;
                            }
                            else
                            {
                                FBEntity fbEntity      = detail.ToFBEntity();
                                fbEntity.FBEntityState = FBEntityState.Added;
                                assignDetail.Add(fbEntity);
                            }
                        });
                        if (vlistpostinfo != null && vlistpostinfo.Count > 0)
                        {
                            this.ShowProcess();
                            pe.GetEmployeeFundsListCompleted += new EventHandler <Saas.Tools.PersonnelWS.GetEmployeeFundsListCompletedEventArgs>(pe_GetEmployeeFundsListCompleted);
                            pe.GetEmployeeFundsListAsync(vlistpostinfo);
                        }
                    }
                };
                ogzLookup.Show <string>(DialogMode.ApplicationModal, plRoot, "", (result) => { });
            }
            catch (Exception ex)
            {
                CommonFunction.ShowErrorMessage("调用HR服务返回异常信息:" + ex.ToString());
            }
        }
Пример #23
0
        /// <summary>
        /// 选择机构
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void lkObject_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    = "ContactDetailsView";
            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:
                    lkObject.DataContext       = (SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY)objSel.ObjectInstance;
                    lkObject.DisplayMemberPath = "CNAME";
                    strOrgType   = "COMPANY";
                    strOrgId     = objSel.ObjectID;
                    dpStart.Text = "1900-1-1";
                    iTempOrgType = OrgTreeItemTypes.Company.ToInt32();
                    break;

                case OrgTreeItemTypes.Department:
                    lkObject.DataContext       = (SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT)objSel.ObjectInstance;
                    lkObject.DisplayMemberPath = "T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME";
                    strOrgType   = "DEPARTMENT";
                    strOrgId     = objSel.ObjectID;
                    dpStart.Text = "1900-1-1";
                    iTempOrgType = OrgTreeItemTypes.Department.ToInt32();
                    break;

                case OrgTreeItemTypes.Post:
                    lkObject.DataContext       = (SMT.Saas.Tools.OrganizationWS.T_HR_POST)objSel.ObjectInstance;
                    lkObject.DisplayMemberPath = "T_HR_POSTDICTIONARY.POSTNAME";
                    strOrgType   = "POST";
                    strOrgId     = objSel.ObjectID;
                    dpStart.Text = DateTime.Now.Year.ToString() + "-1-1";
                    iTempOrgType = OrgTreeItemTypes.Post.ToInt32();
                    break;

                case OrgTreeItemTypes.Personnel:
                    lkObject.DataContext       = (SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE)objSel.ObjectInstance;
                    lkObject.DisplayMemberPath = "EMPLOYEECNAME";
                    strOrgType   = "PERSONAL";
                    strOrgId     = objSel.ObjectID;
                    dpStart.Text = DateTime.Now.Year.ToString() + "-1-1";
                    iTempOrgType = OrgTreeItemTypes.Personnel.ToInt32();
                    break;
                }

                if (lkObject.DataContext != null)
                {
                    if (iTempOrgType == 0 || iTempOrgType == 1)
                    {
                        dgDeptQueryResult.Visibility      = System.Windows.Visibility.Visible;
                        spDeptTotalBorrowMoney.Visibility = System.Windows.Visibility.Visible;

                        tbStartTitle.Visibility        = System.Windows.Visibility.Collapsed;
                        dpStart.Visibility             = System.Windows.Visibility.Collapsed;
                        tbEndTitle.Visibility          = System.Windows.Visibility.Collapsed;
                        dgPersQueryResult.Visibility   = System.Windows.Visibility.Collapsed;
                        spPersBeforeAccount.Visibility = System.Windows.Visibility.Collapsed;
                        spPersAfterAccount.Visibility  = System.Windows.Visibility.Collapsed;
                    }
                    else if (iTempOrgType == 2 || iTempOrgType == 3)
                    {
                        dgDeptQueryResult.Visibility      = System.Windows.Visibility.Collapsed;
                        spDeptTotalBorrowMoney.Visibility = System.Windows.Visibility.Collapsed;

                        tbStartTitle.Visibility        = System.Windows.Visibility.Visible;
                        dpStart.Visibility             = System.Windows.Visibility.Visible;
                        tbEndTitle.Visibility          = System.Windows.Visibility.Visible;
                        dgPersQueryResult.Visibility   = System.Windows.Visibility.Visible;
                        dgPersQueryResult.Visibility   = System.Windows.Visibility.Visible;
                        spPersBeforeAccount.Visibility = System.Windows.Visibility.Visible;
                        spPersAfterAccount.Visibility  = System.Windows.Visibility.Visible;
                    }
                    else
                    {
                        dgDeptQueryResult.Visibility      = System.Windows.Visibility.Visible;
                        spDeptTotalBorrowMoney.Visibility = System.Windows.Visibility.Visible;

                        tbStartTitle.Visibility        = System.Windows.Visibility.Collapsed;
                        dpStart.Visibility             = System.Windows.Visibility.Collapsed;
                        tbEndTitle.Visibility          = System.Windows.Visibility.Collapsed;
                        dgPersQueryResult.Visibility   = System.Windows.Visibility.Collapsed;
                        spPersBeforeAccount.Visibility = System.Windows.Visibility.Collapsed;
                        spPersAfterAccount.Visibility  = System.Windows.Visibility.Collapsed;
                    }

                    if (dataPager.PageIndex != 1)
                    {
                        dataPager.PageIndex = 1;
                    }
                }
            };
            ogzLookup.Show <string>(DialogMode.ApplicationModal, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { }, true, userID);
        }
Пример #24
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) => { });
        }
Пример #25
0
        public void InitOrganization()
        {
            string perm   = "3";
            string entity = ReferencedDataInfo.OrderInfo.Type;

            if (OperationType == OperationTypes.Edit)
            {
                perm = ((int)Permissions.Edit).ToString();
            }
            else if (OperationType == OperationTypes.Add)
            {
                perm = ((int)Permissions.Add).ToString();
            }
            else
            {
                perm = ((int)Permissions.Browse).ToString();
            }

            string userID = DataCore.CurrentUser.Value.ToString();
            //             BF06E969-1B2C-4a89-B0AE-A91CA1244053
            OrganizationLookup ogzLookup = new OrganizationLookup(userID, perm, entity);

            if (ReferencedDataInfo.Type == typeof(CompanyData).Name)
            {
                ogzLookup.SelectedObjType = OrgTreeItemTypes.Company;
            }
            else if (ReferencedDataInfo.Type == typeof(EmployeerData).Name)
            {
                ogzLookup.SelectedObjType = OrgTreeItemTypes.Personnel;
            }
            else if (ReferencedDataInfo.Type == typeof(DepartmentData).Name)
            {
                ogzLookup.SelectedObjType = OrgTreeItemTypes.Department;
            }
            else if (ReferencedDataInfo.Type == typeof(OrgObjectData).Name)
            {
                ogzLookup.SelectedObjType = OrgTreeItemTypes.All;
            }

            FrameworkElement plRoot = CommonFunction.ParentLayoutRoot;

            ogzLookup.SelectedClick += (o, e) =>
            {
                if (ogzLookup.SelectedObj.Count > 0)
                {
                    ITextValueItem item = null;
                    string         id   = ogzLookup.SelectedObj[0].ObjectID;
                    if (ReferencedDataInfo.Type == typeof(EmployeerData).Name)
                    {
                        EmployeerData eData = new EmployeerData();
                        eData.Value = ogzLookup.SelectedObj[0].ObjectID;
                        eData.Text  = ogzLookup.SelectedObj[0].ObjectName;
                        ExtOrgObj post = ogzLookup.SelectedObj[0].ParentObject as ExtOrgObj;
                        ExtOrgObj dept = post.ParentObject as ExtOrgObj;

                        // ExtOrgObj com = dept.ParentObject as ExtOrgObj;
                        ITextValueItem pdata = DataCore.FindReferencedData <PostData>(post.ObjectID);
                        ITextValueItem ddata = DataCore.FindReferencedData <DepartmentData>(dept.ObjectID);
                        ITextValueItem cdata = (ddata as DepartmentData).Company;

                        eData.Company    = cdata as CompanyData;
                        eData.Department = ddata as DepartmentData;
                        eData.Post       = pdata as PostData;
                        item             = eData;
                    }
                    else
                    {
                        item = DataCore.FindRefData(ReferencedDataInfo.Type, id);
                    }
                    this.SelectItem = item;
                }
            };
            ogzLookup.Show <string>(DialogMode.ApplicationModal, plRoot, "", (result) => { });
        }