public bool AddEmployeeActivityLog(Employee employee, int employeeId, string action, string method, string information) { string ipAddress = GetIpAddress(); string timeStr = DateTime.Now.ToString(); DateTime time = DateTime.Parse(timeStr); Employee_Activity_Log employeeActivityLog = new Employee_Activity_Log() { Action = action, EmployeeId = employeeId, Method = method, Information = information, Time = time, IpAddress = ipAddress }; if (employeeActivityLog == null) { return(false); } else { db.Employee_Activity_Log.Add(employeeActivityLog); db.SaveChanges(); return(true); } }
public bool AddEmployeeActivityLog(Employee_Activity_Log employeeActivityLog) { if (employeeActivityLog == null) { return(false); } else { db.Employee_Activity_Log.Add(employeeActivityLog); db.SaveChanges(); return(true); } }