| | |
| | | { |
| | | var entity = new MesStaff |
| | | { |
| | | Id = Convert.ToDecimal(staff.Id), |
| | | Id = string.IsNullOrEmpty(staff.Id) |
| | | ? DateTimeOffset.UtcNow.ToUnixTimeSeconds() |
| | | : Convert.ToDecimal(staff.Id), |
| | | StaffNo = staff.FStaffNumber, |
| | | StaffName = staff.FName, |
| | | DepartmentName = staff.FPostDept, |
| | |
| | | PhoneNumber = staff.FMobile, |
| | | Remark = staff.FDescription, |
| | | FforbidStatus = staff.FForbidStatus, |
| | | FSubsidiary = staff.FUseOrgId, |
| | | Fumbrella = staff.FCreateOrgId, |
| | | FSubsidiary = string.IsNullOrEmpty(staff.FUseOrgId) |
| | | ? "1" |
| | | : staff.FUseOrgId, |
| | | Fumbrella = string.IsNullOrEmpty(staff.FCreateOrgId) |
| | | ? "1" |
| | | : staff.FCreateOrgId, |
| | | CreateDate = DateTime.Now, |
| | | LastupdateDate = DateTime.Now, |
| | | Type = staff.Type |
| | |
| | | entity.StartDate = DateTime.ParseExact(staff.FStaffStartDate, "yyyy-MM-dd HH:mm:ss", null); |
| | | } |
| | | |
| | | var mesStaff = Db.Queryable<MesStaff>() |
| | | .Where(s => s.StaffNo == entity.StaffNo) |
| | | .First(); |
| | | |
| | | if (mesStaff != null) |
| | | { |
| | | entity.Id = mesStaff.Id; |
| | | } |
| | | |
| | | return entity; |
| | | } |
| | | catch (Exception ex) |