public static bool Add(BaseEmployee model) { if (model == null) { throw new ArgumentNullException("model"); } IBaseEmployee factory = BaseEmployeeFactory.GetFactory(); model.EmployeeID = GuidGenerator.GetGuidString(); return(factory.Add(model)); }
internal static bool AddOrUpdateBaseEmployee(BaseEmployee employee, DbOperator dbOperator) { IBaseEmployee employeeFactory = BaseEmployeeFactory.GetFactory(); BaseEmployee oldEmployee = BaseEmployeeServices.QueryByEmployeeId(employee.EmployeeID); if (oldEmployee != null) { return(employeeFactory.Update(employee, dbOperator)); } else { return(employeeFactory.Add(employee, dbOperator)); } }