Пример #1
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);
        }
Пример #2
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) => { });
        }
Пример #3
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);
        }