Exemplo n.º 1
0
        /// <summary>
        /// 创建
        /// </summary>
        /// <param name="dto"></param>
        /// <param name="userNo"></param>
        /// <param name="userName"></param>
        /// <param name="departmentId"></param>
        /// <returns></returns>
        public int Create(ApprovalDto dto, string userNo, string userName, int departmentId)
        {
            var entity = _mapper.Map <Approval>(dto);

            entity.ApplicantNo   = userNo;
            entity.ApplicantName = userName;
            entity.DepartmentId  = departmentId;
            entity.ApproveStep   = 0;
            entity.ApproveResult = 0;
            entity.CreateAt      = DateTime.Now;

            return(_db.Insert(entity));
        }