Exemplo n.º 1
0
 public bool CompanyCancel(T_HR_COMPANY entity, ref string strMsg)
 {
     using (CompanyBLL bll = new CompanyBLL())
     {
         return(bll.CompanyCancel(entity, ref strMsg));
     }
 }
Exemplo n.º 2
0
 public void CompanyIndexUpdate(T_HR_COMPANY entity, ref string strMsg)
 {
     using (CompanyBLL bll = new CompanyBLL())
     {
         bll.CompanyIndexUpdate(entity, ref strMsg);
     }
 }
Exemplo n.º 3
0
        private void treeOrganization_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e)
        {
            Container.Children.Clear();
            TreeViewItem selectedItem = treeOrganization.SelectedItem as TreeViewItem;

            if (selectedItem == null)
            {
                loadbar.Stop();
                return;
            }
            IsTag = selectedItem.Tag.ToString();
            switch (IsTag)
            {
            case "Company":
                T_HR_COMPANY company = selectedItem.DataContext as T_HR_COMPANY;
                CompanyForm  orgForm = new CompanyForm(FormTypes.Browse, company.COMPANYID);
                Container.Children.Add(orgForm);
                break;

            case "Department":
                T_HR_DEPARTMENT department = selectedItem.DataContext as T_HR_DEPARTMENT;
                DepartmentForm  depForm    = new DepartmentForm(FormTypes.Browse, department.DEPARTMENTID);
                Container.Children.Add(depForm);
                break;

            case "Post":
                T_HR_POST post    = selectedItem.DataContext as T_HR_POST;
                PostForm  posForm = new PostForm(FormTypes.Browse, post.POSTID);
                Container.Children.Add(posForm);
                break;
            }
            loadbar.Stop();
        }
Exemplo n.º 4
0
        void client_GetCompanyActivedCompleted(object sender, GetCompanyActivedCompletedEventArgs e)
        {
            ObservableCollection <T_HR_COMPANY> cmp = new ObservableCollection <T_HR_COMPANY>();

            if (e.Error != null && e.Error.Message != "")
            {
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERRORINFO"),
                                               Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
            }
            else
            {
                // ComboBox cbxCompanyName = Utility.FindChildControl<ComboBox>(expander, "cbxCompanyName");
                AutoCompleteComboBox acbCompanyName = Utility.FindChildControl <AutoCompleteComboBox>(expander, "acbCompanyName");
                cmp = e.Result;
                T_HR_COMPANY all = new T_HR_COMPANY();
                all.COMPANYID = "companyID";
                all.CNAME     = Utility.GetResourceStr("ALL");
                if (cmp != null)
                {
                    cmp.Insert(0, all);
                }
                acbCompanyName.ItemsSource     = cmp;
                acbCompanyName.ValueMemberPath = "CNAME";
            }
        }
Exemplo n.º 5
0
        void btnAudit_Click(object sender, RoutedEventArgs e)
        {
            string       sType = string.Empty, sValue = string.Empty;
            TreeViewItem selectedItem = treeOrganization.SelectedItem as TreeViewItem;

            if (selectedItem != null)
            {
                string IsTag = selectedItem.Tag.ToString();
                switch (IsTag)
                {
                case "0":
                    T_HR_COMPANY company = selectedItem.DataContext as T_HR_COMPANY;
                    sType  = "Company";
                    sValue = company.COMPANYID;
                    break;

                case "1":
                    T_HR_DEPARTMENT department = selectedItem.DataContext as T_HR_DEPARTMENT;
                    sType  = "Department";
                    sValue = department.DEPARTMENTID;
                    break;

                case "2":
                    T_HR_POST post = selectedItem.DataContext as T_HR_POST;
                    sType  = "Post";
                    sValue = post.POSTID;
                    break;
                }
            }
        }
Exemplo n.º 6
0
        void client_GetTravleSolutionSetBySolutionIDCompleted(object sender, GetTravleSolutionSetBySolutionIDCompletedEventArgs e)
        {
            RefreshUI(RefreshedTypes.HideProgressBar);
            if (!e.Cancelled)
            {
                if (e.Error == null)
                {
                    if (e.Result.Count() > 0)
                    {
                        IsEdit = true;//z设置为修改
                        issuanceExtOrgObj.Clear();
                        ListSet = e.Result.ToList();
                        foreach (var h in ListSet)
                        {
                            object obj = new object();
                            SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj extOrgObj = new SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj();

                            T_HR_COMPANY tmp = new T_HR_COMPANY();
                            tmp.COMPANYID = h.COMPANYID;
                            tmp.CNAME     = Utility.GetCompanyName(tmp.COMPANYID);
                            obj           = tmp;


                            extOrgObj.ObjectInstance = obj;
                            issuanceExtOrgObj.Add(extOrgObj);
                        }
                        BindData();
                    }
                }
            }
        }
Exemplo n.º 7
0
        private void LoadData()
        {
            loadbar.Start();
            int    pageCount = 0;
            string filter    = "";
            string strState  = "";

            System.Collections.ObjectModel.ObservableCollection <object> paras = new System.Collections.ObjectModel.ObservableCollection <object>();

            if (Checkstate != Convert.ToInt32(CheckStates.All).ToString())
            {
                strState = Checkstate;
            }
            //根据部门过滤
            ComboBox cbxDepName = Utility.FindChildControl <ComboBox>(expander, "cbxDepName");

            if (cbxDepName != null)
            {
                if (cbxDepName.SelectedIndex > 0)
                {
                    T_HR_DEPARTMENT temp = cbxDepName.SelectedItem as T_HR_DEPARTMENT;
                    filter += "T_HR_DEPARTMENT.DEPARTMENTID==@" + paras.Count().ToString();
                    paras.Add(temp.DEPARTMENTID);
                }
            }
            //根据公司过滤
            ComboBox cbxCpyName = Utility.FindChildControl <ComboBox>(expander, "cbxCpyName");

            if (cbxCpyName != null)
            {
                if (cbxCpyName.SelectedIndex > 0)
                {
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    T_HR_COMPANY temp = cbxCpyName.SelectedItem as T_HR_COMPANY;
                    filter += " T_HR_DEPARTMENT.T_HR_COMPANY.COMPANYID==@" + paras.Count().ToString();
                    paras.Add(temp.COMPANYID);
                }
            }
            TextBox txtEmpName = Utility.FindChildControl <TextBox>(expander, "txtEmpName");

            if (txtEmpName != null)
            {
                if (!string.IsNullOrEmpty(txtEmpName.Text))
                {
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    //filter += "T_HR_POSTDICTIONARY.POSTNAME==@" + paras.Count().ToString();
                    filter += " @" + paras.Count().ToString() + ".Contains(T_HR_POSTDICTIONARY.POSTNAME)";
                    paras.Add(txtEmpName.Text.Trim());
                }
            }
            client.PostPagingAsync(dataPager.PageIndex, dataPager.PageSize, "T_HR_DEPARTMENT.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME",
                                   filter, paras, pageCount, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID, strState);
        }
Exemplo n.º 8
0
        private void cbxCpyName_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            T_HR_COMPANY tempEnt = ((System.Windows.Controls.Primitives.Selector)(sender)).SelectedItem as T_HR_COMPANY;

            client.GetDepartmentActivedAsync(SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID, tempEnt.COMPANYID);
            dataPager.PageIndex = 1;
            LoadData();
        }
Exemplo n.º 9
0
        void DtGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            DataGrid grid = sender as DataGrid;

            if (grid.SelectedItem != null)
            {
                SelectCompany = grid.SelectedItems[0] as T_HR_COMPANY;
            }
        }
Exemplo n.º 10
0
        void organClient_GetALLCompanyViewCompleted(object sender, GetALLCompanyViewCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                if (e.Result != null)
                {
                    List <V_COMPANY> entTemps = e.Result.ToList();
                    allCompanys = new List <T_HR_COMPANY>();
                    var ents = entTemps.OrderBy(c => c.FATHERID);
                    foreach (var ent in ents)
                    {
                        T_HR_COMPANY company = new T_HR_COMPANY();
                        company.COMPANYID = ent.COMPANYID;
                        company.CNAME     = ent.CNAME;
                        company.ENAME     = ent.ENAME;
                        if (!string.IsNullOrEmpty(ent.BRIEFNAME))
                        {
                            company.BRIEFNAME = ent.BRIEFNAME;
                        }
                        else
                        {
                            company.BRIEFNAME = ent.CNAME;
                        }

                        company.COMPANRYCODE = ent.COMPANRYCODE;
                        company.SORTINDEX    = ent.SORTINDEX;
                        if (!string.IsNullOrEmpty(ent.FATHERCOMPANYID))
                        {
                            company.T_HR_COMPANY2           = new T_HR_COMPANY();
                            company.T_HR_COMPANY2.COMPANYID = ent.FATHERCOMPANYID;
                            company.T_HR_COMPANY2.CNAME     = entTemps.Where(s => s.COMPANYID == ent.FATHERCOMPANYID).FirstOrDefault().CNAME;
                        }
                        company.FATHERID   = ent.FATHERID;
                        company.FATHERTYPE = ent.FATHERTYPE;
                        company.CHECKSTATE = ent.CHECKSTATE;
                        company.EDITSTATE  = ent.EDITSTATE;
                        allCompanys.Add(company);
                    }
                    if (App.Current.Resources["SYS_CompanyInfo"] != null)
                    {
                        App.Current.Resources.Remove("SYS_CompanyInfo");
                        App.Current.Resources.Add("SYS_CompanyInfo", allCompanys);
                    }
                    else
                    {
                        App.Current.Resources.Add("SYS_CompanyInfo", allCompanys);
                    }

                    organClient.GetAllDepartmentViewAsync("");
                }
            }
        }
Exemplo n.º 11
0
 void Organ_GetCompanyByIdCompleted(object sender, GetCompanyByIdCompletedEventArgs e)
 {
     if (!e.Cancelled)
     {
         if (e.Result != null)
         {
             T_HR_COMPANY company = new T_HR_COMPANY();
             company             = e.Result;
             StrCompanyID        = company.COMPANYID;
             txtCompanyName.Text = company.CNAME;
         }
     }
 }
Exemplo n.º 12
0
 void initEvents()
 {
     PARENT.Children.Add(loadbar);
     loadbar.Stop();
     T_HR_COMPANY companyInit = new T_HR_COMPANY();
     companyInit.COMPANYID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
     companyInit.CNAME = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyName;
     sType = "Company";
     sValue = companyInit.COMPANYID;
     lkSelectObj.DisplayMemberPath = "CNAME";
     lkSelectObj.DataContext = companyInit;
     
 }
Exemplo n.º 13
0
        void initEvents()
        {
            PARENT.Children.Add(loadbar);
            loadbar.Stop();
            T_HR_COMPANY companyInit = new T_HR_COMPANY();

            companyInit.COMPANYID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
            companyInit.CNAME     = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyName;
            sType  = "Company";
            sValue = companyInit.COMPANYID;
            lkSelectObj.DisplayMemberPath = "CNAME";
            lkSelectObj.DataContext       = companyInit;
        }
Exemplo n.º 14
0
        /// <summary>
        /// 获取正常的公司
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        void client_GetALLCompanyViewCompleted(object sender, GetALLCompanyViewCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                if (e.Result == null)
                {
                    return;
                }

                ObservableCollection <V_COMPANY> entTemps = e.Result;
                allCompanys = new List <T_HR_COMPANY>();
                allCompanys.Clear();
                var ents = entTemps.OrderBy(c => c.FATHERID);
                foreach (var ent in ents)
                {
                    T_HR_COMPANY company = new T_HR_COMPANY();
                    company.COMPANYID = ent.COMPANYID;
                    company.CNAME     = ent.CNAME;
                    company.ENAME     = ent.ENAME;
                    if (!string.IsNullOrEmpty(ent.BRIEFNAME))
                    {
                        company.BRIEFNAME = ent.BRIEFNAME;
                    }
                    else
                    {
                        company.BRIEFNAME = ent.CNAME;
                    }

                    company.COMPANRYCODE            = ent.COMPANRYCODE;
                    company.SORTINDEX               = ent.SORTINDEX;
                    company.T_HR_COMPANY2           = new T_HR_COMPANY();
                    company.T_HR_COMPANY2.COMPANYID = ent.FATHERCOMPANYID;
                    company.FATHERID    = ent.FATHERID;
                    company.FATHERTYPE  = ent.FATHERTYPE;
                    company.CHECKSTATE  = ent.CHECKSTATE;
                    company.EDITSTATE   = ent.EDITSTATE;
                    company.COMPANYTYPE = ent.COMPANYTYPE;
                    allCompanys.Add(company);
                }

                UICache.CreateCache("ORGTREESYSCompanyInfo", allCompanys);

                client.GetAllDepartmentViewAsync(SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID);
            }
            else
            {
                loadbar.Stop();
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERRORINFO"),
                                               Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
            }
        }
Exemplo n.º 15
0
        /// <summary>
        /// 未正式启用的考勤记录
        /// </summary>
        /// <param name="entEmployees">员工集合</param>
        /// <param name="dtStart">上班起始日期</param>
        /// <param name="dtEnd">上班截止日期</param>
        public void DeleteUnEffectiveRecordByDate(T_HR_COMPANY entCompany, T_HR_EMPLOYEE entEmployee, DateTime dtStart, DateTime dtEnd, ref DateTime dtRes)
        {
            try
            {
                if (entEmployee == null)
                {
                    return;
                }

                string strEmployeeID = entEmployee.EMPLOYEEID;

                var dels = from ac in dal.GetObjects()
                           where ac.EMPLOYEEID == strEmployeeID && ac.OWNERCOMPANYID == entCompany.COMPANYID &&
                           ac.ATTENDANCEDATE >= dtStart && ac.ATTENDANCEDATE <= dtEnd
                           orderby ac.ATTENDANCEDATE descending
                           select ac;

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

                foreach (T_HR_ATTENDANCERECORD entAttRd in dels)
                {
                    try
                    {
                        if (!string.IsNullOrWhiteSpace(entAttRd.ATTENDANCESTATE))
                        {
                            continue;
                        }

                        Tracer.Debug("初始化考勤删除未启用的员工初始化考勤记录,员工姓名:" + entAttRd.EMPLOYEENAME + " 时间:" + entAttRd.ATTENDANCEDATE.Value.ToString("yyyy-MM-dd"));
                        dal.Delete(entAttRd);
                    }
                    catch (Exception ex)
                    {
                        Tracer.Debug("删除员工" + entEmployee.EMPLOYEECNAME + "考勤初始化记录异常:" + " 考勤日期:" + entAttRd.ATTENDANCEDATE.Value.ToString("yyyy-MM-dd")
                                     + " 异常原因:" + ex.ToString());
                        continue;
                    }
                }

                //dal.SaveContextChanges();
            }
            catch (Exception ex)
            {
                dtRes = dtEnd;
                Utility.SaveLog("删除员工考勤初始化记录出错,执行函数为:DeleteUnEffectiveRecordByDate, 出错原因:" + ex.ToString());
            }
        }
Exemplo n.º 16
0
 void initEvents()
 {
     PARENT.Children.Add(loadbar);
     loadbar.Stop();
     T_HR_COMPANY companyInit = new T_HR_COMPANY();
     companyInit.COMPANYID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
     companyInit.CNAME = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyName;
     sType = "Company";
     sValue = companyInit.COMPANYID;
     lkSelectObj.DisplayMemberPath = "CNAME";
     lkSelectObj.DataContext = companyInit;
     personClient.GetEmployeesIntimeCompleted += new EventHandler<GetEmployeesIntimeCompletedEventArgs>(personClient_GetEmployeesIntimeCompleted);
     personClient.ExportEmployeesIntimeCompleted += new EventHandler<ExportEmployeesIntimeCompletedEventArgs>(personClient_ExportEmployeesIntimeCompleted);
 }
Exemplo n.º 17
0
        void initEvents()
        {
            PARENT.Children.Add(loadbar);
            loadbar.Stop();
            T_HR_COMPANY companyInit = new T_HR_COMPANY();

            companyInit.COMPANYID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
            companyInit.CNAME     = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyName;
            sType  = "Company";
            sValue = companyInit.COMPANYID;
            lkSelectObj.DisplayMemberPath                = "CNAME";
            lkSelectObj.DataContext                      = companyInit;
            personClient.GetEmployeesIntimeCompleted    += new EventHandler <GetEmployeesIntimeCompletedEventArgs>(personClient_GetEmployeesIntimeCompleted);
            personClient.ExportEmployeesIntimeCompleted += new EventHandler <ExportEmployeesIntimeCompletedEventArgs>(personClient_ExportEmployeesIntimeCompleted);
        }
Exemplo n.º 18
0
        /// <summary>
        /// 显示公司详细信息
        /// </summary>
        /// <param name="org">公司实例</param>
        public CompanyForm(T_HR_COMPANY org)
        {

            InitializeComponent();
            Company = org;
            // InitControlEvent();
            this.Loaded += (sender, args) =>
            {
                InitControlEvent();
            };


            //绑定国家
            //  Utility.CbxItemBinder(cbxCountry, "COUNTYTYPE", Company.COUNTYTYPE);
        }
Exemplo n.º 19
0
 void Organ_GetCompanyByIdCompleted(object sender, GetCompanyByIdCompletedEventArgs e)
 {
     if (!e.Cancelled)
     {
         if (e.Result != null)
         {
             T_HR_COMPANY company = new T_HR_COMPANY();
             company            = e.Result;
             StrCompanyId       = company.COMPANYID;
             CompanyObject.Text = company.CNAME;
             //CompanyObject.DisplayMemberPath = "CNAME";
             //CompanyObject.DataContext = company;
         }
     }
 }
Exemplo n.º 20
0
        private void LoadData()
        {
            loadbar.Start();
            int    pageCount = 0;
            string filter    = "";
            string strState  = "";

            System.Collections.ObjectModel.ObservableCollection <object> paras = new System.Collections.ObjectModel.ObservableCollection <object>();

            if (Checkstate != Convert.ToInt32(CheckStates.All).ToString())
            {
                strState = Checkstate;
            }

            //ComboBox cbxCompanyName = Utility.FindChildControl<ComboBox>(expander, "cbxCompanyName");
            AutoCompleteComboBox acbCompanyName = Utility.FindChildControl <AutoCompleteComboBox>(expander, "acbCompanyName");
            TextBox txtEmpName = Utility.FindChildControl <TextBox>(expander, "txtEmpName");

            if (acbCompanyName != null)
            {
                if (acbCompanyName.SelectedItem != null)
                {
                    T_HR_COMPANY ent = acbCompanyName.SelectedItem as T_HR_COMPANY;
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    filter += "T_HR_COMPANY.CNAME==@" + paras.Count().ToString();
                    paras.Add(ent.CNAME);
                }
            }
            if (txtEmpName != null)
            {
                if (!string.IsNullOrEmpty(txtEmpName.Text))
                {
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    //   filter += "T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME.Contains(@" + paras.Count().ToString()+")";
                    filter += " @" + paras.Count().ToString() + ".Contains(T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME)";
                    paras.Add(txtEmpName.Text.Trim());
                }
            }

            client.DepartmentPagingAsync(dataPager.PageIndex, dataPager.PageSize, "SORTINDEX", filter,
                                         paras, pageCount, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID, strState);
        }
Exemplo n.º 21
0
        void client_GetCompanyViewCompleted(object sender, GetCompanyViewCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                if (e.Result == null)
                {
                    return;
                }

                ObservableCollection <V_COMPANY> entTemps = e.Result;
                allCompanys = new List <T_HR_COMPANY>();
                allCompanys.Clear();
                var ents = entTemps.OrderBy(c => c.FATHERID);
                foreach (var ent in ents)
                {
                    T_HR_COMPANY company = new T_HR_COMPANY();
                    company.COMPANYID = ent.COMPANYID;
                    company.CNAME     = ent.CNAME;
                    company.ENAME     = ent.ENAME;
                    if (!string.IsNullOrEmpty(ent.BRIEFNAME))
                    {
                        company.BRIEFNAME = ent.BRIEFNAME;
                    }
                    else
                    {
                        company.BRIEFNAME = ent.CNAME;
                    }

                    company.COMPANRYCODE            = ent.COMPANRYCODE;
                    company.SORTINDEX               = ent.SORTINDEX;
                    company.T_HR_COMPANY2           = new T_HR_COMPANY();
                    company.T_HR_COMPANY2.COMPANYID = ent.FATHERCOMPANYID;
                    company.FATHERID   = ent.FATHERID;
                    company.FATHERTYPE = ent.FATHERTYPE;
                    company.CHECKSTATE = ent.CHECKSTATE;
                    company.EDITSTATE  = ent.EDITSTATE;
                    allCompanys.Add(company);
                }

                UICache.CreateCache("ORGTREESYSCompanyInfo" + Perm + Entity, allCompanys);

                client.GetDepartmentViewAsync(CurrentUserID, Perm, Entity);
            }
            else
            {
                loadbar.Stop();
            }
        }
Exemplo n.º 22
0
        private TreeViewItem GetParentItemFromChild(TreeViewItem item, OrgTreeItemTypes parentType, string parentID)
        {
            TreeViewItem tmpItem = null;

            ExtOrgObj obj = item.DataContext as ExtOrgObj;

            if (obj != null && item.Tag != null && item.Tag.ToString() == parentType.ToString())
            {
                switch (parentType)
                {
                case OrgTreeItemTypes.Company:
                    T_HR_COMPANY tmpOrg = obj.ObjectInstance as T_HR_COMPANY;
                    if (tmpOrg != null)
                    {
                        if (tmpOrg.COMPANYID == parentID)
                        {
                            return(item);
                        }
                    }
                    break;

                case OrgTreeItemTypes.Department:
                    T_HR_DEPARTMENT tmpDep = obj.ObjectInstance as T_HR_DEPARTMENT;
                    if (tmpDep != null)
                    {
                        if (tmpDep.DEPARTMENTID == parentID)
                        {
                            return(item);
                        }
                    }
                    break;
                }
            }
            if (item.Items != null && item.Items.Count > 0)
            {
                foreach (TreeViewItem childitem in item.Items)
                {
                    tmpItem = GetParentItemFromChild(childitem, parentType, parentID);
                    if (tmpItem != null)
                    {
                        break;
                    }
                }
            }
            return(tmpItem);
        }
Exemplo n.º 23
0
        private void lkCompany_FindClick(object sender, EventArgs e)
        {
            OrganizationLookupForm lookup = new OrganizationLookupForm();

            lookup.SelectedObjType = OrgTreeItemTypes.All;

            lookup.SelectedClick += (obj, ev) =>
            {
                if (lookup.SelectedObj is T_HR_COMPANY)
                {
                    lkCompany.DataContext    = lookup.SelectedObj;
                    lkDepartment.DataContext = null;
                    lkPost.DataContext       = null;
                }
                else if (lookup.SelectedObj is T_HR_DEPARTMENT)
                {
                    T_HR_COMPANY company = new T_HR_COMPANY();
                    company.COMPANYID = ((T_HR_DEPARTMENT)lookup.SelectedObj).T_HR_COMPANY.COMPANYID;
                    company.CNAME     = ((T_HR_DEPARTMENT)lookup.SelectedObj).T_HR_COMPANY.CNAME;

                    lkCompany.DataContext = company;

                    lkDepartment.DataContext = lookup.SelectedObj;
                    lkPost.DataContext       = null;
                }
                else if (lookup.SelectedObj is T_HR_POST)
                {
                    T_HR_COMPANY company = new T_HR_COMPANY();
                    company.COMPANYID = ((T_HR_POST)lookup.SelectedObj).T_HR_DEPARTMENT.T_HR_COMPANY.COMPANYID;
                    company.CNAME     = ((T_HR_POST)lookup.SelectedObj).T_HR_DEPARTMENT.T_HR_COMPANY.CNAME;

                    lkCompany.DataContext = company;

                    T_HR_DEPARTMENT depart = new T_HR_DEPARTMENT();
                    depart.DEPARTMENTID = ((T_HR_POST)lookup.SelectedObj).T_HR_DEPARTMENT.DEPARTMENTID;
                    depart.T_HR_DEPARTMENTDICTIONARY = new T_HR_DEPARTMENTDICTIONARY();
                    depart.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME = ((T_HR_POST)lookup.SelectedObj).T_HR_DEPARTMENT.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME;

                    lkDepartment.DataContext = depart;

                    lkPost.DataContext = lookup.SelectedObj;
                }
            };
            lookup.Show();
        }
Exemplo n.º 24
0
        private TreeViewItem GetParentItemFromChild(TreeViewItem item, string parentType, string parentID)
        {
            TreeViewItem tmpItem = null;

            if (item.Tag != null && item.Tag.ToString() == parentType)
            {
                switch (parentType)
                {
                case "0":
                    T_HR_COMPANY tmpOrg = item.DataContext as T_HR_COMPANY;
                    if (tmpOrg != null)
                    {
                        if (tmpOrg.COMPANYID == parentID)
                        {
                            return(item);
                        }
                    }
                    break;

                case "1":
                    T_HR_DEPARTMENT tmpDep = item.DataContext as T_HR_DEPARTMENT;
                    if (tmpDep != null)
                    {
                        if (tmpDep.DEPARTMENTID == parentID)
                        {
                            return(item);
                        }
                    }
                    break;
                }
            }
            if (item.Items != null && item.Items.Count > 0)
            {
                foreach (TreeViewItem childitem in item.Items)
                {
                    tmpItem = GetParentItemFromChild(childitem, parentType, parentID);
                    if (tmpItem != null)
                    {
                        break;
                    }
                }
            }
            return(tmpItem);
        }
Exemplo n.º 25
0
        private void treeOrganization_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e)
        {
            TreeViewItem selectedItem = treeOrganization.SelectedItem as TreeViewItem;

            if (selectedItem != null)
            {
                string IsTag = selectedItem.Tag.ToString();
                switch (IsTag)
                {
                case "Company":
                    T_HR_COMPANY company = selectedItem.DataContext as T_HR_COMPANY;
                    sType  = "Company";
                    sValue = company.COMPANYID;
                    sName  = company.CNAME;
                    break;

                case "Department":
                    T_HR_DEPARTMENT department = selectedItem.DataContext as T_HR_DEPARTMENT;
                    sType  = "Department";
                    sValue = department.DEPARTMENTID;
                    sName  = department.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME;
                    if (depIDsCach.ContainsKey(sValue))
                    {
                        return;
                    }
                    BindPosition(sValue, selectedItem);
                    break;

                case "Post":
                    T_HR_POST post = selectedItem.DataContext as T_HR_POST;
                    sType  = "Post";
                    sValue = post.POSTID;
                    sName  = post.T_HR_POSTDICTIONARY.POSTNAME;
                    break;
                }
                if (this.SelectedClick != null)
                {
                    this.SelectedClick(this, null);
                }
            }
        }
Exemplo n.º 26
0
        private void BindORG()
        {
            //绑定公司
            if (!string.IsNullOrEmpty(CustPerm.COMPANYID) && !string.IsNullOrEmpty(CustPerm.COMPANYNAME))
            {
                T_HR_COMPANY obj = new T_HR_COMPANY();
                obj.COMPANYID = CustPerm.COMPANYID;
                obj.CNAME     = CustPerm.COMPANYNAME;

                lkCompany.DataContext = null;
                lkCompany.DataContext = obj;
            }

            //绑定部门
            if (!string.IsNullOrEmpty(CustPerm.DEPARTMENTID) && !string.IsNullOrEmpty(CustPerm.DEPARTMENTNAME))
            {
                T_HR_DEPARTMENT obj = new T_HR_DEPARTMENT();

                obj.DEPARTMENTID = CustPerm.DEPARTMENTID;
                obj.T_HR_DEPARTMENTDICTIONARY = new T_HR_DEPARTMENTDICTIONARY();
                obj.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME = CustPerm.DEPARTMENTNAME;

                lkDepartment.DataContext = null;
                lkDepartment.DataContext = obj;
            }

            //绑定岗位
            if (!string.IsNullOrEmpty(CustPerm.POSTID) && !string.IsNullOrEmpty(CustPerm.POSTNAME))
            {
                T_HR_POST obj = new T_HR_POST();

                obj.POSTID = CustPerm.POSTID;
                obj.T_HR_POSTDICTIONARY          = new T_HR_POSTDICTIONARY();
                obj.T_HR_POSTDICTIONARY.POSTNAME = CustPerm.POSTNAME;

                lkPost.DataContext = null;
                lkPost.DataContext = obj;
            }
        }
Exemplo n.º 27
0
 void initEvents()
 {
     PARENT.Children.Add(loadbar);
     //loadbar.Stop();
     T_HR_COMPANY companyInit = new T_HR_COMPANY();
     companyInit.COMPANYID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
     companyInit.CNAME = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyName;
     sType = "Company";
     sValue = companyInit.COMPANYID;
     
     lkSelectObj.DataContext = companyInit;
     lkSelectObj.DisplayMemberPath = "CNAME";
     StrCompanyIDsList.Add(sValue);
     //personClient.GetEmployeesIntimeCompleted += new EventHandler<GetEmployeesIntimeCompletedEventArgs>(personClient_GetEmployeesIntimeCompleted);
     //personClient.ExportEmployeesIntimeCompleted += new EventHandler<ExportEmployeesIntimeCompletedEventArgs>(personClient_ExportEmployeesIntimeCompleted);
     personClient.GetEmployeeBasicInfosByCompanyCompleted += new EventHandler<GetEmployeeBasicInfosByCompanyCompletedEventArgs>(personClient_GetEmployeeBasicInfosByCompanyCompleted);
     personClient.ExportEmployeeBasicInfosByCompanyReportsCompleted += new EventHandler<ExportEmployeeBasicInfosByCompanyReportsCompletedEventArgs>(personClient_ExportEmployeeBasicInfosByCompanyReportsCompleted);
     personClient.ExportEmployeeTructReportsCompleted += new EventHandler<ExportEmployeeTructReportsCompletedEventArgs>(personClient_ExportEmployeeTructReportsCompleted);
     personClient.ExportEmployeeCollectsReportsCompleted += new EventHandler<ExportEmployeeCollectsReportsCompletedEventArgs>(personClient_ExportEmployeeCollectsReportsCompleted);
     personClient.ExportEmployeeBasicInfosNoGetReportsCompleted += new EventHandler<ExportEmployeeBasicInfosNoGetReportsCompletedEventArgs>(personClient_ExportEmployeeBasicInfosNoGetReportsCompleted);
     client.ExportEmployeePensionReportsCompleted += new EventHandler<ExportEmployeePensionReportsCompletedEventArgs>(client_ExportEmployeePensionReportsCompleted);
 }
Exemplo n.º 28
0
        void client_PostPagingCompleted(object sender, PostPagingCompletedEventArgs e)
        {
            List <T_HR_POST> list = new List <T_HR_POST>();

            if (e.Error != null && e.Error.Message != "")
            {
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERRORINFO"),
                                               Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
            }
            else
            {
                if (e.Result != null)
                {
                    list = e.Result.ToList();
                    //根据部门过滤
                    ComboBox cbxDepName = Utility.FindChildControl <ComboBox>(expander, "cbxDepName");
                    if (cbxDepName.SelectedIndex > 0)
                    {
                        T_HR_DEPARTMENT temp = cbxDepName.SelectedItem as T_HR_DEPARTMENT;
                        var             ent  = list.Where(s => s.T_HR_DEPARTMENT.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME == temp.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME);
                        list = ent.Count() > 0 ? ent.ToList() : null;
                    }
                    //根据公司过滤
                    ComboBox cbxCpyName = Utility.FindChildControl <ComboBox>(expander, "cbxCpyName");
                    //if (cbxCpyName.SelectedItem != null)
                    if (cbxCpyName.SelectedIndex > 0 && list != null)
                    {
                        T_HR_COMPANY temp = cbxCpyName.SelectedItem as T_HR_COMPANY;
                        var          ent  = list.Where(s => s.T_HR_DEPARTMENT.T_HR_COMPANY.CNAME == temp.CNAME);
                        list = ent.Count() > 0 ? ent.ToList() : null;
                    }
                }
                DtGrid.ItemsSource  = list;
                dataPager.PageCount = e.pageCount;
            }
            ToolBar.btnRefresh.IsEnabled = true;
            loadbar.Stop();
        }
Exemplo n.º 29
0
        /// <summary>
        /// 初始化控件信息
        /// </summary>
        private void InitOrgInfo()
        {
            #region 发薪机构信息
            lkSalaryCompany.SearchButton.IsEnabled = false;
            lkSalaryCompany.TxtLookUp.IsReadOnly   = true;
            salarycompany               = new T_HR_COMPANY();
            salarycompany.COMPANYID     = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
            salarycompany.CNAME         = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyName;
            lkSalaryCompany.DataContext = salarycompany;
            #endregion

            #region 指定结算岗位信息
            T_HR_POST lkSelectPost = new T_HR_POST();
            lkSelectPost.POSTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostID;
            lkSelectPost.T_HR_POSTDICTIONARY          = new T_HR_POSTDICTIONARY();
            lkSelectPost.T_HR_POSTDICTIONARY.POSTNAME = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostName;
            lkSelectPost.T_HR_DEPARTMENT = new T_HR_DEPARTMENT();
            lkSelectPost.T_HR_DEPARTMENT.T_HR_COMPANY           = new T_HR_COMPANY();
            lkSelectPost.T_HR_DEPARTMENT.T_HR_COMPANY.COMPANYID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
            lkSelectObj.DataContext       = lkSelectPost;
            lkSelectObj.DisplayMemberPath = "T_HR_POSTDICTIONARY.POSTNAME";
            #endregion
        }
Exemplo n.º 30
0
        private void lkCompany_FindClick(object sender, EventArgs e)
        {
            Dictionary <string, string> cols = new Dictionary <string, string>();

            cols.Add("COMPANRYCODE", "COMPANRYCODE");
            cols.Add("CNAME", "CNAME");
            cols.Add("ENAME", "ENAME");
            LookupForm lookup = new LookupForm(SMT.Saas.Tools.OrganizationWS.EntityNames.Company,
                                               typeof(T_HR_COMPANY[]), cols);

            lookup.SelectedClick += (o, ev) =>
            {
                T_HR_COMPANY ent = lookup.SelectedObj as T_HR_COMPANY;

                if (ent != null)
                {
                    lkCompany.DataContext = ent;
                    //HandleComapnyChanged();
                }
            };

            lookup.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { });
        }
Exemplo n.º 31
0
        void initEvents()
        {
            PARENT.Children.Add(loadbar);
            //loadbar.Stop();
            T_HR_COMPANY companyInit = new T_HR_COMPANY();

            companyInit.COMPANYID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
            companyInit.CNAME     = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyName;
            sType  = "Company";
            sValue = companyInit.COMPANYID;

            lkSelectObj.DataContext       = companyInit;
            lkSelectObj.DisplayMemberPath = "CNAME";
            StrCompanyIDsList.Add(sValue);
            //personClient.GetEmployeesIntimeCompleted += new EventHandler<GetEmployeesIntimeCompletedEventArgs>(personClient_GetEmployeesIntimeCompleted);
            //personClient.ExportEmployeesIntimeCompleted += new EventHandler<ExportEmployeesIntimeCompletedEventArgs>(personClient_ExportEmployeesIntimeCompleted);
            personClient.GetEmployeeBasicInfosByCompanyCompleted           += new EventHandler <GetEmployeeBasicInfosByCompanyCompletedEventArgs>(personClient_GetEmployeeBasicInfosByCompanyCompleted);
            personClient.ExportEmployeeBasicInfosByCompanyReportsCompleted += new EventHandler <ExportEmployeeBasicInfosByCompanyReportsCompletedEventArgs>(personClient_ExportEmployeeBasicInfosByCompanyReportsCompleted);
            personClient.ExportEmployeeTructReportsCompleted           += new EventHandler <ExportEmployeeTructReportsCompletedEventArgs>(personClient_ExportEmployeeTructReportsCompleted);
            personClient.ExportEmployeeCollectsReportsCompleted        += new EventHandler <ExportEmployeeCollectsReportsCompletedEventArgs>(personClient_ExportEmployeeCollectsReportsCompleted);
            personClient.ExportEmployeeBasicInfosNoGetReportsCompleted += new EventHandler <ExportEmployeeBasicInfosNoGetReportsCompletedEventArgs>(personClient_ExportEmployeeBasicInfosNoGetReportsCompleted);
            client.ExportEmployeePensionReportsCompleted += new EventHandler <ExportEmployeePensionReportsCompletedEventArgs>(client_ExportEmployeePensionReportsCompleted);
        }
Exemplo n.º 32
0
 void client_GetCompanyActivedCompleted(object sender, GetCompanyActivedCompletedEventArgs e)
 {
     ObservableCollection<T_HR_COMPANY> ctmp = new ObservableCollection<T_HR_COMPANY>();
     if (e.Error != null && e.Error.Message != "")
     {
         ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERRORINFO"),
                Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
     }
     else
     {
         ComboBox cbxCpyName = Utility.FindChildControl<ComboBox>(expander, "cbxCpyName");
         if (e.Result != null)
         {
             ctmp = e.Result;
             T_HR_COMPANY all = new T_HR_COMPANY();
             all.COMPANYID = "companyID";
             all.CNAME = Utility.GetResourceStr("ALL");
             ctmp.Insert(0, all);
         }
         cbxCpyName.ItemsSource = ctmp;
         cbxCpyName.DisplayMemberPath = "CNAME";
     }
 }
Exemplo n.º 33
0
        /// <summary>
        /// 初始化控件信息
        /// </summary>
        private void InitOrgInfo()
        {
            #region 发薪机构信息
            lkSalaryCompany.SearchButton.IsEnabled = false;
            lkSalaryCompany.TxtLookUp.IsReadOnly = true;
            salarycompany = new T_HR_COMPANY();
            salarycompany.COMPANYID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
            salarycompany.CNAME = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyName;
            lkSalaryCompany.DataContext = salarycompany;
            #endregion

            #region 指定结算岗位信息
            T_HR_POST lkSelectPost = new T_HR_POST();
            lkSelectPost.POSTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostID;
            lkSelectPost.T_HR_POSTDICTIONARY = new T_HR_POSTDICTIONARY();
            lkSelectPost.T_HR_POSTDICTIONARY.POSTNAME = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostName;
            lkSelectPost.T_HR_DEPARTMENT = new T_HR_DEPARTMENT();
            lkSelectPost.T_HR_DEPARTMENT.T_HR_COMPANY = new T_HR_COMPANY();
            lkSelectPost.T_HR_DEPARTMENT.T_HR_COMPANY.COMPANYID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
            lkSelectObj.DataContext = lkSelectPost;
            lkSelectObj.DisplayMemberPath = "T_HR_POSTDICTIONARY.POSTNAME";
            #endregion
        }
Exemplo n.º 34
0
        private void lkCustomSalary_FindClick(object sender, EventArgs e)
        {
            Dictionary <string, string> cols = new Dictionary <string, string>();

            cols.Add("COMPANRYCODE", "COMPANRYCODE");
            cols.Add("CNAME", "CNAME");
            cols.Add("ADDRESS", "ADDRESS");

            LookupForm lookup = new LookupForm(EntityNames.Company,
                                               typeof(List <T_HR_COMPANY>), cols);

            lookup.SelectedClick += (o, ev) =>
            {
                T_HR_COMPANY ent = lookup.SelectedObj as T_HR_COMPANY;
                if (ent != null)
                {
                    lkCustomSalary.DataContext    = ent;
                    lkCustomSalary.TxtLookUp.Text = ent.CNAME;
                    AttendMachineSet.COMPANYID    = ent.COMPANYID;
                }
            };
            lookup.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { });
        }
Exemplo n.º 35
0
        private string GetAssignObjectName(string type, string objectID)
        {
            string name = "";

            int objectType = -1;

            int.TryParse(type, out objectType);

            switch ((AssignObjectType)objectType)
            {
            case AssignObjectType.Company:
                CompanyBLL   cbll    = new CompanyBLL();
                T_HR_COMPANY company = cbll.GetCompanyById(objectID);
                name = (company == null) ? "" : company.CNAME;
                break;

            case AssignObjectType.Department:
                DepartmentBLL   dbll   = new DepartmentBLL();
                T_HR_DEPARTMENT depart = dbll.GetDepartmentById(objectID);
                name = (depart == null) ? "" : depart.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME;
                break;

            case AssignObjectType.Post:
                PostBLL   pbll = new PostBLL();
                T_HR_POST post = pbll.GetPostById(objectID);
                name = (post == null) ? "" : post.T_HR_POSTDICTIONARY.POSTNAME;
                break;

            case AssignObjectType.Employee:
                EmployeeBLL   ebll     = new EmployeeBLL();
                T_HR_EMPLOYEE employee = ebll.GetEmployeeByID(objectID);
                name = (employee == null) ? "" : employee.EMPLOYEECNAME;
                break;
            }

            return(name);
        }
Exemplo n.º 36
0
        /// <summary>
        /// 删除公司项
        /// </summary>
        /// <param name="allMenu"></param>
        private void RemoveCompany(T_HR_COMPANY delCompany)
        {
            if (delCompany == null)
            {
                return;
            }

            if (this.DataContext == null)
            {
                return;
            }

            List<T_HR_COMPANY> entCompanyList = new List<T_HR_COMPANY>();
            foreach (T_HR_COMPANY com in DtGridCompany.ItemsSource)
            {
                entCompanyList.Add(com);
            }


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

            for (int i = 0; i < entCompanyList.Count(); i++)
            {
                T_HR_COMPANY entCompany = entCompanyList[i] as T_HR_COMPANY;
                if (entCompany.COMPANYID == delCompany.COMPANYID)
                {
                    entCompanyList.Remove(entCompany);
                    break;
                }
            }

            ExtOrgObj extCompany = new ExtOrgObj();
            extCompany.ObjectInstance = delCompany;

            RemoveCustomPermissionByExtOrgObj(extCompany);
        }
Exemplo n.º 37
0
        void CompanyForm_Loaded(object sender, RoutedEventArgs e)
        {
            #region 新增
            if (FormType == FormTypes.Audit || FormType == FormTypes.Browse)
            {
                EnableControl();
            }
            #endregion
            if (FormType == FormTypes.New)
            {
                Company = new T_HR_COMPANY();
                Company.COMPANYID = Guid.NewGuid().ToString();
                Company.CHECKSTATE = Convert.ToInt32(CheckStates.UnSubmit).ToString();
                createUserName = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeName;
                SetToolBar();
            }
            else
            {
                RefreshUI(RefreshedTypes.ShowProgressBar);
                client.GetCompanyByIdAsync(companyid);
            }

            //Load事件之后,加载完后获取到父控件
            //EntityBrowser entBrowser = this.FindParentByType<EntityBrowser>();
            //entBrowser.BtnSaveSubmit.Click -= new RoutedEventHandler(entBrowser.btnSubmit_Click);
            //entBrowser.BtnSaveSubmit.Click += new RoutedEventHandler(BtnSaveSubmit_Click);
        }
Exemplo n.º 38
0
        void client_GetCompanyByIdCompleted(object sender, GetCompanyByIdCompletedEventArgs e)
        {
            if (e.Error != null && e.Error.Message != "")
            {
                RefreshUI(RefreshedTypes.HideProgressBar);
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERRORINFO"),
                            Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
            }
            else
            {
                if (e.Result == null)
                {
                    RefreshUI(RefreshedTypes.HideProgressBar);
                    ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("NOTFOUND"),
                      Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                    return;
                }
                Company = e.Result;

                CheckFatherObject();
                if (!string.IsNullOrEmpty(company.COMPANYTYPE))
                {
                    foreach (SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY item in cbxCompanyType.ItemsSource)
                    {
                        if (item.DICTIONARYVALUE.ToString() == company.COMPANYTYPE)
                        {
                            cbxCompanyType.SelectedItem = item;
                            break;
                        }
                    }
                }
                //绑定国家
                // Utility.CbxItemBinder(cbxCountry, "COUNTYTYPE", Company.COUNTYTYPE);

                //BindAduitInfo();
                if (FormType == FormTypes.Resubmit)
                {
                    //Company.CHECKSTATE = Convert.ToInt32(CheckStates.UnSubmit).ToString();
                    //if (Company.EDITSTATE == Convert.ToInt32(EditStates.Actived).ToString())
                    //{
                    //    Company.EDITSTATE = Convert.ToInt32(EditStates.PendingCanceled).ToString();
                    //}
                    //else
                    //{
                    //    Company.EDITSTATE = Convert.ToInt32(EditStates.UnActived).ToString();
                    //}
                    Company.CHECKSTATE = Convert.ToInt32(CheckStates.UnSubmit).ToString();
                    if (Company.EDITSTATE != Convert.ToInt32(EditStates.PendingCanceled).ToString())
                    {
                        Company.EDITSTATE = Convert.ToInt32(EditStates.UnActived).ToString();
                    }

                }
                if (Company.CHECKSTATE != Convert.ToInt32(CheckStates.UnSubmit).ToString())
                {
                    EnableControl();
                }
                //绑定城市
                BindCity();
                if (Company.CHECKSTATE == Convert.ToInt32(CheckStates.Approved).ToString()
                    || Company.CHECKSTATE == Convert.ToInt32(CheckStates.UnApproved).ToString())
                {
                    RefreshUI(RefreshedTypes.AuditInfo);
                    SetToolBar();
                    RefreshUI(RefreshedTypes.HideProgressBar);
                }
                else
                {
                    System.Collections.ObjectModel.ObservableCollection<string> CreateUserIDs = new System.Collections.ObjectModel.ObservableCollection<string>();
                    CreateUserIDs.Add(Company.CREATEUSERID);
                    personClient.GetEmployeeToEngineAsync(CreateUserIDs);
                }


            }

        }
Exemplo n.º 39
0
        void client_GetTravleSolutionSetBySolutionIDCompleted(object sender, GetTravleSolutionSetBySolutionIDCompletedEventArgs e)
        {
            RefreshUI(RefreshedTypes.HideProgressBar);
            if (!e.Cancelled)
            {
                if (e.Error == null)
                {
                    
                    if (e.Result.Count() >0)
                    {
                        IsEdit = true;//z设置为修改
                        issuanceExtOrgObj.Clear();
                        ListSet = e.Result.ToList();
                        foreach (var h in ListSet)
                        {
                            object obj = new object();
                            SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj extOrgObj = new SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj();
                                                        
                            T_HR_COMPANY tmp = new T_HR_COMPANY();
                            tmp.COMPANYID = h.COMPANYID;
                            tmp.CNAME = Utility.GetCompanyName(tmp.COMPANYID);
                            obj = tmp;
                            
                            
                            extOrgObj.ObjectInstance = obj;
                            issuanceExtOrgObj.Add(extOrgObj);
                        }
                        BindData();
                    }
                }

            }
        }
Exemplo n.º 40
0
        void client_GetCompanyViewCompleted(object sender, GetCompanyViewCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                if (e.Result == null)
                {
                    return;
                }

                ObservableCollection<V_COMPANY> entTemps = e.Result;
                allCompanys = new List<T_HR_COMPANY>();
                allCompanys.Clear();
                var ents = entTemps.OrderBy(c => c.FATHERID);
                foreach (var ent in ents)
                {
                    T_HR_COMPANY company = new T_HR_COMPANY();
                    company.COMPANYID = ent.COMPANYID;
                    company.CNAME = ent.CNAME;
                    company.ENAME = ent.ENAME;
                    if (!string.IsNullOrEmpty(ent.BRIEFNAME))
                    {
                        company.BRIEFNAME = ent.BRIEFNAME;
                    }
                    else
                    {
                        company.BRIEFNAME = ent.CNAME;
                    }

                    company.COMPANRYCODE = ent.COMPANRYCODE;
                    company.SORTINDEX = ent.SORTINDEX;
                    company.T_HR_COMPANY2 = new T_HR_COMPANY();
                    company.T_HR_COMPANY2.COMPANYID = ent.FATHERCOMPANYID;
                    company.FATHERID = ent.FATHERID;
                    company.FATHERTYPE = ent.FATHERTYPE;
                    company.CHECKSTATE = ent.CHECKSTATE;
                    company.EDITSTATE = ent.EDITSTATE;
                    allCompanys.Add(company);
                }

                UICache.CreateCache("ORGTREESYSCompanyInfo" + Perm + Entity, allCompanys);

                client.GetDepartmentViewAsync(CurrentUserID, Perm, Entity);
            }
            else
            {
                loadbar.Stop();
            }
        }
Exemplo n.º 41
0
        /// <summary>
        /// 获取正常的公司
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        void client_GetALLCompanyViewCompleted(object sender, GetALLCompanyViewCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                if (e.Result == null)
                {
                    return;
                }

                ObservableCollection<V_COMPANY> entTemps = e.Result;
                allCompanys = new List<T_HR_COMPANY>();
                allCompanys.Clear();
                var ents = entTemps.OrderBy(c => c.FATHERID);
                foreach (var ent in ents)
                {
                    T_HR_COMPANY company = new T_HR_COMPANY();
                    company.COMPANYID = ent.COMPANYID;
                    company.CNAME = ent.CNAME;
                    company.ENAME = ent.ENAME;
                    if (!string.IsNullOrEmpty(ent.BRIEFNAME))
                    {
                        company.BRIEFNAME = ent.BRIEFNAME;
                    }
                    else
                    {
                        company.BRIEFNAME = ent.CNAME;
                    }

                    company.COMPANRYCODE = ent.COMPANRYCODE;
                    company.SORTINDEX = ent.SORTINDEX;
                    company.T_HR_COMPANY2 = new T_HR_COMPANY();
                    company.T_HR_COMPANY2.COMPANYID = ent.FATHERCOMPANYID;
                    company.FATHERID = ent.FATHERID;
                    company.FATHERTYPE = ent.FATHERTYPE;
                    company.CHECKSTATE = ent.CHECKSTATE;
                    company.EDITSTATE = ent.EDITSTATE;
                    company.COMPANYTYPE = ent.COMPANYTYPE;
                    allCompanys.Add(company);
                }

                UICache.CreateCache("ORGTREESYSCompanyInfo", allCompanys);

                client.GetAllDepartmentViewAsync(SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID);
            }
            else
            {
                loadbar.Stop();
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERRORINFO"),
                       Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
            }
        }
Exemplo n.º 42
0
 /// <summary>
 /// 添加所选项
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void button1_Click(object sender, RoutedEventArgs e)
 {
     if (FirstComany.SelectedItems.Count > 0)
     {
         T_HR_COMPANY selectcompany = new T_HR_COMPANY();
         selectcompany = FirstComany.SelectedItem as T_HR_COMPANY;
         if (SecondCompany.Items.Count > 0)
         {
             if (!(SecondCompany.Items.Contains(selectcompany)))
             {
                 SecondCompany.Items.Add(selectcompany);
             }
         }
         else
         {
             SecondCompany.Items.Add(selectcompany);
         }
         
         FirstComany.Items.Remove(selectcompany);
         
     }
     else
     {
         Utility.ShowCustomMessage(MessageTypes.Caution, "CAUTION", "请选择公司");
     }
     //FirstComany.ItemsSource = null;
     //FirstComany.ItemsSource = ListFirstCompany;
     SecondCompany.DisplayMemberPath = "CNAME";
 }
Exemplo n.º 43
0
 void Organ_GetCompanyByIdCompleted(object sender, GetCompanyByIdCompletedEventArgs e)
 {
     if (!e.Cancelled)
     {
         if (e.Result != null)
         {
             T_HR_COMPANY company = new T_HR_COMPANY();
             company = e.Result;
             StrCompanyID = company.COMPANYID;
             txtCompanyName.Text = company.CNAME;
             
         }
     }
 }
Exemplo n.º 44
0
        /// <summary>
        ///  读取打卡的Excel文件,并导入数据库,返回导入后的结果
        /// </summary>
        private void ImportClockInRd()
        {
            string strMsg = string.Empty;

            try
            {
                string   strUnitType = string.Empty, strUnitObjectId = string.Empty;
                DateTime dtStart = new DateTime();
                DateTime dtEnd   = new DateTime();
                bool     flag    = false;

                flag = DateTime.TryParse(dpStartDate.Text, out dtStart);
                if (!flag)
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("IMPORTCLOCKINRDSTARTDATE"), Utility.GetResourceStr("REQUIRED", "IMPORTCLOCKINRDSTARTDATE"));
                    return;
                }

                flag = DateTime.TryParse(dpEndDate.Text, out dtEnd);
                if (!flag)
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("IMPORTCLOCKINRDENDDATE"), Utility.GetResourceStr("REQUIRED", "IMPORTCLOCKINRDENDDATE"));
                    return;
                }

                if (dtStart > dtEnd)
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("IMPORTCLOCKINRDENDDATE"), Utility.GetResourceStr("DATECOMPARE", "IMPORTCLOCKINRDENDDATE,IMPORTCLOCKINRDSTARTDATE"));
                    return;
                }

                if (cbxkClockInRdUnitType.SelectedItem == null)
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("CLOCKINRDUNITTYPE"), Utility.GetResourceStr("REQUIRED", "CLOCKINRDUNITTYPE"));
                    return;
                }

                if (lkClockInRdUnit.DataContext == null)
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("CLOCKINRDUNIT"), Utility.GetResourceStr("REQUIRED", "CLOCKINRDUNIT"));
                    return;
                }

                if (cbxkUploadFileType.SelectedItem == null)
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("CLOCKINRDUPLOADTYPE"), Utility.GetResourceStr("REQUIRED", "CLOCKINRDUPLOADTYPE"));
                    return;
                }

                T_SYS_DICTIONARY entUnitType = cbxkClockInRdUnitType.SelectedItem as T_SYS_DICTIONARY;
                if (string.IsNullOrEmpty(entUnitType.DICTIONARYID) || string.IsNullOrEmpty(entUnitType.DICTIONCATEGORY) || string.IsNullOrEmpty(entUnitType.DICTIONARYVALUE.ToString()))
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("CLOCKINRDUNITTYPE"), Utility.GetResourceStr("REQUIRED", "CLOCKINRDUNITTYPE"));
                    return;
                }

                T_SYS_DICTIONARY entUploadType = cbxkUploadFileType.SelectedItem as T_SYS_DICTIONARY;
                if (string.IsNullOrEmpty(entUploadType.DICTIONARYID) || string.IsNullOrEmpty(entUploadType.DICTIONCATEGORY) || string.IsNullOrEmpty(entUploadType.DICTIONARYVALUE.ToString()))
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("CLOCKINRDUPLOADTYPE"), Utility.GetResourceStr("REQUIRED", "CLOCKINRDUPLOADTYPE"));
                    return;
                }

                strUnitType = entUnitType.DICTIONARYVALUE.ToString();
                if (strUnitType == (Convert.ToInt32(AssignedObjectType.Company) + 1).ToString())
                {
                    T_HR_COMPANY entCompany = lkClockInRdUnit.DataContext as T_HR_COMPANY;
                    strUnitObjectId = entCompany.COMPANYID;
                }
                else if (strUnitType == (Convert.ToInt32(AssignedObjectType.Department) + 1).ToString())
                {
                    T_HR_DEPARTMENT entDepartment = lkClockInRdUnit.DataContext as T_HR_DEPARTMENT;
                    strUnitObjectId = entDepartment.DEPARTMENTID;
                }
                else if (strUnitType == (Convert.ToInt32(AssignedObjectType.Post) + 1).ToString())
                {
                    T_HR_POST entPost = lkClockInRdUnit.DataContext as T_HR_POST;
                    strUnitObjectId = entPost.POSTID;
                }

                if (entUploadType.DICTIONARYVALUE.ToString() == (Convert.ToInt32(ClockInRdUploadFileType.File) + 1).ToString())
                {
                    if (OpenFileDialog == null)
                    {
                        Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("REQUIREDIMPORTFILE"));
                        return;
                    }

                    if (OpenFileDialog.File == null)
                    {
                        Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("REQUIREDIMPORTFILE"));
                        return;
                    }

                    RefreshUI(RefreshedTypes.ShowProgressBar);

                    Stream Stream = (System.IO.Stream)OpenFileDialog.File.OpenRead();

                    byte[] Buffer = new byte[Stream.Length];
                    Stream.Read(Buffer, 0, (int)Stream.Length);

                    Stream.Dispose();
                    Stream.Close();

                    SMT.Saas.Tools.AttendanceWS.UploadFileModel UploadFile = new SMT.Saas.Tools.AttendanceWS.UploadFileModel();
                    UploadFile.FileName = OpenFileDialog.File.Name;
                    UploadFile.File     = Buffer;

                    string strFileType = "csv";
                    clientAtt.ImportClockInRdListFromFileAsync(UploadFile, strFileType, strUnitType, strUnitObjectId, dtStart, dtEnd, strMsg);
                }
                else if (entUploadType.DICTIONARYVALUE.ToString() == (Convert.ToInt32(ClockInRdUploadFileType.Login) + 1).ToString())
                {
                    RefreshUI(RefreshedTypes.ShowProgressBar);
                    clientAtt.ImportClockInRdListFromLoginDataAsync(strUnitType, strUnitObjectId, dtStart, dtEnd, strMsg);
                }
                else if (entUploadType.DICTIONARYVALUE.ToString() == (Convert.ToInt32(ClockInRdUploadFileType.FileAndLogin) + 1).ToString())
                {
                    if (OpenFileDialog == null)
                    {
                        Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("REQUIREDIMPORTFILE"));
                        return;
                    }

                    if (OpenFileDialog.File == null)
                    {
                        Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("REQUIREDIMPORTFILE"));
                        return;
                    }

                    RefreshUI(RefreshedTypes.ShowProgressBar);

                    Stream Stream = (System.IO.Stream)OpenFileDialog.File.OpenRead();

                    byte[] Buffer = new byte[Stream.Length];
                    Stream.Read(Buffer, 0, (int)Stream.Length);

                    Stream.Dispose();
                    Stream.Close();

                    SMT.Saas.Tools.AttendanceWS.UploadFileModel UploadFile = new SMT.Saas.Tools.AttendanceWS.UploadFileModel();
                    UploadFile.FileName = OpenFileDialog.File.Name;
                    UploadFile.File     = Buffer;

                    string strFileType = "csv";
                    clientAtt.ImportClockInRdListFromFileAndLoginDataAsync(UploadFile, strFileType, strUnitType, strUnitObjectId, dtStart, dtEnd, strMsg);
                }

                strMsg = string.Empty;
            }
            catch (Exception ex)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(ex.Message.ToString()));
            }
        }
Exemplo n.º 45
0
        /// <summary>
        /// 根据当前登录人的公司获取顶级公司
        /// </summary>
        /// <param name="departmentID"></param>
        /// <returns></returns>
        public T_HR_COMPANY GetFatherByDepartmentID(string departmentID)
        {
            T_HR_DEPARTMENT department = new T_HR_DEPARTMENT();
            T_HR_COMPANY company = new T_HR_COMPANY();
            Dictionary<string, string> fathers = new Dictionary<string, string>();
            string fatherType = "0";
            string fatherID = "";
            bool hasFather = false;

            department = (from c in allDepartments
                          where c.DEPARTMENTID == departmentID
                          select c).FirstOrDefault();

            if (department != null)
            {
                if (!string.IsNullOrEmpty(department.FATHERTYPE) && !string.IsNullOrEmpty(department.FATHERID))
                {
                    fatherType = department.FATHERTYPE;
                    fatherID = department.FATHERID;
                    hasFather = true;
                }
                else
                {
                    hasFather = false;
                }
            }

            while (hasFather)
            {
                if (fatherType == "1" && !string.IsNullOrEmpty(fatherID))
                {
                    department = (from de in allDepartments
                                  where de.DEPARTMENTID == fatherID
                                  select de).FirstOrDefault();
                    if (department != null)
                    {
                        //fathers.Add(department.DEPARTMENTID, "1");
                        if (!string.IsNullOrEmpty(department.FATHERTYPE) && !string.IsNullOrEmpty(department.FATHERID))
                        {
                            fatherID = department.FATHERID;
                            fatherType = department.FATHERTYPE;
                        }
                        else
                        {
                            hasFather = false;
                        }
                    }
                    else
                    {
                        hasFather = false;
                    }
                }
                else if (fatherType == "0" && !string.IsNullOrEmpty(fatherID))
                {
                    company = (from com in allCompanys
                               where com.COMPANYID == fatherID
                               select com).FirstOrDefault();

                    if (company != null)
                    {
                        //fathers.Add(company.COMPANYID, "0");
                        if (!string.IsNullOrEmpty(company.FATHERTYPE) && !string.IsNullOrEmpty(company.FATHERID))
                        {
                            fatherID = company.FATHERID;
                            fatherType = company.FATHERTYPE;
                        }
                        else
                        {
                            hasFather = false;
                        }
                    }
                    else
                    {
                        hasFather = false;
                    }

                }
                else
                {
                    hasFather = false;
                }

            }
            return company;
        }
Exemplo n.º 46
0
        private void lkCompany_FindClick(object sender, EventArgs e)
        {
            OrganizationLookupForm lookup = new OrganizationLookupForm();
            lookup.SelectedObjType = OrgTreeItemTypes.All;

            lookup.SelectedClick += (obj, ev) =>
            {

                if (lookup.SelectedObj is T_HR_COMPANY)
                {
                    lkCompany.DataContext = lookup.SelectedObj;
                    lkDepartment.DataContext = null;
                    lkPost.DataContext = null;
                }
                else if (lookup.SelectedObj is T_HR_DEPARTMENT)
                {
                    T_HR_COMPANY company = new T_HR_COMPANY();
                    company.COMPANYID = ((T_HR_DEPARTMENT)lookup.SelectedObj).T_HR_COMPANY.COMPANYID;
                    company.CNAME = ((T_HR_DEPARTMENT)lookup.SelectedObj).T_HR_COMPANY.CNAME;

                    lkCompany.DataContext = company;

                    lkDepartment.DataContext = lookup.SelectedObj;
                    lkPost.DataContext = null;
                }
                else if (lookup.SelectedObj is T_HR_POST)
                {
                    T_HR_COMPANY company = new T_HR_COMPANY();
                    company.COMPANYID = ((T_HR_POST)lookup.SelectedObj).T_HR_DEPARTMENT.T_HR_COMPANY.COMPANYID;
                    company.CNAME = ((T_HR_POST)lookup.SelectedObj).T_HR_DEPARTMENT.T_HR_COMPANY.CNAME;

                    lkCompany.DataContext = company;

                    T_HR_DEPARTMENT depart = new T_HR_DEPARTMENT();
                    depart.DEPARTMENTID = ((T_HR_POST)lookup.SelectedObj).T_HR_DEPARTMENT.DEPARTMENTID;
                    depart.T_HR_DEPARTMENTDICTIONARY = new T_HR_DEPARTMENTDICTIONARY();
                    depart.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME = ((T_HR_POST)lookup.SelectedObj).T_HR_DEPARTMENT.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME;

                    lkDepartment.DataContext = depart;

                    lkPost.DataContext = lookup.SelectedObj;
                } 

            };
            lookup.Show();
        }
Exemplo n.º 47
0
        private void BindORG()
        {
            //绑定公司
            if (!string.IsNullOrEmpty(CustPerm.COMPANYID) && !string.IsNullOrEmpty(CustPerm.COMPANYNAME))
            {
                T_HR_COMPANY obj = new T_HR_COMPANY();
                obj.COMPANYID = CustPerm.COMPANYID;
                obj.CNAME = CustPerm.COMPANYNAME;

                lkCompany.DataContext = null;
                lkCompany.DataContext = obj;
            }

            //绑定部门
            if (!string.IsNullOrEmpty(CustPerm.DEPARTMENTID) && !string.IsNullOrEmpty(CustPerm.DEPARTMENTNAME))
            {
                T_HR_DEPARTMENT obj = new T_HR_DEPARTMENT();

                obj.DEPARTMENTID = CustPerm.DEPARTMENTID;
                obj.T_HR_DEPARTMENTDICTIONARY = new T_HR_DEPARTMENTDICTIONARY();
                obj.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME = CustPerm.DEPARTMENTNAME;

                lkDepartment.DataContext = null;
                lkDepartment.DataContext = obj;
            }

            //绑定岗位
            if (!string.IsNullOrEmpty(CustPerm.POSTID) && !string.IsNullOrEmpty(CustPerm.POSTNAME))
            {
                T_HR_POST obj = new T_HR_POST();

                obj.POSTID = CustPerm.POSTID;
                obj.T_HR_POSTDICTIONARY = new T_HR_POSTDICTIONARY();
                obj.T_HR_POSTDICTIONARY.POSTNAME = CustPerm.POSTNAME;

                lkPost.DataContext = null;
                lkPost.DataContext = obj;
            }
        }
Exemplo n.º 48
0
        private string GetXmlString(string StrSource, T_HR_COMPANY Info)
        {
            T_SYS_DICTIONARY COMPANYTYPE = cbxCompanyType.SelectedItem as T_SYS_DICTIONARY;
            T_SYS_DICTIONARY COUNTYTYPE = cbxCountry.SelectedItem as T_SYS_DICTIONARY;
            T_SYS_DICTIONARY COMPANYLEVEL = cbxCompanyLevel.SelectedItem as T_SYS_DICTIONARY;
            T_SYS_DICTIONARY CITY = cbxCity.SelectedItem as T_SYS_DICTIONARY;
            T_SYS_DICTIONARY Province = cbxProvince.SelectedItem as T_SYS_DICTIONARY;

            decimal? stateValue = Convert.ToDecimal("1");
            string checkState = string.Empty;
            SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY checkStateDict = (Application.Current.Resources["SYS_DICTIONARY"] as List<SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY>).Where(s => s.DICTIONCATEGORY == "CHECKSTATE" && s.DICTIONARYVALUE == stateValue).FirstOrDefault();
            checkState = checkStateDict == null ? "" : checkStateDict.DICTIONARYNAME;

            SMT.SaaS.MobileXml.MobileXml mx = new SMT.SaaS.MobileXml.MobileXml();
            List<SMT.SaaS.MobileXml.AutoDictionary> AutoList = new List<SMT.SaaS.MobileXml.AutoDictionary>();
            AutoList.Add(basedata("T_HR_COMPANY", "CHECKSTATE", "1", checkState));
            AutoList.Add(basedata("T_HR_COMPANY", "COMPANYTYPE", COMPANYTYPE != null ? COMPANYTYPE.DICTIONARYVALUE.ToString() : "0", COMPANYTYPE != null ? COMPANYTYPE.DICTIONARYNAME : ""));
            AutoList.Add(basedata("T_HR_COMPANY", "COUNTYTYPE", COUNTYTYPE != null ? COUNTYTYPE.DICTIONARYVALUE.ToString() : "0", COUNTYTYPE != null ? COUNTYTYPE.DICTIONARYNAME : ""));
            AutoList.Add(basedata("T_HR_COMPANY", "COMPANYLEVEL", COMPANYLEVEL != null ? COMPANYLEVEL.DICTIONARYVALUE.ToString() : "0", COMPANYLEVEL != null ? COMPANYLEVEL.DICTIONARYNAME : ""));
            AutoList.Add(basedata("T_HR_COMPANY", "CITY", CITY != null ? CITY.DICTIONARYVALUE.ToString() : "0", CITY != null ? CITY.DICTIONARYNAME : ""));
            AutoList.Add(basedata("T_HR_COMPANY", "OWNERPROVINCE", Province != null ? Province.DICTIONARYVALUE.ToString() : "0", Province != null ? Province.DICTIONARYNAME : ""));
            AutoList.Add(basedata("T_HR_COMPANY", "SORTINDEX", txtSortNumber.Value.ToString(), ""));
            if (Info.FATHERTYPE == "0")
            {
                AutoList.Add(basedata("T_HR_COMPANY", "SUPERIORORG", Info.FATHERID, lkParentCompany.TxtLookUp.Text));
            }
            else
            {
                AutoList.Add(basedata("T_HR_COMPANY", "SUPERIORDEPARTMENT", Info.FATHERID, lkParentDepartment.TxtLookUp.Text));
            }
            //AutoList.Add(basedata("T_OA_APPROVALINFO", "CONTENT", approvalInfo.APPROVALID, approvalInfo.APPROVALID));
            //AutoList.Add(basedata("T_OA_APPROVALINFO", "AttachMent", approvalInfo.APPROVALID, approvalInfo.APPROVALID));

            string a = mx.TableToXml(Info, null, StrSource, AutoList);

            return a;
        }
Exemplo n.º 49
0
 private void btnEditIndex_Click(object sender, RoutedEventArgs e)
 {
     T_HR_COMPANY temp = new T_HR_COMPANY();
     temp.COMPANYID = Company.COMPANYID;
     temp.SORTINDEX = Company.SORTINDEX;
     string strMsg = string.Empty;
     RefreshUI(RefreshedTypes.ShowProgressBar);
     client.CompanyIndexUpdateAsync(temp, strMsg);
 }
Exemplo n.º 50
0
        /// <summary>
        /// 添加所有项
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AddAllBtn_Click(object sender, RoutedEventArgs e)
        {
            //SecondCompany.Items.Clear();
            if (FirstComany.Items.Count > 0)
            {
                foreach (var obj in FirstComany.Items)
                {
                    T_HR_COMPANY selectcompany = new T_HR_COMPANY();
                    selectcompany = obj as T_HR_COMPANY;

                    SecondCompany.Items.Add(selectcompany);

                    //FirstComany.Items.Remove(selectcompany);

                }
                FirstComany.Items.Clear();
            }
        }
Exemplo n.º 51
0
        /// <summary>
        /// 获取公司
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void client_GetCompanyByIdCompleted(object sender, GetCompanyByIdCompletedEventArgs e)
        {
            T_HR_COMPANY cp = new T_HR_COMPANY();
            if (e.Error != null && e.Error.Message != "")
            {
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERRORINFO"),
                            Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
            }
            else
            {
                if (e.Result == null)
                {
                    return;
                }
                cp = e.Result;

                lkFather.DisplayMemberPath = "CNAME";
                lkFather.DataContext = cp;

            }
        }
Exemplo n.º 52
0
        /// <summary>
        /// 删除选中项
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DelBtn_Click(object sender, RoutedEventArgs e)
        {
            if (SecondCompany.SelectedItems.Count > 0)
            {
                
                T_HR_COMPANY selectcompany = new T_HR_COMPANY();
                selectcompany = SecondCompany.SelectedItem as T_HR_COMPANY;
                
                SecondCompany.Items.Remove(selectcompany);
                FirstComany.Items.Add(selectcompany);
                


            }
            else
            {
                Utility.ShowCustomMessage(MessageTypes.Caution, "CAUTION", "请选择公司");
            }
            
            SecondCompany.DisplayMemberPath = "CNAME";
        }
Exemplo n.º 53
0
        void organClient_GetALLCompanyViewCompleted(object sender, GetALLCompanyViewCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                if (e.Result != null)
                {
                    List<V_COMPANY> entTemps = e.Result.ToList();
                    allCompanys = new List<T_HR_COMPANY>();
                    var ents = entTemps.OrderBy(c => c.FATHERID);
                    foreach (var ent in ents)
                    {
                        T_HR_COMPANY company = new T_HR_COMPANY();
                        company.COMPANYID = ent.COMPANYID;
                        company.CNAME = ent.CNAME;
                        company.ENAME = ent.ENAME;
                        if (!string.IsNullOrEmpty(ent.BRIEFNAME))
                        {
                            company.BRIEFNAME = ent.BRIEFNAME;
                        }
                        else
                        {
                            company.BRIEFNAME = ent.CNAME;
                        }

                        company.COMPANRYCODE = ent.COMPANRYCODE;
                        company.SORTINDEX = ent.SORTINDEX;
                        if (!string.IsNullOrEmpty(ent.FATHERCOMPANYID))
                        {
                            company.T_HR_COMPANY2 = new T_HR_COMPANY();
                            company.T_HR_COMPANY2.COMPANYID = ent.FATHERCOMPANYID;
                            company.T_HR_COMPANY2.CNAME = entTemps.Where(s => s.COMPANYID == ent.FATHERCOMPANYID).FirstOrDefault().CNAME;
                        }
                        company.FATHERID = ent.FATHERID;
                        company.FATHERTYPE = ent.FATHERTYPE;
                        company.CHECKSTATE = ent.CHECKSTATE;
                        company.EDITSTATE = ent.EDITSTATE;
                        allCompanys.Add(company);
                    }
                    if (App.Current.Resources["SYS_CompanyInfo"] != null)
                    {
                        App.Current.Resources.Remove("SYS_CompanyInfo");
                        App.Current.Resources.Add("SYS_CompanyInfo", allCompanys);
                    }
                    else
                    {
                        App.Current.Resources.Add("SYS_CompanyInfo", allCompanys);
                    }

                    organClient.GetAllDepartmentViewAsync("");
                }
            }
        }
Exemplo n.º 54
0
        /// <summary>
        /// 删除所有项
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DelAllBtn_Click(object sender, RoutedEventArgs e)
        {
            foreach (var obj in SecondCompany.Items)
            {
                T_HR_COMPANY selectcompany = new T_HR_COMPANY();
                selectcompany = obj as T_HR_COMPANY;

                FirstComany.Items.Add(selectcompany);

            }
            SecondCompany.Items.Clear();
            this.FirstComany.DisplayMemberPath = "CNAME";

        }
Exemplo n.º 55
0
 void DtGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     DataGrid grid = sender as DataGrid;
     if (grid.SelectedItem != null)
     {
         SelectCompany = grid.SelectedItems[0] as T_HR_COMPANY;
     }
 }
Exemplo n.º 56
0
 public void CompanyIndexUpdate(T_HR_COMPANY entity, ref string strMsg)
 {
     using (CompanyBLL bll = new CompanyBLL())
     {
         bll.CompanyIndexUpdate(entity, ref strMsg);
     }
 }
Exemplo n.º 57
0
 void Organ_GetCompanyByIdCompleted(object sender, GetCompanyByIdCompletedEventArgs e)
 {
     if (!e.Cancelled)
     {
         if (e.Result != null)
         {
             T_HR_COMPANY company = new T_HR_COMPANY();
             company = e.Result;
             StrCompanyId = company.COMPANYID;
             CompanyObject.Text = company.CNAME;
             //CompanyObject.DisplayMemberPath = "CNAME";
             //CompanyObject.DataContext = company;
         }
     }
 }
Exemplo n.º 58
0
 public bool CompanyCancel(T_HR_COMPANY entity, ref string strMsg)
 {
     using (CompanyBLL bll = new CompanyBLL())
     {
         return bll.CompanyCancel(entity, ref strMsg);
     }
 }
Exemplo n.º 59
0
        //获取发布对象
        void DocDistrbuteClient_GetDocDistrbuteInfosCompleted(object sender, GetDocDistrbuteInfosCompletedEventArgs e)
        {
            try
            {
                if (e.Error == null)
                {
                    if (e.Result != null)
                    {
                        List<SMT.SaaS.OA.UI.SmtOACommonOfficeService.T_OA_DISTRIBUTEUSER> distributeList = e.Result.ToList();

                        foreach (var h in distributeList)
                        {
                            object obj = new object();
                            SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj extOrgObj = new SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj();
                            if (h.VIEWTYPE == ((int)SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Company).ToString())
                            {
                                T_HR_COMPANY tmp = new T_HR_COMPANY();
                                tmp.COMPANYID = h.VIEWER;
                                //tmp.CNAME = "";
                                tmp.CNAME = Utility.GetCompanyName(tmp.COMPANYID);
                                obj = tmp;
                            }
                            else if (h.VIEWTYPE == ((int)SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Department).ToString())
                            {
                                T_HR_DEPARTMENT tmp = new T_HR_DEPARTMENT();
                                tmp.DEPARTMENTID = h.VIEWER;
                                T_HR_DEPARTMENTDICTIONARY tmpdict = new T_HR_DEPARTMENTDICTIONARY();
                                //tmpdict.DEPARTMENTNAME = "";
                                tmpdict.DEPARTMENTNAME = Utility.GetDepartmentName(h.VIEWER);
                                tmp.T_HR_DEPARTMENTDICTIONARY = tmpdict;
                                obj = tmp;
                            }
                            else if (h.VIEWTYPE == ((int)SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Post).ToString())
                            {
                                T_HR_POST tmp = new T_HR_POST();
                                tmp.POSTLEVEL = System.Convert.ToDecimal(h.VIEWER);
                                T_HR_POSTDICTIONARY tmpdict = new T_HR_POSTDICTIONARY();
                                //tmpdict.POSTNAME = "";
                                tmpdict.POSTNAME = Utility.GetPostName(h.VIEWER);
                                tmp.T_HR_POSTDICTIONARY = tmpdict;

                                obj = tmp;
                            }
                            else if (h.VIEWTYPE == ((int)SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Personnel).ToString())
                            {
                                T_HR_EMPLOYEE tmp = new T_HR_EMPLOYEE();
                                tmp.EMPLOYEEID = h.VIEWER;
                                tmp.EMPLOYEECNAME = "";
                                obj = tmp;
                            }
                            extOrgObj.ObjectInstance = obj;

                            issuanceExtOrgObj.Add(extOrgObj);
                        }
                        BindData();
                    }
                }
                else
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), e.Error.Message);
            }
            catch (Exception ex)
            {
                //HtmlPage.Window.Alert(ex.ToString());
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(ex.Message.ToString()));
            }
        }
Exemplo n.º 60
0
 /// <summary>
 /// 效验LookUp所选的公司是否为合法的上级公司
 /// </summary>
 /// <param name="ent"></param>
 private void HandleParentComapnyChanged(T_HR_COMPANY ent)
 {
     if (Company.COMPANYID != ent.COMPANYID)
     {
         client.IsChildCompanyAsync(Company.COMPANYID, ent.COMPANYID, ent);
     }
     else
     {
         //MessageBox.Show("不能选自己作为父公司!");
         //  Utility.ShowCustomMessage(MessageTypes.Caution, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("CANNOTBESELFFATHERCOMPANY"));
         ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("CAUTION"), Utility.GetResourceStr("CANNOTBESELFFATHERCOMPANY"),
    Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
     }
 }