Ejemplo n.º 1
0
        /// <summary>
        /// 获取岗位调动数据集
        /// </summary>
        /// <returns>返回岗位调动数据集</returns>
        private HR_PostChange GetPostChange()
        {
            try
            {
                HR_PostChange postChange = new HR_PostChange();

                postChange.BillStatus          = PostChangeStatus.等待调出部门负责人审核.ToString();
                postChange.ChangeReason        = txtChangeReason.Text;
                postChange.Date                = ServerTime.Time;
                postChange.DeptCode            = BasicInfo.DeptCode;
                postChange.PostID              = Convert.ToInt32(txtOldWorkPost.Tag);
                postChange.EmployedDate        = dtpEmployedDate.Value;
                postChange.NewDeptCode         = m_departmentServer.GetDeptCode(cmbNewDept.Text);
                postChange.NewPostID           = m_PostServer.GetOperatingPostByPostName(cmbNewWorkPost.Text).岗位编号;
                postChange.WorkID              = BasicInfo.LoginID;
                postChange.GM_Authorize        = false;
                postChange.HR_Authorize        = false;
                postChange.NewDeptAuthorize    = false;
                postChange.NewlearderAuthorize = false;
                postChange.OldDeptAuthorize    = false;
                postChange.OldLearderAuthorize = false;
                postChange.IsDorm              = false;
                postChange.IsIT                = false;
                postChange.IsPersonnelFiles    = false;
                postChange.IsWorkTurnOver      = false;

                return(postChange);
            }
            catch (Exception ex)
            {
                MessageDialog.ShowPromptMessage(ex.Message);
                return(null);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 修改岗位调动申请单
        /// </summary>
        /// <param name="postChange">岗位调动申请信息</param>
        /// <param name="error">错误信息</param>
        /// <returns>成功返回大于0的整数,失败返回0</returns>
        public bool UpdatePostChange(HR_PostChange postChange, out string error)
        {
            error = "";

            try
            {
                DepotManagementDataContext dataContxt = CommentParameter.DepotDataContext;

                var result = from a in dataContxt.HR_PostChange
                             where a.WorkID == postChange.WorkID && a.NewPostID == postChange.NewPostID &&
                             a.PostID == postChange.PostID && a.NewDeptCode == postChange.NewDeptCode
                             select a;

                if (result.Count() == 1)
                {
                    HR_PostChange list = result.Single();

                    list.BillStatus   = PostChangeStatus.等待调出部门负责人审核.ToString();
                    list.ChangeReason = postChange.ChangeReason;
                    list.Date         = postChange.Date;
                    list.NewDeptCode  = postChange.NewDeptCode;
                    list.NewPostID    = postChange.NewPostID;
                    list.PostID       = postChange.PostID;
                    list.DeptCode     = postChange.DeptCode;

                    list.GeneralManager      = "";
                    list.GM_Authorize        = false;
                    list.GM_Opinion          = "";
                    list.HR_Authorize        = false;
                    list.HR_Director         = "";
                    list.HR_Opinion          = "";
                    list.NewDeptAuthorize    = false;
                    list.NewDeptDirector     = "";
                    list.NewDeptOpinion      = "";
                    list.NewLearder          = "";
                    list.NewlearderAuthorize = false;
                    list.NewLearderOpinion   = "";
                    list.OldDeptAuthorize    = false;
                    list.OldDeptDirector     = "";
                    list.OldDeptOpinion      = "";
                    list.OldLearder          = "";
                    list.OldLearderAuthorize = false;
                    list.OldLearderOpinion   = "";
                }

                dataContxt.SubmitChanges();
                return(true);
            }
            catch (Exception ex)
            {
                error = ex.Message;
                return(false);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 总经理审批修改岗位调动表
        /// </summary>
        /// <param name="id">申请编号</param>
        /// <param name="gmOpinion">总经理意见</param>
        /// <param name="authorize">总经理是否批准</param>
        /// <param name="error">错误信息</param>
        /// <returns>成功返回True,失败返回false</returns>
        public bool UpdateGMAuthor(int id, string gmOpinion, bool authorize, out string error)
        {
            error = "";

            try
            {
                DepotManagementDataContext dataContxt = CommentParameter.DepotDataContext;
                var result = from a in dataContxt.HR_PostChange
                             where a.ID == id
                             select a;

                if (result.Count() != 1)
                {
                    error = "信息有误,请检查!";
                    return(false);
                }

                HR_PostChange postChange = result.Single();

                postChange.GM_Opinion       = gmOpinion;
                postChange.GM_Authorize     = authorize;
                postChange.GeneralManager   = BasicInfo.LoginID;
                postChange.GM_SignatureDate = ServerTime.Time;

                if (authorize == false)
                {
                    postChange.BillStatus = PostChangeStatus.未批准.ToString();
                }
                else
                {
                    postChange.BillStatus = PostChangeStatus.等待原工作移交.ToString();
                }

                dataContxt.SubmitChanges();
                return(true);
            }
            catch (Exception ex)
            {
                error = ex.Message;
                return(false);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 调入部门分管审批修改岗位调动表
        /// </summary>
        /// <param name="id">申请编号</param>
        /// <param name="newLearderOpinion">调入部门分管意见</param>
        /// <param name="newLearderAuthorize">调入部门是否批准</param>
        /// <param name="error">错误信息</param>
        /// <returns>成功返回True,失败返回false</returns>
        public bool UpdateNewLearder(int id, string newLearderOpinion, bool newLearderAuthorize, out string error)
        {
            error = "";

            try
            {
                DepotManagementDataContext dataContxt = CommentParameter.DepotDataContext;
                var result = from a in dataContxt.HR_PostChange
                             where a.ID == id
                             select a;

                if (result.Count() != 1)
                {
                    error = "信息有误,请检查!";
                    return(false);
                }

                HR_PostChange postChange = result.Single();

                postChange.NewLearderOpinion   = newLearderOpinion;
                postChange.NewlearderAuthorize = newLearderAuthorize;
                postChange.NewLearder          = BasicInfo.LoginID;
                postChange.NewLearderDate      = ServerTime.Time;

                if (newLearderAuthorize == false)
                {
                    postChange.BillStatus = PostChangeStatus.未批准.ToString();
                }
                else
                {
                    postChange.BillStatus = PostChangeStatus.等待调入分管领导审核.ToString();
                }

                dataContxt.SubmitChanges();
                return(true);
            }
            catch (Exception ex)
            {
                error = ex.Message;
                return(false);
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 新增岗位调动申请单
        /// </summary>
        /// <param name="postChange">岗位调动申请信息</param>
        /// <param name="error">错误信息</param>
        /// <returns>成功返回大于0的整数,失败返回0</returns>
        public int AddPostChange(HR_PostChange postChange, out string error)
        {
            error = "";

            try
            {
                DepotManagementDataContext dataContxt = CommentParameter.DepotDataContext;

                var result = from a in dataContxt.HR_PostChange
                             where a.WorkID == postChange.WorkID && a.NewPostID == postChange.NewPostID &&
                             a.PostID == postChange.PostID && a.NewDeptCode == postChange.NewDeptCode
                             select a;

                if (result.Count() > 0)
                {
                    error = "同部门同岗位的申请已经提交过一次!不能重复提交";
                    return(0);
                }

                dataContxt.HR_PostChange.InsertOnSubmit(postChange);
                dataContxt.SubmitChanges();

                var resultlist = from a in dataContxt.HR_PostChange
                                 where a.WorkID == postChange.WorkID && a.Date == postChange.Date
                                 select a;

                if (resultlist.Count() > 0)
                {
                    return(resultlist.Single().ID);
                }
                else
                {
                    return(0);
                }
            }
            catch (Exception ex)
            {
                error = ex.Message;
                return(0);
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 移交确认修改
        /// </summary>
        /// <param name="id">申请编号</param>
        /// <param name="flag">工作是否移交</param>
        /// <param name="name">员工姓名</param>
        /// <param name="workID">员工编号</param>
        /// <param name="personnelChange">档案历史数据集</param>
        /// <param name="dept">调入部门</param>
        /// <param name="postID">调入岗位编号</param>
        /// <param name="error">错误信息</param>
        /// <returns>成功返回True,失败返回false</returns>
        public bool UpdateWorkTurnOver(int id, bool flag, string name, string workID, HR_PersonnelArchiveChange personnelChange,
                                       string dept, int postID, out string error)
        {
            error = "";
            bool isfinish = false;

            try
            {
                DepotManagementDataContext dataContxt = CommentParameter.DepotDataContext;
                var result = from a in dataContxt.HR_PostChange
                             where a.ID == id
                             select a;

                if (result.Count() != 1)
                {
                    error = "信息有误,请检查!";
                    return(false);
                }

                HR_PostChange postChange = result.Single();

                if (postChange.BillStatus == PostChangeStatus.等待原工作移交.ToString())
                {
                    postChange.TurnOverPeople = BasicInfo.LoginID;
                    postChange.TurnOverDate   = ServerTime.Time;
                    postChange.IsWorkTurnOver = flag;

                    if (flag)
                    {
                        postChange.BillStatus = PostChangeStatus.等待人事档案调动.ToString();
                    }
                }
                else if (postChange.BillStatus == PostChangeStatus.等待人事档案调动.ToString())
                {
                    postChange.FilesPeople      = BasicInfo.LoginID;
                    postChange.FilesDate        = ServerTime.Time;
                    postChange.IsPersonnelFiles = flag;

                    if (flag)
                    {
                        postChange.BillStatus = PostChangeStatus.等待信息化人员确认.ToString();
                    }
                }
                else if (postChange.BillStatus == PostChangeStatus.等待信息化人员确认.ToString())
                {
                    postChange.ITPeople = BasicInfo.LoginID;
                    postChange.ITDate   = ServerTime.Time;
                    postChange.IsIT     = flag;

                    if (flag)
                    {
                        postChange.BillStatus = PostChangeStatus.等待固定资产人员确认.ToString();
                    }
                }
                else if (postChange.BillStatus == PostChangeStatus.等待固定资产人员确认.ToString())
                {
                    postChange.DormPeople = BasicInfo.LoginID;
                    postChange.DormDate   = ServerTime.Time;
                    postChange.IsDorm     = flag;

                    if (flag)
                    {
                        postChange.BillStatus = PostChangeStatus.已完成.ToString();
                        isfinish = true;
                    }
                }

                dataContxt.SubmitChanges();

                if (isfinish)
                {
                    var resultArchive = from c in dataContxt.HR_PersonnelArchive
                                        where c.Name == name && c.WorkID == workID
                                        select c;

                    if (resultArchive.Count() == 1)
                    {
                        HR_PersonnelArchive personnel = resultArchive.Single();

                        personnel.Dept     = dept;
                        personnel.WorkPost = postID;
                        //personnel.Remark = ServerTime.Time + personnel.Name + " 从 " + personnelChange.DeptName + personnelChange.WorkPost +
                        //" 调到 " + new OrganizationServer().GetDeptByDeptCode(personnel.Dept).部门名称 + " " +
                        //new OperatingPostServer().GetOperatingPostByPostCode(personnel.WorkPost);

                        if (!new PersonnelArchiveServer().UpdatePersonnelArchiveByChangPost(personnelChange, personnel, out error))
                        {
                            error = "信息有误!";
                            return(false);
                        }
                    }
                }

                return(true);
            }
            catch (Exception ex)
            {
                error = ex.Message;
                return(false);
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 给各控件赋值
        /// </summary>
        void BindControl()
        {
            HR_PostChange postChange = m_PostChangeServer.GetPostChangeByBillNo(Convert.ToInt32(m_billNo), out m_error);

            if (postChange != null)
            {
                lblStatus.Text            = postChange.BillStatus;
                txtApplicant.Text         = UniversalFunction.GetPersonnelName(postChange.WorkID);
                txtApplicant.Tag          = postChange.WorkID;
                txtChangeReason.Text      = postChange.ChangeReason;
                txtDormPeople.Text        = UniversalFunction.GetPersonnelName(postChange.DormPeople);
                txtFilesPeople.Text       = UniversalFunction.GetPersonnelName(postChange.FilesPeople);
                txtGeneralManager.Text    = UniversalFunction.GetPersonnelName(postChange.GeneralManager);
                txtGMOpinion.Text         = postChange.GM_Opinion;
                txtHRDirector.Text        = UniversalFunction.GetPersonnelName(postChange.HR_Director);
                txtHROpinion.Text         = postChange.HR_Opinion;
                txtITPeople.Text          = UniversalFunction.GetPersonnelName(postChange.ITPeople);
                txtNewDeptDirector.Text   = UniversalFunction.GetPersonnelName(postChange.NewDeptDirector);
                txtNewDeptOpinion.Text    = postChange.NewDeptOpinion;
                txtNewLearder.Text        = UniversalFunction.GetPersonnelName(postChange.NewLearder);
                txtNewLearderOpinion.Text = postChange.NewLearderOpinion;
                txtOldDept.Text           = UniversalFunction.GetDeptName(postChange.DeptCode);
                txtOldDeptDirector.Text   = UniversalFunction.GetPersonnelName(postChange.OldDeptDirector);
                txtOldDeptOpinion.Text    = postChange.OldDeptOpinion;
                txtOldLearder.Text        = UniversalFunction.GetPersonnelName(postChange.OldLearder);
                txtOldLearderOpinion.Text = postChange.OldLearderOpinion;
                txtOldWorkPost.Text       = m_PostServer.GetOperatingPostByPostCode(postChange.PostID);
                txtTurnOverPeople.Text    = UniversalFunction.GetPersonnelName(postChange.TurnOverPeople);

                cmbNewDept.Text     = UniversalFunction.GetDeptName(postChange.NewDeptCode);
                cmbNewWorkPost.Text = m_PostServer.GetOperatingPostByPostCode(postChange.NewPostID);

                cbGMAuthorize.Checked         = Convert.ToBoolean(postChange.GM_Authorize);
                cbHRAuthorize.Checked         = Convert.ToBoolean(postChange.HR_Authorize);
                cbIsDorm.Checked              = Convert.ToBoolean(postChange.IsDorm);
                cbIsIT.Checked                = Convert.ToBoolean(postChange.IsIT);
                cbIsPersonnelFiles.Checked    = Convert.ToBoolean(postChange.IsPersonnelFiles);
                cbIsWorkTurnOver.Checked      = Convert.ToBoolean(postChange.IsWorkTurnOver);
                cbNewDeptAuthorize.Checked    = Convert.ToBoolean(postChange.NewDeptAuthorize);
                cbNewlearderAuthorize.Checked = Convert.ToBoolean(postChange.NewlearderAuthorize);
                cbOldDeptAuthorize.Checked    = Convert.ToBoolean(postChange.OldDeptAuthorize);
                cbOldLearderAuthorize.Checked = Convert.ToBoolean(postChange.OldLearderAuthorize);

                if (postChange.DormDate != null)
                {
                    dtpDate.Value = postChange.Date;
                }

                if (postChange.DormDate != null)
                {
                    dtpDormDate.Value = Convert.ToDateTime(postChange.DormDate);
                }

                if (postChange.EmployedDate != null)
                {
                    dtpEmployedDate.Value = Convert.ToDateTime(postChange.EmployedDate);
                }

                if (postChange.FilesDate != null)
                {
                    dtpFilesDate.Value = Convert.ToDateTime(postChange.FilesDate);
                }

                if (postChange.GM_SignatureDate != null)
                {
                    dtpGMDate.Value = Convert.ToDateTime(postChange.GM_SignatureDate);
                }

                if (postChange.HR_SignatureDate != null)
                {
                    dtpHRSignatureDate.Value = Convert.ToDateTime(postChange.HR_SignatureDate);
                }

                if (postChange.ITDate != null)
                {
                    dtpITDate.Value = Convert.ToDateTime(postChange.ITDate);
                }

                if (postChange.NewDeptSignatureDate != null)
                {
                    dtpNewDeptSignatureDate.Value = Convert.ToDateTime(postChange.NewDeptSignatureDate);
                }

                if (postChange.NewLearderDate != null)
                {
                    dtpNewLearderDate.Value = Convert.ToDateTime(postChange.NewLearderDate);
                }

                if (postChange.OldDeptSignatureDate != null)
                {
                    dtpOldDeptSignatureDate.Value = Convert.ToDateTime(postChange.OldDeptSignatureDate);
                }

                if (postChange.OldLearderDate != null)
                {
                    dtpOldLearderDate.Value = Convert.ToDateTime(postChange.OldLearderDate);
                }

                if (postChange.TurnOverDate != null)
                {
                    dtpTurnOverDate.Value = Convert.ToDateTime(postChange.TurnOverDate);
                }
            }
        }