Exemplo n.º 1
0
        /// <summary>
        /// 获取方案ID
        /// </summary>
        /// <param name="sType">0 公司 , 1 部门 ,2 岗位</param>
        /// <param name="ID"></param>
        /// <returns></returns>
        public string GetSolutionIDByIDType(int sType, string ID)
        {
            SalarySolutionAssignBLL bll = new SalarySolutionAssignBLL();
            string solutionID           = bll.GetSolutionIDByAssignObjectID(ID);

            if (string.IsNullOrEmpty(solutionID))
            {
                if (sType == 2)
                {
                    PostBLL   pbll = new PostBLL();
                    T_HR_POST post = pbll.GetPostById(ID);
                    solutionID = bll.GetSolutionIDByAssignObjectID(post.T_HR_DEPARTMENT.DEPARTMENTID);
                    if (string.IsNullOrEmpty(solutionID))
                    {
                        solutionID = bll.GetSolutionIDByAssignObjectID(post.T_HR_DEPARTMENT.T_HR_COMPANY.COMPANYID);
                    }
                }

                else if (sType == 1)
                {
                    DepartmentBLL   dbll       = new DepartmentBLL();
                    T_HR_DEPARTMENT department = dbll.GetDepartmentById(ID);
                    solutionID = bll.GetSolutionIDByAssignObjectID(department.T_HR_COMPANY.COMPANYID);
                }
            }

            return(solutionID);
        }
Exemplo n.º 2
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.º 3
0
 public void PostUpdate(T_HR_POST entity, ref string strMsg)
 {
     using (PostBLL bll = new PostBLL())
     {
         bll.PostUpdate(entity, ref strMsg);
     }
 }
Exemplo n.º 4
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.º 5
0
 public void PostCancel(T_HR_POST postID, ref string strMsg)
 {
     using (PostBLL bll = new PostBLL())
     {
         bll.PostCancel(postID, ref strMsg);
     }
 }
Exemplo n.º 6
0
        void DtGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            DataGrid grid = sender as DataGrid;

            if (grid.SelectedItem != null)
            {
                SelectPost = grid.SelectedItems[0] as T_HR_POST;
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// 获取岗位
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void client_GetAllPostViewCompleted(object sender, GetAllPostViewCompletedEventArgs e)
        {
            try
            {
                if (e.Error == null)
                {
                    if (e.Result != null)
                    {
                        List <V_POST>    vpostList = e.Result.ToList();
                        List <T_HR_POST> entlist   = new List <T_HR_POST>();
                        foreach (var ent in vpostList)
                        {
                            T_HR_POST pt = new T_HR_POST();
                            pt.POSTID       = ent.POSTID;
                            pt.FATHERPOSTID = ent.FATHERPOSTID;
                            pt.CHECKSTATE   = ent.CHECKSTATE;
                            pt.EDITSTATE    = ent.EDITSTATE;

                            pt.T_HR_POSTDICTIONARY = new T_HR_POSTDICTIONARY();
                            // pt.T_HR_POSTDICTIONARY.POSTDICTIONARYID = ent.POSTDICTIONARYID;
                            pt.T_HR_POSTDICTIONARY.POSTNAME = ent.POSTNAME;

                            // pt.T_HR_DEPARTMENT = new T_HR_DEPARTMENT();
                            pt.T_HR_DEPARTMENT = allDepartments.Where(s => s.DEPARTMENTID == ent.DEPARTMENTID).FirstOrDefault();

                            //pt.T_HR_DEPARTMENT = new T_HR_DEPARTMENT();
                            //pt.T_HR_DEPARTMENT.DEPARTMENTID = ent.DEPARTMENTID;

                            //pt.T_HR_DEPARTMENT.T_HR_DEPARTMENTDICTIONARY = new T_HR_DEPARTMENTDICTIONARY();
                            //pt.T_HR_DEPARTMENT.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTDICTIONARYID = Guid.NewGuid().ToString();
                            // pt.T_HR_DEPARTMENT.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME = ent.DEPARTMENTNAME;

                            // pt.T_HR_DEPARTMENT.T_HR_COMPANY = new T_HR_COMPANY();
                            // pt.T_HR_DEPARTMENT.T_HR_COMPANY.COMPANYID = ent.COMPANYID;
                            //  pt.T_HR_DEPARTMENT.T_HR_COMPANY.CNAME = ent.CNAME;

                            entlist.Add(pt);
                        }
                        UICache.CreateCache("ORGTREESYSPostInfo", entlist);
                    }
                    //  BindPosition();
                }
                else
                {
                    loadbar.Stop();
                    ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERRORINFO"),
                                                   Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                }
            }
            catch (Exception ex)
            {
            }
        }
Exemplo n.º 8
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="type"></param>
        /// <param name="strID"></param>
        /// <param name="PostID">当前岗位ID</param>
        public RelationPostForm(SMT.SaaS.FrameworkUI.FormTypes type, string strID,T_HR_POST post)
        {
            InitializeComponent();
            FormType = type;
            Post = post;
            InitParas(strID);

            if (Post != null)
            {
                txtPostCode.Text = Post.T_HR_POSTDICTIONARY.POSTCODE;
                txtPostName.Text = Post.T_HR_POSTDICTIONARY.POSTNAME;
            }
        }
Exemplo n.º 9
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="type"></param>
        /// <param name="strID"></param>
        /// <param name="PostID">当前岗位ID</param>
        public RelationPostForm(SMT.SaaS.FrameworkUI.FormTypes type, string strID, T_HR_POST post)
        {
            InitializeComponent();
            FormType = type;
            Post     = post;
            InitParas(strID);

            if (Post != null)
            {
                txtPostCode.Text = Post.T_HR_POSTDICTIONARY.POSTCODE;
                txtPostName.Text = Post.T_HR_POSTDICTIONARY.POSTNAME;
            }
        }
Exemplo n.º 10
0
        void client_GetPostViewCompleted(object sender, GetPostViewCompletedEventArgs e)
        {
            try
            {
                if (e.Error == null)
                {
                    if (e.Result != null)
                    {
                        List <V_POST>    vpostList = e.Result.ToList();
                        List <T_HR_POST> entlist   = new List <T_HR_POST>();
                        foreach (var ent in vpostList)
                        {
                            T_HR_POST pt = new T_HR_POST();
                            pt.POSTID       = ent.POSTID;
                            pt.FATHERPOSTID = ent.FATHERPOSTID;
                            pt.CHECKSTATE   = ent.CHECKSTATE;
                            pt.EDITSTATE    = ent.EDITSTATE;

                            pt.T_HR_POSTDICTIONARY = new T_HR_POSTDICTIONARY();
                            // pt.T_HR_POSTDICTIONARY.POSTDICTIONARYID = ent.POSTDICTIONARYID;
                            pt.T_HR_POSTDICTIONARY.POSTNAME = ent.POSTNAME;

                            // pt.T_HR_DEPARTMENT = new T_HR_DEPARTMENT();
                            pt.T_HR_DEPARTMENT = allDepartments.Where(s => s.DEPARTMENTID == ent.DEPARTMENTID).FirstOrDefault();

                            //pt.T_HR_DEPARTMENT = new T_HR_DEPARTMENT();
                            //pt.T_HR_DEPARTMENT.DEPARTMENTID = ent.DEPARTMENTID;

                            //pt.T_HR_DEPARTMENT.T_HR_DEPARTMENTDICTIONARY = new T_HR_DEPARTMENTDICTIONARY();
                            //pt.T_HR_DEPARTMENT.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTDICTIONARYID = Guid.NewGuid().ToString();
                            // pt.T_HR_DEPARTMENT.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME = ent.DEPARTMENTNAME;

                            // pt.T_HR_DEPARTMENT.T_HR_COMPANY = new T_HR_COMPANY();
                            // pt.T_HR_DEPARTMENT.T_HR_COMPANY.COMPANYID = ent.COMPANYID;
                            //  pt.T_HR_DEPARTMENT.T_HR_COMPANY.CNAME = ent.CNAME;

                            entlist.Add(pt);
                        }
                        UICache.CreateCache("ORGTREESYSPostInfo" + Perm + Entity, entlist);
                    }
                    //  BindPosition();
                }
            }
            catch (Exception ex)
            {
            }
            loadbar.Stop();
        }
Exemplo n.º 11
0
        private OrganizationWS.T_HR_POST BindEmployeePost(TreeViewItem item)
        {
            T_HR_POST tempPost = new T_HR_POST();

            if (item == null || item.Parent == null)
            {
                return(null);
            }
            if (((ExtOrgObj)(((TreeViewItem)item.Parent).DataContext)).ObjectType == OrgTreeItemTypes.Post)
            {
                tempPost = ((ExtOrgObj)((TreeViewItem)item.Parent).DataContext).ObjectInstance as OrganizationWS.T_HR_POST;
            }
            if (((ExtOrgObj)(((TreeViewItem)((TreeViewItem)item.Parent).Parent).DataContext)).ObjectType == OrgTreeItemTypes.Department)
            {
                tempPost.T_HR_DEPARTMENT = ((ExtOrgObj)(((TreeViewItem)((TreeViewItem)item.Parent).Parent).DataContext)).ObjectInstance as OrganizationWS.T_HR_DEPARTMENT;
            }
            return(tempPost);
        }
Exemplo n.º 12
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.º 13
0
        void organClient_GetAllPostViewCompleted(object sender, GetAllPostViewCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                if (e.Result != null)
                {
                    List <V_POST> vpostList = e.Result.ToList();
                    entlist = new List <T_HR_POST>();
                    foreach (var ent in vpostList)
                    {
                        T_HR_POST pt = new T_HR_POST();
                        pt.POSTID       = ent.POSTID;
                        pt.FATHERPOSTID = ent.FATHERPOSTID;
                        pt.CHECKSTATE   = ent.CHECKSTATE;
                        pt.EDITSTATE    = ent.EDITSTATE;

                        pt.T_HR_POSTDICTIONARY = new T_HR_POSTDICTIONARY();
                        pt.T_HR_POSTDICTIONARY.POSTDICTIONARYID = Guid.NewGuid().ToString();
                        pt.T_HR_POSTDICTIONARY.POSTNAME         = ent.POSTNAME;

                        pt.T_HR_DEPARTMENT = new T_HR_DEPARTMENT();
                        pt.T_HR_DEPARTMENT = allDepartments.Where(s => s.DEPARTMENTID == ent.DEPARTMENTID).FirstOrDefault();

                        entlist.Add(pt);
                    }
                    if (App.Current.Resources["SYS_PostInfo"] != null)
                    {
                        App.Current.Resources.Remove("SYS_PostInfo");
                        App.Current.Resources.Add("SYS_PostInfo", entlist);
                    }
                    else
                    {
                        App.Current.Resources.Add("SYS_PostInfo", entlist);
                    }
                }
            }
            //this.Loaded += new RoutedEventHandler(BusinessApplicationsForm_Loaded);
            loadbar.Start();
            DetailSendClient.GetSendDocSingleInfoByIdAsync(TmpSendoc);
        }
Exemplo n.º 14
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.º 15
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.º 16
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.º 17
0
        private void LookUp_FindClick(object sender, EventArgs e)
        {
            Dictionary <string, string> cols = new Dictionary <string, string>();

            cols.Add("POSTCODE", "T_HR_POSTDICTIONARY.POSTCODE");
            cols.Add("POSTNAME", "T_HR_POSTDICTIONARY.POSTNAME");

            LookupForm lookup = new LookupForm(EntityNames.Post,
                                               typeof(T_HR_POST[]), cols);

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

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

            lookup.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => {});
        }
Exemplo n.º 18
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.º 19
0
 private void AddDistributeObjList(SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj issuanceExtOrgObj, string issuanceID)
 {
     SMT.SaaS.OA.UI.SmtOACommonOfficeService.T_OA_DISTRIBUTEUSER distributeTmp = new SMT.SaaS.OA.UI.SmtOACommonOfficeService.T_OA_DISTRIBUTEUSER();
     distributeTmp.DISTRIBUTEUSERID = Guid.NewGuid().ToString();
     distributeTmp.MODELNAME        = "EmployeeSurveyApp";
     distributeTmp.FORMID           = issuanceID;
     distributeTmp.VIEWTYPE         = ((int)GetObjectType(issuanceExtOrgObj)).ToString();
     if (distributeTmp.VIEWTYPE == ((int)IssuanceObjectType.Post).ToString())    //如果是选择岗位,则保存岗位级别
     {
         T_HR_POST hr = (T_HR_POST)issuanceExtOrgObj.ObjectInstance;
         if (!string.IsNullOrEmpty(hr.POSTLEVEL.ToString()))
         {
             distributeTmp.VIEWER = hr.POSTLEVEL.ToString();
         }
         else
         {
             distributeTmp.VIEWER = hr.T_HR_POSTDICTIONARY.POSTLEVEL.ToString();
         }
     }
     else
     {
         distributeTmp.VIEWER = issuanceExtOrgObj.ObjectID;
     }
     distributeTmp.CREATEDATE         = DateTime.Now;
     distributeTmp.CREATEUSERID       = Common.CurrentLoginUserInfo.EmployeeID;
     distributeTmp.CREATEUSERNAME     = Common.CurrentLoginUserInfo.EmployeeName;
     distributeTmp.CREATEPOSTID       = Common.CurrentLoginUserInfo.UserPosts[0].PostID;
     distributeTmp.CREATEDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
     distributeTmp.CREATECOMPANYID    = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
     distributeTmp.OWNERID            = Common.CurrentLoginUserInfo.EmployeeID;
     distributeTmp.OWNERNAME          = Common.CurrentLoginUserInfo.EmployeeName;
     distributeTmp.OWNERPOSTID        = Common.CurrentLoginUserInfo.UserPosts[0].PostID;
     distributeTmp.OWNERDEPARTMENTID  = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
     distributeTmp.OWNERCOMPANYID     = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
     distributeLists.Add(distributeTmp);
 }
Exemplo n.º 20
0
        private void HandlePostChanged(OrganizationWS.T_HR_POST ent)
        {
            lkPost.DataContext = ent;
            T_HR_POST temp = new T_HR_POST();

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

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

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

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

            foreach (T_SYS_DICTIONARY item in cbxPostLevel.Items)
            {
                if (item.DICTIONARYVALUE == ent.POSTLEVEL)
                {
                    cbxPostLevel.SelectedItem = item;
                    break;
                }
            }
        }
Exemplo n.º 21
0
        private void HandlePostChanged(OrganizationWS.T_HR_POST ent)
        {
            lkPost.DataContext = ent;
            T_HR_POST temp = new T_HR_POST();
            temp.POSTID = ent.POSTID;
            EmployeePost.T_HR_POST = temp;
            companyID = ent.T_HR_DEPARTMENT.T_HR_COMPANY.COMPANYID;
            //txtCompanyName.Text = ent.T_HR_DEPARTMENT.T_HR_COMPANY.CNAME;
            //txtDepartment.Text = ent.T_HR_DEPARTMENT.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME;
            SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT fartherdep = ent.T_HR_DEPARTMENT;
            string orgname = ent.T_HR_POSTDICTIONARY.POSTNAME + GetFullOrgName(fartherdep);
            lkPost.TxtLookUp.Text = orgname;
            SysUser.OWNERCOMPANYID = ent.T_HR_DEPARTMENT.T_HR_COMPANY.COMPANYID;
            SysUser.OWNERDEPARTMENTID = ent.T_HR_DEPARTMENT.DEPARTMENTID;
            SysUser.OWNERPOSTID = ent.POSTID;

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

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

            foreach (T_SYS_DICTIONARY item in cbxPostLevel.Items)
            {
                if (item.DICTIONARYVALUE == ent.POSTLEVEL)
                {
                    cbxPostLevel.SelectedItem = item;
                    break;
                }
            }
        }
Exemplo n.º 22
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.º 23
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 = "";
                                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 = "";
                                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 = "";
                                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.º 24
0
        /// <summary>
        /// 获取岗位
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void client_GetAllPostViewCompleted(object sender, GetAllPostViewCompletedEventArgs e)
        {
            try
            {
                if (e.Error == null)
                {

                    if (e.Result != null)
                    {
                        List<V_POST> vpostList = e.Result.ToList();
                        List<T_HR_POST> entlist = new List<T_HR_POST>();
                        foreach (var ent in vpostList)
                        {
                            T_HR_POST pt = new T_HR_POST();
                            pt.POSTID = ent.POSTID;
                            pt.FATHERPOSTID = ent.FATHERPOSTID;
                            pt.CHECKSTATE = ent.CHECKSTATE;
                            pt.EDITSTATE = ent.EDITSTATE;

                            pt.T_HR_POSTDICTIONARY = new T_HR_POSTDICTIONARY();
                            // pt.T_HR_POSTDICTIONARY.POSTDICTIONARYID = ent.POSTDICTIONARYID;
                            pt.T_HR_POSTDICTIONARY.POSTNAME = ent.POSTNAME;

                            // pt.T_HR_DEPARTMENT = new T_HR_DEPARTMENT();
                            pt.T_HR_DEPARTMENT = allDepartments.Where(s => s.DEPARTMENTID == ent.DEPARTMENTID).FirstOrDefault();

                            //pt.T_HR_DEPARTMENT = new T_HR_DEPARTMENT();
                            //pt.T_HR_DEPARTMENT.DEPARTMENTID = ent.DEPARTMENTID;

                            //pt.T_HR_DEPARTMENT.T_HR_DEPARTMENTDICTIONARY = new T_HR_DEPARTMENTDICTIONARY();
                            //pt.T_HR_DEPARTMENT.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTDICTIONARYID = Guid.NewGuid().ToString();
                            // pt.T_HR_DEPARTMENT.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME = ent.DEPARTMENTNAME;

                            // pt.T_HR_DEPARTMENT.T_HR_COMPANY = new T_HR_COMPANY();
                            // pt.T_HR_DEPARTMENT.T_HR_COMPANY.COMPANYID = ent.COMPANYID;
                            //  pt.T_HR_DEPARTMENT.T_HR_COMPANY.CNAME = ent.CNAME;

                            entlist.Add(pt);
                        }
                        UICache.CreateCache("ORGTREESYSPostInfo", entlist);
                    }
                    //  BindPosition();
                }
                else
                {
                    loadbar.Stop();
                    ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERRORINFO"),
                           Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                }
            }
            catch (Exception ex)
            {
            }

        }
Exemplo n.º 25
0
        private void btnBalanceCalculate_Click(object sender, RoutedEventArgs e)
        {
            RefreshUI(RefreshedTypes.ShowProgressBar);
            if (cbxkAssignedObjectType.SelectedItem == null)
            {
                RefreshUI(RefreshedTypes.HideProgressBar);
                return;
            }

            if (lkAssignObject.DataContext == null)
            {
                RefreshUI(RefreshedTypes.HideProgressBar);
                return;
            }

            bool flag  = false;
            int  iYear = 0;

            flag = int.TryParse(txtBalanceYear.Text, out iYear);
            if (iYear <= 0)
            {
                RefreshUI(RefreshedTypes.HideProgressBar);
                return;
            }

            int iYearCheck = DateTime.Now.Year;

            if (iYear >= iYearCheck)
            {
                RefreshUI(RefreshedTypes.HideProgressBar);
                Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("OUTYEARLYBALANCE"));
                return;
            }

            T_SYS_DICTIONARY entDic = cbxkAssignedObjectType.SelectedItem as T_SYS_DICTIONARY;

            if (string.IsNullOrEmpty(entDic.DICTIONARYID) || string.IsNullOrEmpty(entDic.DICTIONCATEGORY) || string.IsNullOrEmpty(entDic.DICTIONARYVALUE.ToString()))
            {
                RefreshUI(RefreshedTypes.HideProgressBar);
                return;
            }

            if (entDic.DICTIONARYVALUE.ToString() == (Convert.ToInt32(AssignedObjectType.Company) + 1).ToString())
            {
                T_HR_COMPANY entCompany   = lkAssignObject.DataContext as T_HR_COMPANY;
                string       strCompanyID = entCompany.COMPANYID;

                clientAtt.CalculateEmployeeAttendanceYearlyByCompanyIDAsync(iYear.ToString(), strCompanyID);
            }
            else if (entDic.DICTIONARYVALUE.ToString() == (Convert.ToInt32(AssignedObjectType.Department) + 1).ToString())
            {
                T_HR_DEPARTMENT entDepartment   = lkAssignObject.DataContext as T_HR_DEPARTMENT;
                string          strDepartmentID = entDepartment.DEPARTMENTID;

                clientAtt.CalculateEmployeeAttendanceYearlyByDepartmentIDAsync(iYear.ToString(), strDepartmentID);
            }
            else if (entDic.DICTIONARYVALUE.ToString() == (Convert.ToInt32(AssignedObjectType.Post) + 1).ToString())
            {
                T_HR_POST entPost   = lkAssignObject.DataContext as T_HR_POST;
                string    strPostID = entPost.POSTID;

                clientAtt.CalculateEmployeeAttendanceYearlyByPostIDAsync(iYear.ToString(), strPostID);
            }
        }
Exemplo n.º 26
0
        private T_HR_POST SetNewPostEntity(T_HR_POST entPost)
        {
            List<T_HR_COMPANY> entCompanyList = Application.Current.Resources["SYS_CompanyInfo"] as List<T_HR_COMPANY>;
            List<T_HR_DEPARTMENT> entDepartmentList = Application.Current.Resources["SYS_DepartmentInfo"] as List<T_HR_DEPARTMENT>;

            var q = from d in entDepartmentList
                    where d.DEPARTMENTID == entPost.T_HR_DEPARTMENT.DEPARTMENTID
                    select d;

            if (q.Count() == 0)
            {
                return entPost;
            }

            entPost.T_HR_DEPARTMENT = q.FirstOrDefault();

            return entPost;
        }
Exemplo n.º 27
0
        public void AddToClose()
        {
            //CustPerm.T_SYS_ENTITYMENU = cbxMenu.SelectedItem as T_SYS_ENTITYMENU;
            CustPerm.T_SYS_PERMISSION = cbxPerm.SelectedItem as T_SYS_PERMISSION;

            //绑定公司
            T_HR_COMPANY company = lkCompany.DataContext as T_HR_COMPANY;

            if (company == null || string.IsNullOrEmpty(company.COMPANYID) || string.IsNullOrEmpty(company.CNAME))
            {
                CustPerm.COMPANYID   = "";
                CustPerm.COMPANYNAME = "";
            }
            else
            {
                CustPerm.COMPANYID   = company.COMPANYID;
                CustPerm.COMPANYNAME = company.CNAME;
            }

            //绑定部门
            T_HR_DEPARTMENT depart = lkDepartment.DataContext as T_HR_DEPARTMENT;

            if (depart == null || depart.T_HR_DEPARTMENTDICTIONARY == null ||
                string.IsNullOrEmpty(depart.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME) ||
                string.IsNullOrEmpty(depart.DEPARTMENTID))
            {
                CustPerm.DEPARTMENTID   = "";
                CustPerm.DEPARTMENTNAME = "";
            }
            else
            {
                CustPerm.DEPARTMENTID   = depart.DEPARTMENTID;
                CustPerm.DEPARTMENTNAME = depart.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME;
            }


            //绑定岗位
            T_HR_POST post = lkPost.DataContext as T_HR_POST;

            if (post == null || post.T_HR_POSTDICTIONARY == null ||
                string.IsNullOrEmpty(post.T_HR_POSTDICTIONARY.POSTNAME) ||
                string.IsNullOrEmpty(post.POSTID))
            {
                CustPerm.POSTID   = "";
                CustPerm.POSTNAME = "";
            }
            else
            {
                CustPerm.POSTID   = post.POSTID;
                CustPerm.POSTNAME = post.T_HR_POSTDICTIONARY.POSTNAME;
            }

            if (FormTypes.New == this.FormType)
            {
                CustPerm.CREATEDATE = System.DateTime.Now;
                ///TODO增加修改人
                //CustPerm.CREATEUSER = Common.CurrentLoginUserInfo.sysuserID;
                ServiceClient.EntityMenuCustomPermAddAsync(this.CustPerm);
            }
            else
            {
                CustPerm.UPDATEDATE = System.DateTime.Now;
                ///TODO增加修改人
                //CustPerm.UPDATEUSER = Common.CurrentLoginUserInfo.sysuserID;
                ServiceClient.EntityMenuCustomPermUpdateAsync(this.CustPerm);
            }
            saveType = "1";
            RefreshUI(RefreshedTypes.All);
        }
Exemplo n.º 28
0
        void PostForm_Loaded(object sender, RoutedEventArgs e)
        {
            #region 新增
            if (FormType == FormTypes.Browse || FormType == FormTypes.Audit)
            {
                EnableControl();
            }
            #endregion
            if (FormType == FormTypes.New)
            {
                Post = new T_HR_POST();
                Post.POSTID = Guid.NewGuid().ToString();
                Post.CHECKSTATE = Convert.ToInt32(CheckStates.UnSubmit).ToString();
                createUserName = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeName;
                SetToolBar();
            }
            else
            {
                RefreshUI(RefreshedTypes.ShowProgressBar);
                client.GetPostByIdAsync(postID, "POST");
            }

            if (FormType != FormTypes.Browse)
            {
                //Load事件之后,加载完后获取到父控件
                EntityBrowser entBrowser = this.FindParentByType<EntityBrowser>();
                entBrowser.BtnSaveSubmit.Click -= new RoutedEventHandler(entBrowser.btnSubmit_Click);
                entBrowser.BtnSaveSubmit.Click += new RoutedEventHandler(BtnSaveSubmit_Click);
            }
        }
Exemplo n.º 29
0
 void client_GetPostByIdCompleted(object sender, GetPostByIdCompletedEventArgs e)
 {
     Post = e.Result;
 }
Exemplo n.º 30
0
        /// <summary>
        /// 读取指定路径的Excel,将数据导入到DataTable内(依靠Office组件读取)
        /// </summary>
        /// <param name="strPath"></param>
        /// <param name="strMsg"></param>
        /// <returns></returns>
        private List <T_HR_EMPLOYEEADDSUM> ImportDataFromFile(string strPath, Dictionary <string, string> paras, ref string strMsg, bool IsPreview)
        {
            List <T_HR_EMPLOYEEADDSUM> ListEmployeeAddSum = new List <T_HR_EMPLOYEEADDSUM>();

            Excel.Application xApp = new Excel.ApplicationClass();
            xApp.Visible = true;
            try
            {
                Excel.Workbook xBook = xApp.Workbooks._Open(strPath,
                                                            Missing.Value, Missing.Value, Missing.Value, Missing.Value
                                                            , Missing.Value, Missing.Value, Missing.Value, Missing.Value
                                                            , Missing.Value, Missing.Value, Missing.Value, Missing.Value);

                Excel.Worksheet xSheet = (Excel.Worksheet)xBook.Sheets[1];
                int             iCount = xSheet.UsedRange.Rows.Count;
                if (iCount < 1)
                {
                    strMsg = "员工加扣款导入失败:无导入数据";
                    Tracer.Debug(strMsg);
                    return(null);
                }

                for (int i = 0; i < iCount; i++)
                {
                    int iRowIndex = i + 2;  //Excel起始列从1开始计数,首列为标题列,因此数据列计数应先加2
                    if (iRowIndex > iCount)
                    {
                        break;
                    }
                    Excel.Range rngCompany      = (Excel.Range)xSheet.Cells[iRowIndex, 1]; //所属公司
                    Excel.Range rngDep          = (Excel.Range)xSheet.Cells[iRowIndex, 2]; //所属部门
                    Excel.Range rngPost         = (Excel.Range)xSheet.Cells[iRowIndex, 3]; //所属岗位
                    Excel.Range rngEmpName      = (Excel.Range)xSheet.Cells[iRowIndex, 4]; //员工姓名
                    Excel.Range rngImpType      = (Excel.Range)xSheet.Cells[iRowIndex, 5]; //处理类型
                    Excel.Range rngProjectName  = (Excel.Range)xSheet.Cells[iRowIndex, 6]; //项目名
                    Excel.Range rngProjectValue = (Excel.Range)xSheet.Cells[iRowIndex, 7]; //项目金额
                    Excel.Range rngRemark       = (Excel.Range)xSheet.Cells[iRowIndex, 8]; //备注


                    T_HR_EMPLOYEEADDSUM employeeAddSum = new T_HR_EMPLOYEEADDSUM();
                    employeeAddSum.ADDSUMID = Guid.NewGuid().ToString();
                    //公司
                    T_HR_COMPANY com = null;
                    if (rngCompany.Text != null)
                    {
                        string cname = rngCompany.Text.ToString().Trim();
                        com = (from ent in dal.GetObjects <T_HR_COMPANY>()
                               where ent.CNAME == cname
                               select ent).FirstOrDefault();
                        if (com != null)
                        {
                            employeeAddSum.OWNERCOMPANYID = com.COMPANYID;
                        }
                        else
                        {
                            strMsg = "员工加扣款导入失败:行号:" + iRowIndex + " 列号:1 导入的公司系统中不存在";
                            Tracer.Debug(strMsg);
                            break;
                        }
                    }
                    else
                    {
                        strMsg = "员工加扣款导入失败:行号:" + iRowIndex + " 列号:1 值为空";
                        Tracer.Debug(strMsg);
                        break;
                    }

                    //部门
                    T_HR_DEPARTMENT dep = null;
                    if (rngDep.Text != null)
                    {
                        string depname = rngDep.Text.ToString().Trim();
                        dep = (from ent in dal.GetObjects <T_HR_DEPARTMENT>().Include("T_HR_DEPARTMENTDICTIONARY")
                               where ent.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME == depname &&
                               ent.T_HR_COMPANY.COMPANYID == com.COMPANYID
                               select ent).FirstOrDefault();
                        if (dep != null)
                        {
                            employeeAddSum.OWNERDEPARTMENTID = dep.DEPARTMENTID;
                        }
                        else
                        {
                            strMsg = "员工加扣款导入失败:行号:" + iRowIndex + " 列号:2 导入的部门系统中不存在";
                            Tracer.Debug(strMsg);
                            break;
                        }
                    }
                    else
                    {
                        strMsg = "员工加扣款导入失败:行号:" + iRowIndex + " 列号:2 值为空 部门名称为空";
                        Tracer.Debug(strMsg);
                        break;
                    }
                    //岗位
                    T_HR_POST pos = null;
                    if (rngPost.Text != null)
                    {
                        string postname = rngPost.Text.ToString().Trim();
                        pos = (from ent in dal.GetObjects <T_HR_POST>().Include("T_HR_POSTDICTIONARY")
                               where ent.T_HR_POSTDICTIONARY.POSTNAME == postname &&
                               ent.T_HR_DEPARTMENT.DEPARTMENTID == dep.DEPARTMENTID &&
                               ent.COMPANYID == com.COMPANYID
                               select ent).FirstOrDefault();
                        if (pos != null)
                        {
                            employeeAddSum.OWNERPOSTID = pos.POSTID;
                        }
                        else
                        {
                            strMsg = "员工加扣款导入失败:行号:" + iRowIndex + " 列号:3 导入的岗位系统不存在";
                            Tracer.Debug(strMsg);
                            break;
                        }
                    }
                    else
                    {
                        strMsg = "员工加扣款导入失败:行号:" + iRowIndex + " 列号:3 值为空 部门名称为空";
                        Tracer.Debug(strMsg);
                        break;
                    }

                    //员工
                    T_HR_EMPLOYEE employee = null;
                    if (rngEmpName.Text != null)
                    {
                        string employeeName = rngEmpName.Text.ToString().Trim();

                        employee = (from ent in dal.GetObjects <T_HR_EMPLOYEE>()
                                    join empPost in dal.GetObjects <T_HR_EMPLOYEEPOST>() on ent.EMPLOYEEID equals empPost.T_HR_EMPLOYEE.EMPLOYEEID
                                    join post in dal.GetObjects <T_HR_POST>() on empPost.T_HR_POST.POSTID equals post.POSTID
                                    where ent.EMPLOYEECNAME == employeeName && post.POSTID == pos.POSTID
                                    select ent).FirstOrDefault();
                        if (employee != null)
                        {
                            employeeAddSum.OWNERID      = employee.EMPLOYEEID;
                            employeeAddSum.EMPLOYEEID   = employee.EMPLOYEEID;
                            employeeAddSum.EMPLOYEENAME = employee.EMPLOYEECNAME;
                        }
                        else
                        {
                            strMsg = "员工加扣款导入失败:行号:" + iRowIndex + " 列号:4 导入的员工系统不存在";
                            Tracer.Debug(strMsg);
                            break;
                        }
                    }
                    else
                    {
                        strMsg = "员工加扣款导入失败:行号:" + iRowIndex + " 列号:4 值为空 员工名称为空";
                        Tracer.Debug(strMsg);
                        break;
                    }
                    //处理类型:
                    if (rngImpType.Text != null)
                    {
                        switch (rngImpType.Text.ToString().Trim())
                        {
                        case "员工加扣款":
                            employeeAddSum.SYSTEMTYPE = "0";
                            break;

                        case "员工代扣款":
                            employeeAddSum.SYSTEMTYPE = "1";
                            break;

                        case "绩效奖金":
                            employeeAddSum.SYSTEMTYPE = "2";
                            break;

                        case "其他......":
                            employeeAddSum.SYSTEMTYPE = "3";
                            break;
                        }
                    }
                    else
                    {
                        strMsg = "员工加扣款导入失败:行号:" + iRowIndex + " 列号:5 值为空 处理类型为空";
                        Tracer.Debug(strMsg);
                        break;
                    }
                    //项目名
                    if (rngProjectName.Text != null)
                    {
                        employeeAddSum.PROJECTNAME = rngProjectName.Text.ToString().Trim();
                    }
                    else
                    {
                        strMsg = "员工加扣款导入失败:行号:" + iRowIndex + " 列号:6 值为空 项目名称为空";
                        Tracer.Debug(strMsg);
                        break;
                    }

                    //项目金额
                    if (rngProjectValue.Text != null)
                    {
                        employeeAddSum.PROJECTMONEY = decimal.Parse(rngProjectValue.Text.ToString().Trim());
                    }
                    else
                    {
                        strMsg = "员工加扣款导入失败:行号:" + iRowIndex + " 列号:7 值为空 项目金额为空";
                        Tracer.Debug(strMsg);
                        break;
                    }

                    //项目备注
                    if (rngRemark.Text != null)
                    {
                        employeeAddSum.REMARK = rngRemark.Text.ToString().Trim();
                    }
                    else
                    {
                        strMsg = "员工加扣款导入失败:行号:" + iRowIndex + " 列号:8 值为空 项目备注为空";
                        Tracer.Debug(strMsg);
                        break;
                    }
                    employeeAddSum.DEALYEAR  = paras["YEAR"].ToString();
                    employeeAddSum.DEALMONTH = paras["MONTH"].ToString();

                    employeeAddSum.CREATEUSERID       = paras["CREATEUSERID"].ToString();
                    employeeAddSum.CREATEPOSTID       = paras["CREATEPOSTID"].ToString();
                    employeeAddSum.CREATEDEPARTMENTID = paras["CREATEDEPARTMENTID"].ToString();
                    employeeAddSum.CREATECOMPANYID    = paras["CREATECOMPANYID"].ToString();


                    employeeAddSum.CREATEDATE = DateTime.Now;
                    employeeAddSum.UPDATEDATE = DateTime.Now;
                    employeeAddSum.CHECKSTATE = "0";//未提交
                    if (IsPreview == false)
                    {
                        dal.Add(employeeAddSum);
                    }
                    else
                    {
                        ListEmployeeAddSum.Add(employeeAddSum);
                    }
                }
            }
            catch (Exception ex)
            {
                Utility.SaveLog(ex.ToString());
            }
            finally
            {
                xApp.Quit();
            }

            return(ListEmployeeAddSum);
        }
Exemplo n.º 31
0
 private void HandlePostChanged(T_HR_POST ent)
 {
     //给关联岗位赋值
     RelationPost.RELATEPOSTID = ent.POSTID;
 }
Exemplo n.º 32
0
        /// <summary>
        /// 获取岗位
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void client_GetPostByIdCompleted(object sender, GetPostByIdCompletedEventArgs e)
        {
            T_HR_POST cp = new 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)
                {
                    return;
                }
                cp = e.Result;
                lkHead.DataContext = cp;

            }
        }
Exemplo n.º 33
0
 void DtGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     DataGrid grid = sender as DataGrid;
     if (grid.SelectedItem != null)
     {
         SelectPost = grid.SelectedItems[0] as T_HR_POST;
     }
 }
Exemplo n.º 34
0
        /// <summary>
        /// 根据id获取岗位
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void client_GetPostByIdCompleted(object sender, GetPostByIdCompletedEventArgs 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.UserState.ToString() == "POST")//加载岗位
                {
                    if (e.Result == null)
                    {
                        RefreshUI(RefreshedTypes.HideProgressBar);
                        ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("NOTFOUND"),
                           Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                        return;
                    }
                    Post = e.Result;

                    if (FormType == FormTypes.Resubmit)
                    {
                        lkCompany.IsEnabled=false;
                        lkDepart.IsEnabled = false;
                        cbxPosition.IsEnabled = false;
                        Post.CHECKSTATE = Convert.ToInt32(CheckStates.UnSubmit).ToString();
                        if (Post.EDITSTATE != Convert.ToInt32(EditStates.PendingCanceled).ToString())
                        {
                            Post.EDITSTATE = Convert.ToInt32(EditStates.UnActived).ToString();
                        }
                        //Post.CHECKSTATE = Convert.ToInt32(CheckStates.UnSubmit).ToString();
                        //if (Post.EDITSTATE == Convert.ToInt32(EditStates.Actived).ToString())
                        //{
                        //    Post.EDITSTATE = Convert.ToInt32(EditStates.PendingCanceled).ToString();
                        //}
                        //else
                        //{
                        //    Post.EDITSTATE = Convert.ToInt32(EditStates.UnActived).ToString();
                        //}

                    }
                    if (Post.PROSCENIUM == "1")
                    {
                        this.RbtNo.IsChecked = false;
                        this.rbtYes.IsChecked = true;
                    }
                    if (Post.BACKSTAGE == "1")
                    {
                        this.RbtNo.IsChecked = true;
                        this.rbtYes.IsChecked = false;
                    }
                    if (Post.ISCOREPERSONNEL.ToInt32() <= 0)
                    {
                        rbtYesCore.IsChecked = true;
                        rbtNoCore.IsChecked = false;
                    }
                    //是否为撤销,2为撤销中,3为已撤销
                    //if (Post.EDITSTATE == "3" || Post.EDITSTATE == "2")
                    //{
                    //    this.rbtYesCancel.IsChecked = true;
                    //}
                    //else
                    //{
                    //    this.rbtNoCancel.IsChecked = true;
                    //}
                    //if (Post.EDITSTATE=="2")
                    //{
                    //    this.tbTip.Visibility = Visibility.Visible;
                    //}
                    //显示岗位的公司
                    lkCompany.DataContext = Post.T_HR_DEPARTMENT.T_HR_COMPANY;
                    lkDepart.DataContext = Post.T_HR_DEPARTMENT;
                    lkDepart.TxtLookUp.Text = GetFullOrgName(post.T_HR_DEPARTMENT);
                    if (Post.CHECKSTATE != Convert.ToInt32(CheckStates.UnSubmit).ToString())
                    {
                        EnableControl();
                        //绑定岗位的部门 和字典
                        List<T_HR_POSTDICTIONARY> pdslist = new List<T_HR_POSTDICTIONARY>();
                        if (Post.T_HR_POSTDICTIONARY != null)
                        {
                            pdslist.Add(Post.T_HR_POSTDICTIONARY);
                            cbxPosition.ItemsSource = pdslist;
                            cbxPosition.DisplayMemberPath = "POSTNAME";
                            foreach (var item in cbxPosition.Items)
                            {
                                T_HR_POSTDICTIONARY dict = item as T_HR_POSTDICTIONARY;
                                if (dict != null)
                                {
                                    if (dict.POSTDICTIONARYID == Post.T_HR_POSTDICTIONARY.POSTDICTIONARYID)
                                    {
                                        cbxPosition.SelectedItem = item;
                                        break;
                                    }
                                }
                            }

                        }

                    }
                    else
                    {
                        //岗位字典
                        client.GetPostDictionaryByDepartmentDictionayIDAsync(Post.T_HR_DEPARTMENT.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTDICTIONARYID, "load");
                    }

                    if (!string.IsNullOrEmpty(post.FATHERPOSTID))
                    {
                        client.GetPostByIdAsync(post.FATHERPOSTID, "FATHERPOST");
                    }
                    if (Post.CHECKSTATE == Convert.ToInt32(CheckStates.Approved).ToString()
                    || Post.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(Post.CREATEUSERID);
                        personClient.GetEmployeeToEngineAsync(CreateUserIDs);
                    }
                }
                else if (e.UserState.ToString() == "FATHERPOST")//加载岗位的父岗位
                {
                    lkPost.DataContext = e.Result;
                }

            }
        }
Exemplo n.º 35
0
 void client_GetPostByIdCompleted(object sender, GetPostByIdCompletedEventArgs e)
 {
     Post = e.Result;
 }
Exemplo n.º 36
0
        public void UpdateEmployeeSalaryInfo(T_HR_EMPLOYEESALARYPOSTASIGN asign)
        {
            try
            {
                var balancePost = from c in dal.GetObjects <T_HR_BALANCEPOSTDETAIL>()
                                  where c.BALANCEPOSTASIGNID == asign.EMPLOYEESALARYPOSTASIGNID
                                  //&& c.SALARYSET =="1"
                                  select c;
                var entPosts = from p in dal.GetObjects <T_HR_POST>()
                               where p.POSTID == asign.BALANCEPOSTID
                               select p;
                string payCompanyId = string.Empty;
                if (entPosts.Count() > 0)
                {
                    T_HR_POST post = entPosts.FirstOrDefault();
                    if (post != null)
                    {
                        payCompanyId = post.OWNERCOMPANYID;
                    }
                    else
                    {
                        SMT.Foundation.Log.Tracer.Debug("UpdateEmployeeSalaryInfo获取岗位信息为空:");
                    }
                }
                else
                {
                    SMT.Foundation.Log.Tracer.Debug("UpdateEmployeeSalaryInfo获取岗位信息为空22222");
                }
                List <string> employeeIDs = new List <string>();
                //岗位ID集合
                List <string> SalarypostIDs     = new List <string>();
                List <string> AttendancepostIDs = new List <string>();
                if (balancePost.Count() > 0)
                {
                    foreach (var ent in balancePost)
                    {
                        employeeIDs.Add(ent.EMPLOYEEID);
                        if (ent.SALARYSET == "1")
                        {
                            //只有薪资岗位设置了才修改员工薪资档案中的结算岗位信息
                            SalarypostIDs.Add(ent.EMPLOYEEPOSTID);
                        }
                        if (ent.ATTENDANCESET == "1")
                        {
                            //考勤结算对应的岗位ID
                            AttendancepostIDs.Add(ent.EMPLOYEEPOSTID);
                        }
                        ent.EDITSTATE = "1";
                        dal.UpdateFromContext(ent);
                    }
                    #region 将原来的记录设置为失效

                    var balancePost1 = from c in dal.GetObjects <T_HR_BALANCEPOSTDETAIL>()
                                       //where employeeIDs.Contains(c.EMPLOYEEID)
                                       where SalarypostIDs.Contains(c.EMPLOYEEPOSTID) ||
                                       AttendancepostIDs.Contains(c.EMPLOYEEPOSTID)
                                       //&& c.SALARYSET == "1"
                                       select c;
                    //foreach (var id in employeeIDs)
                    //{
                    //    var entemployees = from ent in balancePost1
                    //                       where ent.EMPLOYEEID == id
                    //                       && ent.EDITSTATE == "1"
                    //                       orderby ent.CREATEDATE descending
                    //                       select ent;
                    //    if (entemployees.Count() > 0)
                    //    {
                    //        T_HR_BALANCEPOSTDETAIL updateDetail = entemployees.FirstOrDefault();
                    //        updateDetail.EDITSTATE = "0";
                    //        dal.UpdateFromContext(updateDetail);
                    //        SMT.Foundation.Log.Tracer.Debug(updateDetail.EMPLOYEENAME + updateDetail.BALANCEPOSTDETAIL + "已修改");
                    //    }
                    //}
                    foreach (var id in SalarypostIDs)
                    {
                        var entemployees = from ent in balancePost1
                                           where ent.EMPLOYEEPOSTID == id &&
                                           ent.EDITSTATE == "1"
                                           orderby ent.CREATEDATE descending
                                           select ent;
                        if (entemployees.Count() > 0)
                        {
                            T_HR_BALANCEPOSTDETAIL updateDetail = entemployees.FirstOrDefault();
                            updateDetail.EDITSTATE = "0";
                            dal.UpdateFromContext(updateDetail);
                            SMT.Foundation.Log.Tracer.Debug(updateDetail.EMPLOYEENAME + updateDetail.BALANCEPOSTDETAIL + "已修改");
                        }
                    }
                    //考勤设置对应的岗位ID
                    foreach (var id in AttendancepostIDs)
                    {
                        var entemployees = from ent in balancePost1
                                           where ent.EMPLOYEEPOSTID == id &&
                                           ent.EDITSTATE == "1"
                                           orderby ent.CREATEDATE descending
                                           select ent;
                        if (entemployees.Count() > 0)
                        {
                            T_HR_BALANCEPOSTDETAIL updateDetail = entemployees.FirstOrDefault();
                            updateDetail.EDITSTATE = "0";
                            dal.UpdateFromContext(updateDetail);
                            SMT.Foundation.Log.Tracer.Debug(updateDetail.EMPLOYEENAME + updateDetail.BALANCEPOSTDETAIL + "已修改");
                        }
                    }
                    #endregion
                }
                //var Salarys = from ent in dal.GetObjects<T_HR_SALARYARCHIVE>()
                //              where employeeIDs.Contains(ent.EMPLOYEEID)
                //              && ent.CHECKSTATE == "2"
                //              orderby ent.CREATEDATE descending
                //              select ent;
                //有薪资岗位设置才进行员工岗位变更操作
                if (SalarypostIDs.Count() > 0)
                {
                    var entEmployeePosts = from ent in dal.GetObjects <T_HR_EMPLOYEEPOST>().Include("T_HR_POST").Include("T_HR_EMPLOYEE")
                                           where SalarypostIDs.Contains(ent.T_HR_POST.POSTID) &&
                                           ent.CHECKSTATE == "2" && ent.ISAGENCY == "0" &&
                                           ent.EDITSTATE == "1"
                                           select ent;
                    List <string> postEmployeeIDs = new List <string>();
                    foreach (var a in entEmployeePosts)
                    {
                        postEmployeeIDs.Add(a.T_HR_EMPLOYEE.EMPLOYEEID);
                    }

                    //var Salarys = from ent in dal.GetObjects<T_HR_SALARYARCHIVE>()
                    //              where SalarypostIDs.Contains(ent.EMPLOYEEPOSTID)
                    //              && ent.CHECKSTATE == "2"
                    //              orderby ent.CREATEDATE descending
                    //              select ent;
                    var Salarys = from ent in dal.GetObjects <T_HR_SALARYARCHIVE>()
                                  where postEmployeeIDs.Contains(ent.EMPLOYEEID) &&
                                  ent.CHECKSTATE == "2"
                                  orderby ent.CREATEDATE descending
                                  select ent;
                    List <T_HR_SALARYARCHIVE> updateSalary = new List <T_HR_SALARYARCHIVE>();
                    if (Salarys.Count() > 0)
                    {
                        foreach (var ent in Salarys)
                        {
                            var entFirst = from a in Salarys
                                           where a.EMPLOYEEID == ent.EMPLOYEEID
                                           orderby a.CREATEDATE descending
                                           select a;
                            if (entFirst.Count() > 0)
                            {
                                T_HR_SALARYARCHIVE archive = entFirst.FirstOrDefault();
                                if (updateSalary.Count() == 0)
                                {
                                    updateSalary.Add(archive);
                                }
                                else
                                {
                                    var exists = from b in updateSalary
                                                 where b.SALARYARCHIVEID == archive.SALARYARCHIVEID
                                                 select b;
                                    if (exists.Count() == 0)
                                    {
                                        updateSalary.Add(archive);
                                    }
                                }
                            }
                        }
                    }
                    if (updateSalary.Count() > 0)
                    {
                        foreach (var ent in updateSalary)
                        {
                            SMT.Foundation.Log.Tracer.Debug(ent.EMPLOYEENAME + "原来结算岗位为:" + ent.BALANCEPOSTNAME + "岗位ID:" + ent.BALANCEPOSTID);
                            ent.BALANCEPOSTID   = asign.BALANCEPOSTID;
                            ent.BALANCEPOSTNAME = asign.BALANCEPOSTNAME;
                            if (!string.IsNullOrEmpty(payCompanyId))
                            {
                                ent.PAYCOMPANY = payCompanyId;
                            }
                            ent.OWNERCOMPANYID = asign.OWNERCOMPANYID;
                            dal.UpdateFromContext(ent);
                            SMT.Foundation.Log.Tracer.Debug(ent.EMPLOYEENAME + "修改为:" + ent.BALANCEPOSTNAME);
                        }
                    }
                }
                int i = dal.SaveContextChanges();
            }
            catch (Exception ex)
            {
                SMT.Foundation.Log.Tracer.Debug("UpdateEmployeeSalaryInfo执行时出错:" + ex.ToString());
            }
        }
Exemplo n.º 37
0
 private void HandlePostChanged(T_HR_POST ent)
 {
     //给关联岗位赋值
     RelationPost.RELATEPOSTID = ent.POSTID;
 }
Exemplo n.º 38
0
        private string GetXmlString(string StrSource, T_HR_POST Info)
        {

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

            SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY ownerCompany = (Application.Current.Resources["SYS_CompanyInfo"] as List<SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY>).Where(s => s.COMPANYID == Info.OWNERCOMPANYID).FirstOrDefault();
            SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT ownerDepartment = (Application.Current.Resources["SYS_DepartmentInfo"] as List<SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT>).Where(s => s.DEPARTMENTID == Info.OWNERDEPARTMENTID).FirstOrDefault();
            SMT.Saas.Tools.OrganizationWS.T_HR_POST ownerPost = (Application.Current.Resources["SYS_PostInfo"] as List<SMT.Saas.Tools.OrganizationWS.T_HR_POST>).Where(s => s.POSTID == Info.OWNERPOSTID).FirstOrDefault();
            string ownerCompanyName = string.Empty;
            string ownerDepartmentName = string.Empty;
            string ownerPostName = string.Empty;
            if (ownerCompany != null)
            {
                ownerCompanyName = ownerCompany.CNAME;
            }
            if (ownerDepartment != null)
            {
                ownerDepartmentName = ownerDepartment.T_HR_DEPARTMENTDICTIONARY == null ? "" : ownerDepartment.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME;
            }
            if (ownerPost != null)
            {
                ownerPostName = ownerPost.T_HR_POSTDICTIONARY == null ? "" : ownerPost.T_HR_POSTDICTIONARY.POSTNAME;
            }

            T_HR_POST fatherPost = lkPost.DataContext as T_HR_POST;
            SMT.SaaS.MobileXml.MobileXml mx = new SMT.SaaS.MobileXml.MobileXml();
            List<SMT.SaaS.MobileXml.AutoDictionary> AutoList = new List<SMT.SaaS.MobileXml.AutoDictionary>();
            AutoList.Add(basedata("T_HR_POST", "CHECKSTATE", "1", checkState));
            AutoList.Add(basedata("T_HR_POST", "FATHERPOSTID", Info.FATHERPOSTID, fatherPost == null ? "" : fatherPost.T_HR_POSTDICTIONARY.POSTNAME));
            AutoList.Add(basedata("T_HR_POST", "POSTNAME", Info.T_HR_POSTDICTIONARY.POSTNAME, Info.T_HR_POSTDICTIONARY.POSTNAME));
            AutoList.Add(basedata("T_HR_POST", "POSTDICTIONARYID", Info.T_HR_POSTDICTIONARY.POSTDICTIONARYID, Info.T_HR_POSTDICTIONARY.POSTNAME));
            AutoList.Add(basedata("T_HR_POST", "DEPARTMENTID", Info.T_HR_DEPARTMENT.DEPARTMENTID, lkDepart.TxtLookUp.Text));
            AutoList.Add(basedata("T_HR_POST", "POSTCODE", txtPosCode.Text, txtPosCode.Text));
            AutoList.Add(basedata("T_HR_POST", "UNDERNUMBER", txtManageNmber.Value.ToString(), ""));
            AutoList.Add(basedata("T_HR_POST", "POSTNUMBER", nuPostNumber.Value.ToString(), ""));
            //AutoList.Add(basedata("T_OA_APPROVALINFO", "OWNERDEPARTMENTID", approvalInfo.OWNERDEPARTMENTID, StrDepartmentName));
            //AutoList.Add(basedata("T_OA_APPROVALINFO", "OWNERPOSTID", approvalInfo.OWNERPOSTID, StrPostName));
            //AutoList.Add(basedata("T_OA_APPROVALINFO", "TYPEAPPROVAL", approvalInfo.TYPEAPPROVAL, StrApprovalTypeName));
            //AutoList.Add(basedata("T_OA_APPROVALINFO", "CONTENT", approvalInfo.APPROVALID, approvalInfo.APPROVALID));
            //AutoList.Add(basedata("T_OA_APPROVALINFO", "AttachMent", approvalInfo.APPROVALID, approvalInfo.APPROVALID));
            AutoList.Add(basedata("T_HR_POST", "OWNERCOMPANYID", Info.OWNERCOMPANYID, ownerCompanyName));
            AutoList.Add(basedata("T_HR_POST", "OWNERDEPARTMENTID", Info.OWNERDEPARTMENTID, ownerDepartmentName));
            AutoList.Add(basedata("T_HR_POST", "OWNERPOSTID", Info.OWNERPOSTID, ownerPostName));
            AutoList.Add(basedata("T_HR_POST", "EDITSTATE", Info.EDITSTATE, this.tbEdit.Text));//生效状态
            string a = mx.TableToXml(Info, null, StrSource, AutoList);

            return a;
        }
Exemplo n.º 39
0
        private void AddOrgObjectInList(TreeViewItem item)
        {
            if (item == null)
            {
                return;
            }

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

            TreeViewItem     menuitem      = (TreeViewItem)treeMenu.SelectedItem;
            T_SYS_ENTITYMENU entMenu       = menuitem.DataContext as T_SYS_ENTITYMENU;
            T_SYS_PERMISSION entPermission = DtGrid.SelectedItem as T_SYS_PERMISSION;

            ExtOrgObj obj = item.DataContext as ExtOrgObj;

            FrameworkUI.OrgTreeItemTypes nodeType = obj.ObjectType;
            OrgObject entTemp = new OrgObject();

            switch (nodeType)
            {
            case FrameworkUI.OrgTreeItemTypes.Company:
                T_HR_COMPANY tmpOrg = (T_HR_COMPANY)obj.ObjectInstance;
                if (tmpOrg != null)
                {
                    entTemp.OrgID   = tmpOrg.COMPANYID;
                    entTemp.OrgType = Convert.ToInt32(OrgTreeItemTypes.Company).ToString();
                }
                break;

            case FrameworkUI.OrgTreeItemTypes.Department:
                T_HR_DEPARTMENT tmpDep = obj.ObjectInstance as T_HR_DEPARTMENT;
                if (tmpDep != null)
                {
                    entTemp.OrgID   = tmpDep.DEPARTMENTID;
                    entTemp.OrgType = Convert.ToInt32(OrgTreeItemTypes.Department).ToString();
                }
                break;

            case FrameworkUI.OrgTreeItemTypes.Post:
                T_HR_POST tmpPost = obj.ObjectInstance as T_HR_POST;
                if (tmpPost != null)
                {
                    entTemp.OrgID   = tmpPost.POSTID;
                    entTemp.OrgType = Convert.ToInt32(OrgTreeItemTypes.Post).ToString();
                }
                break;

            default:
                break;
            }

            if (!string.IsNullOrEmpty(entTemp.OrgID) && !string.IsNullOrEmpty(entTemp.OrgType))
            {
                foreach (CustomerPermission parentitem in ListCustomerpermission)
                {
                    if (parentitem.EntityMenuId != entMenu.ENTITYMENUID)
                    {
                        continue;
                    }

                    var per = from p in parentitem.PermissionValue
                              where p.Permission == entPermission.PERMISSIONID
                              select p;

                    if (per.Count() == 0)
                    {
                        break;
                    }

                    foreach (PermissionValue childitem in per)
                    {
                        ObservableCollection <OrgObject> entsOrg = new ObservableCollection <OrgObject>();
                        if (childitem.OrgObjects == null)
                        {
                            entsOrg.Add(entTemp);
                            childitem.OrgObjects = entsOrg;
                        }
                        else if (childitem.OrgObjects.Count() == 0)
                        {
                            entsOrg.Add(entTemp);
                            childitem.OrgObjects = entsOrg;
                        }
                        else if ((childitem.OrgObjects.Count() > 0))
                        {
                            var pcc = from o in childitem.OrgObjects
                                      where o.OrgID == entTemp.OrgID && o.OrgType == entTemp.OrgType
                                      select o;
                            if (pcc.Count() == 0)
                            {
                                childitem.OrgObjects.Add(entTemp);
                            }
                        }
                    }
                }

                this.DataContext = ListCustomerpermission;
            }
        }
Exemplo n.º 40
0
 public void PostCancel(T_HR_POST postID, ref string strMsg)
 {
     using (PostBLL bll = new PostBLL())
     {
         bll.PostCancel(postID, ref strMsg);
     }
 }
Exemplo n.º 41
0
        /// <summary>
        /// 结算
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnBalanceCalculate_Click(object sender, RoutedEventArgs e)
        {
            if (cbxkAssignedObjectType.SelectedItem == null)
            {
                return;
            }

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

            bool flag = false;
            int  iYear = 0, iMonth = 0;

            flag = int.TryParse(txtBalanceYear.Text, out iYear);
            if (iYear <= 0)
            {
                return;
            }

            flag = int.TryParse(txtBalanceMonth.Text, out iMonth);
            if (iMonth <= 0 || iMonth > 12)
            {
                return;
            }

            T_SYS_DICTIONARY entDic = cbxkAssignedObjectType.SelectedItem as T_SYS_DICTIONARY;

            if (string.IsNullOrEmpty(entDic.DICTIONARYID) || string.IsNullOrEmpty(entDic.DICTIONCATEGORY) || string.IsNullOrEmpty(entDic.DICTIONARYVALUE.ToString()))
            {
                return;
            }

            RefreshUI(RefreshedTypes.ProgressBar);

            if (entDic.DICTIONARYVALUE.ToString() == (Convert.ToInt32(AssignedObjectType.Company) + 1).ToString())
            {
                T_HR_COMPANY entCompany   = lkAssignObject.DataContext as T_HR_COMPANY;
                string       strCompanyID = entCompany.COMPANYID;

                clientAtt.CalculateEmployeeAttendanceMonthlyByCompanyIDAsync(iYear.ToString() + "-" + iMonth.ToString(), strCompanyID);
            }
            else if (entDic.DICTIONARYVALUE.ToString() == (Convert.ToInt32(AssignedObjectType.Department) + 1).ToString())
            {
                T_HR_DEPARTMENT entDepartment   = lkAssignObject.DataContext as T_HR_DEPARTMENT;
                string          strDepartmentID = entDepartment.DEPARTMENTID;

                clientAtt.CalculateEmployeeAttendanceMonthlyByDepartmentIDAsync(iYear.ToString() + "-" + iMonth.ToString(), strDepartmentID);
            }
            else if (entDic.DICTIONARYVALUE.ToString() == (Convert.ToInt32(AssignedObjectType.Post) + 1).ToString())
            {
                T_HR_POST entPost   = lkAssignObject.DataContext as T_HR_POST;
                string    strPostID = entPost.POSTID;

                clientAtt.CalculateEmployeeAttendanceMonthlyByPostIDAsync(iYear.ToString() + "-" + iMonth.ToString(), strPostID);
            }
            else if (entDic.DICTIONARYVALUE.ToString() == (Convert.ToInt32(AssignedObjectType.Personnel) + 1).ToString())
            {
                T_HR_EMPLOYEE entEmp   = lkAssignObject.DataContext as T_HR_EMPLOYEE;
                string        strEmpID = entEmp.EMPLOYEEID;

                clientAtt.CalculateEmployeeAttendanceMonthlyByEmployeeIDAsync(iYear.ToString() + "-" + iMonth.ToString(), strEmpID);
            }
        }
Exemplo n.º 42
0
        void organClient_GetAllPostViewCompleted(object sender, GetAllPostViewCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                if (e.Result != null)
                {

                    List<V_POST> vpostList = e.Result.ToList();
                    entlist = new List<T_HR_POST>();
                    foreach (var ent in vpostList)
                    {
                        T_HR_POST pt = new T_HR_POST();
                        pt.POSTID = ent.POSTID;
                        pt.FATHERPOSTID = ent.FATHERPOSTID;
                        pt.CHECKSTATE = ent.CHECKSTATE;
                        pt.EDITSTATE = ent.EDITSTATE;

                        pt.T_HR_POSTDICTIONARY = new T_HR_POSTDICTIONARY();
                        pt.T_HR_POSTDICTIONARY.POSTDICTIONARYID = Guid.NewGuid().ToString();
                        pt.T_HR_POSTDICTIONARY.POSTNAME = ent.POSTNAME;

                        pt.T_HR_DEPARTMENT = new T_HR_DEPARTMENT();
                        pt.T_HR_DEPARTMENT = allDepartments.Where(s => s.DEPARTMENTID == ent.DEPARTMENTID).FirstOrDefault();

                        entlist.Add(pt);
                    }
                    if (App.Current.Resources["SYS_PostInfo"] != null)
                    {
                        App.Current.Resources.Remove("SYS_PostInfo");
                        App.Current.Resources.Add("SYS_PostInfo", entlist);
                    }
                    else
                    {
                        App.Current.Resources.Add("SYS_PostInfo", entlist);
                    }
                }
            }
            //this.Loaded += new RoutedEventHandler(BusinessApplicationsForm_Loaded);
            loadbar.Start();
            DetailSendClient.GetSendDocSingleInfoByIdAsync(TmpSendoc);
        }
Exemplo n.º 43
0
        private OrganizationWS.T_HR_POST BindEmployeePost(TreeViewItem item)
        {
            T_HR_POST tempPost = new T_HR_POST();
            if (item == null || item.Parent == null)
                return null;
            if (((ExtOrgObj)(((TreeViewItem)item.Parent).DataContext)).ObjectType == OrgTreeItemTypes.Post)
            {
                tempPost = ((ExtOrgObj)((TreeViewItem)item.Parent).DataContext).ObjectInstance as OrganizationWS.T_HR_POST;

            }
            if (((ExtOrgObj)(((TreeViewItem)((TreeViewItem)item.Parent).Parent).DataContext)).ObjectType == OrgTreeItemTypes.Department)
            {
                tempPost.T_HR_DEPARTMENT = ((ExtOrgObj)(((TreeViewItem)((TreeViewItem)item.Parent).Parent).DataContext)).ObjectInstance as OrganizationWS.T_HR_DEPARTMENT;

            }
            return tempPost;
        }
Exemplo n.º 44
0
        /// <summary>
        /// 删除部门项
        /// </summary>
        /// <param name="allMenu"></param>
        private void RemovePost(T_HR_POST delPost)
        {
            if (delPost == null)
            {
                return;
            }

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

            List<T_HR_POST> entPostList = new List<T_HR_POST>();
            if (DtGridPost.ItemsSource != null)
            {
                foreach (T_HR_POST post in DtGridPost.ItemsSource)
                {
                    entPostList.Add(post);
                }
            }

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

            for (int i = 0; i < entPostList.Count(); i++)
            {
                T_HR_POST entPost = entPostList[i] as T_HR_POST;
                if (entPost.POSTID == delPost.POSTID)
                {
                    entPostList.Remove(entPost);
                    break;
                }
            }

            ExtOrgObj extPost = new ExtOrgObj();
            extPost.ObjectInstance = delPost;

            RemoveCustomPermissionByExtOrgObj(extPost);
        }
Exemplo n.º 45
0
        void client_GetPostViewCompleted(object sender, GetPostViewCompletedEventArgs e)
        {
            try
            {
                if (e.Error == null)
                {

                    if (e.Result != null)
                    {
                        List<V_POST> vpostList = e.Result.ToList();
                        List<T_HR_POST> entlist = new List<T_HR_POST>();
                        foreach (var ent in vpostList)
                        {
                            T_HR_POST pt = new T_HR_POST();
                            pt.POSTID = ent.POSTID;
                            pt.FATHERPOSTID = ent.FATHERPOSTID;
                            pt.CHECKSTATE = ent.CHECKSTATE;
                            pt.EDITSTATE = ent.EDITSTATE;

                            pt.T_HR_POSTDICTIONARY = new T_HR_POSTDICTIONARY();
                            // pt.T_HR_POSTDICTIONARY.POSTDICTIONARYID = ent.POSTDICTIONARYID;
                            pt.T_HR_POSTDICTIONARY.POSTNAME = ent.POSTNAME;

                            // pt.T_HR_DEPARTMENT = new T_HR_DEPARTMENT();
                            pt.T_HR_DEPARTMENT = allDepartments.Where(s => s.DEPARTMENTID == ent.DEPARTMENTID).FirstOrDefault();

                            //pt.T_HR_DEPARTMENT = new T_HR_DEPARTMENT();
                            //pt.T_HR_DEPARTMENT.DEPARTMENTID = ent.DEPARTMENTID;

                            //pt.T_HR_DEPARTMENT.T_HR_DEPARTMENTDICTIONARY = new T_HR_DEPARTMENTDICTIONARY();
                            //pt.T_HR_DEPARTMENT.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTDICTIONARYID = Guid.NewGuid().ToString();
                            // pt.T_HR_DEPARTMENT.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME = ent.DEPARTMENTNAME;

                            // pt.T_HR_DEPARTMENT.T_HR_COMPANY = new T_HR_COMPANY();
                            // pt.T_HR_DEPARTMENT.T_HR_COMPANY.COMPANYID = ent.COMPANYID;
                            //  pt.T_HR_DEPARTMENT.T_HR_COMPANY.CNAME = ent.CNAME;

                            entlist.Add(pt);
                        }
                        UICache.CreateCache("ORGTREESYSPostInfo" + Perm + Entity, entlist);
                    }
                    //  BindPosition();
                }
            }
            catch (Exception ex)
            {
            }
            loadbar.Stop();
        }
Exemplo n.º 46
0
 /// <summary>
 ///岗位的全称
 /// </summary>
 /// <param name="dep"></param>
 /// <returns></returns>
 public string GetFullOrgName(T_HR_POST post)
 {
     string postname = post.T_HR_POSTDICTIONARY.POSTNAME;
     string deptname = post.T_HR_DEPARTMENT.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME;
     string companyname = post.T_HR_DEPARTMENT.T_HR_COMPANY.BRIEFNAME;
     return string.Format(postname + " - " + deptname + " - " + companyname);
 }
Exemplo n.º 47
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.º 48
0
        private void ImportBalance()
        {
            string strMsg = string.Empty;

            try
            {
                string   strUnitType = string.Empty, strUnitObjectId = string.Empty;
                int      dYear = 0, dMonth = 0;
                DateTime dtImportDate = new DateTime(), dtCurDate = new DateTime();


                int.TryParse(nuYear.Value.ToString(), out dYear);
                int.TryParse(nuMonth.Value.ToString(), out dMonth);
                DateTime.TryParse(dYear.ToString() + "-" + dMonth.ToString() + "-1", out dtImportDate);
                DateTime.TryParse(DateTime.Now.ToString("yyyy-MM") + "-1", out dtCurDate);

                if (dtImportDate > dtCurDate)
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("IMPORTBALANCEDATE"), Utility.GetResourceStr("DATECOMPARECURENTTIME", "BALANCEYEAR"));
                    return;
                }

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

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

                T_SYS_DICTIONARY entUnitType = cbxkBalanceUnitType.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;
                }

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


                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.ProgressBar);

                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 Saas.Tools.AttendanceWS.UploadFileModel();
                UploadFile.FileName = OpenFileDialog.File.Name;
                UploadFile.File     = Buffer;

                clientAtt.ImportAttendMonthlyBalanceFromCSVAsync(UploadFile, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID, strUnitType, strUnitObjectId, dYear, dMonth, strMsg);

                strMsg = string.Empty;
            }
            catch (Exception ex)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(ex.Message.ToString()));
            }
        }
Exemplo n.º 49
0
        /// <summary>
        /// 获取岗位
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void client_GetPostByIdCompleted(object sender, GetPostByIdCompletedEventArgs e)
        {
            T_HR_POST cp = new 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)
                {
                    return;
                }
                cp = e.Result;
                lkHead.DataContext = cp;
                lkHead.TxtLookUp.Text = GetFullOrgName(e.Result);//e.Result.T_HR_POSTDICTIONARY.POSTNAME + GetFullOrgName(e.Result.T_HR_DEPARTMENT.DEPARTMENTID);

            }
        }
Exemplo n.º 50
0
 public void PostUpdate(T_HR_POST entity, ref string strMsg)
 {
     using (PostBLL bll = new PostBLL())
     {
         bll.PostUpdate(entity, ref strMsg);
     }
 }
Exemplo n.º 51
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.º 52
0
        /// <summary>
        /// 结算
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnBalanceCalculate_Click(object sender, RoutedEventArgs e)
        {
            if (cbxkAssignedObjectType.SelectedItem == null ||
                cbxkAssignedObjectType.SelectedIndex == 0)
            {
                MessageBox.Show("请选择结算类型!");
                return;
            }

            if (lkAssignObject.DataContext == null)
            {
                MessageBox.Show("请选择结算对象");
                return;
            }

            bool flag = false;
            int  iYear = 0, iMonth = 0;

            flag = int.TryParse(txtBalanceYear.Text, out iYear);
            if (iYear <= 0)
            {
                return;
            }

            flag = int.TryParse(txtBalanceMonth.Text, out iMonth);
            if (iMonth <= 0 || iMonth > 12)
            {
                return;
            }

            var entDic = cbxkAssignedObjectType.SelectedIndex.ToString();

            RefreshUI(RefreshedTypes.ProgressBar);

            ObservableCollection <string> ClacuEmployeePosts = new ObservableCollection <string>();

            foreach (var item in SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts)
            {
                ClacuEmployeePosts.Add(item.PostID);
            }
            string strMsg    = string.Empty;
            string strID     = string.Empty;
            string ClacuType = string.Empty;

            if (entDic == (Convert.ToInt32(AssignedObjectType.Company) + 1).ToString())
            {
                T_HR_COMPANY entCompany = lkAssignObject.DataContext as T_HR_COMPANY;
                strID     = entCompany.COMPANYID;
                ClacuType = "1";
            }
            else if (entDic == (Convert.ToInt32(AssignedObjectType.Department) + 1).ToString())
            {
                T_HR_DEPARTMENT entDepartment = lkAssignObject.DataContext as T_HR_DEPARTMENT;
                strID     = entDepartment.DEPARTMENTID;
                ClacuType = "2";
            }
            else if (entDic == (Convert.ToInt32(AssignedObjectType.Post) + 1).ToString())
            {
                T_HR_POST entPost = lkAssignObject.DataContext as T_HR_POST;
                strID     = entPost.POSTID;
                ClacuType = "3";
            }
            else if (entDic == "4")
            {
                T_HR_POST entPost = lkAssignObject.DataContext as T_HR_POST;
                strID     = entPost.POSTID;
                ClacuType = "4";
            }
            string balanceEmployeeid = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;

            clientAtt.CalculateAttendanceMonthlyAsync(iYear.ToString() + "-" + iMonth.ToString(), ClacuType, strID, ClacuEmployeePosts, balanceEmployeeid, strMsg);
        }