public HistoryApproval(HistoryApprovalVM historyapprovalVM) { this.EmployeeName = historyapprovalVM.EmployeeName; this.OvertimeDate = historyapprovalVM.OvertimeDate; this.TotalTime = historyapprovalVM.TotalTime; this.Status = historyapprovalVM.Status; this.CreateDate = DateTimeOffset.Now.LocalDateTime; }
public bool Insert(HistoryApprovalVM historyapprovalVM) { var push = new HistoryApproval(historyapprovalVM); applicationContext.HistoryApprovals.Add(push); var result = applicationContext.SaveChanges(); return(result > 0); }
public bool Insert(HistoryApprovalVM historyapprovalVM) { if (string.IsNullOrWhiteSpace(historyapprovalVM.EmployeeName) || string.IsNullOrWhiteSpace(historyapprovalVM.OvertimeDate.ToString()) || string.IsNullOrWhiteSpace(historyapprovalVM.TotalTime.ToString()) || string.IsNullOrWhiteSpace(historyapprovalVM.Status)) { return(status); } else { var result = _historyapprovalRepository.Insert(historyapprovalVM); return(result); } }