Exemple #1
0
        public AjaxMessage CreateEmployeeJob(string JobName)
        {
            AjaxMessage ajax = new AjaxMessage();

            ajax.IsSuccess = false;
            ajax.Message   = "";
            try
            {
                Sys_EmployeeJob empJob = new Sys_EmployeeJob();
                empJob.Jobname    = JobName;
                empJob.createTime = DateTime.Now;
                empJob.EmployeeId = LoginInfo.UserInfo.EmployeeId;
                empJob.Status     = (byte)SysStatus.Enable;
                int result = _empJobService.Insert(empJob);
                if (result > 0)
                {
                    ajax.IsSuccess = true;
                    ajax.Message   = "添加成功";
                }
            }
            catch (Exception e)
            {
                ajax.Message = e.Message;
            }

            return(ajax);
        }
Exemple #2
0
        public AjaxMessage GetLoginName(int employeeId)
        {
            AjaxMessage ajax = new AjaxMessage();

            ajax.IsSuccess = false;
            ajax.Message   = "";

            try
            {
                Sys_Employee employee = _empService.GetByID(employeeId);

                HHL_Employee m_employee = new HHL_Employee
                {
                    EmployeeId   = employee.EmployeeID,
                    EmployeeName = employee.EmployeeName,
                    JobId        = employee.JobID,
                    TypeId       = employee.EmployeeTypeID,
                    LoginName    = employee.LoginName,
                };
                Sys_EmployeeJob  m_job  = _empJobService.GetByID(m_employee.JobId);
                Sys_EmployeeType m_type = _empTypeService.GetByID(m_employee.TypeId);
                m_employee.TypeName = m_type.TypeName;
                m_employee.JobName  = m_job.Jobname;

                ajax.IsSuccess = true;
                ajax.Data      = m_employee;
            }
            catch
            {
                ajax.IsSuccess = false;
                ajax.Message   = "系统异常,请稍候再试...";
            }
            return(ajax);
        }
Exemple #3
0
        public AjaxMessage UpdateEmployeeJob(Sys_EmployeeJob _empJob)
        {
            AjaxMessage ajax = new AjaxMessage();

            ajax.IsSuccess = false;
            ajax.Message   = "";
            try
            {
                Sys_EmployeeJob empJob = _empJobService.GetByID(_empJob.JobID);;
                empJob.Jobname    = _empJob.Jobname;
                empJob.EmployeeId = LoginInfo.UserInfo.EmployeeId;
                int result = _empJobService.Update(empJob);
                if (result > 0)
                {
                    ajax.IsSuccess = true;
                    ajax.Message   = "修改成功";
                }
            }
            catch (Exception e)
            {
                ajax.Message = e.Message;
            }

            return(ajax);
        }
Exemple #4
0
        /// <summary>
        /// @author;wp
        /// @datetime:2016-08-01
        /// @desc: 获取员工职务
        /// </summary>
        /// <param name="Source">职务ID</param>
        /// <returns></returns>
        public string GetEmployeeJob(object Source)
        {
            if (Source != null)
            {
                int JboId = Source.ToString().ToInt32();

                Sys_EmployeeJob _empJob = _empJobService.GetByID(JboId);
                if (_empJob != null)
                {
                    return(_empJob.Jobname);
                }
            }
            return("");
        }
Exemple #5
0
        public AjaxMessage GetEmpJobById(int JobId)
        {
            AjaxMessage ajax = new AjaxMessage();

            ajax.IsSuccess = false;
            Sys_EmployeeJob empJob = _empJobService.GetByID(JobId);

            if (empJob != null)
            {
                ajax.IsSuccess = true;
                ajax.Value     = empJob.Jobname;
                ajax.Id        = empJob.JobID;
            }
            return(ajax);
        }
Exemple #6
0
        public AjaxMessage SetEmpJobSingleStatus(int jobId, int index)
        {
            AjaxMessage ajax = new AjaxMessage();

            ajax.IsSuccess = false;
            ajax.Message   = "";
            try
            {
                if (!string.IsNullOrEmpty(jobId.ToString()) && jobId != 0)
                {
                    Sys_EmployeeJob m_empJob = _empJobService.GetByID(jobId);
                    if (m_empJob.Status == (byte)SysStatus.Enable)
                    {
                        m_empJob.Status = (byte)SysStatus.Disable;
                    }
                    else
                    {
                        m_empJob.Status = (byte)SysStatus.Enable;
                    }

                    int result = _empJobService.Update(m_empJob);
                    if (result > 0)
                    {
                        ajax.IsSuccess = true;
                        ajax.Id        = jobId;
                        ajax.Index     = index;
                        if (m_empJob.Status == (byte)SysStatus.Disable)
                        {
                            ajax.Message = "禁用成功";
                        }
                        else
                        {
                            ajax.Message = "启用成功";
                        }
                    }
                }
            }
            catch (Exception e)
            {
                ajax.Message = e.Message;
            }

            return(ajax);
        }