コード例 #1
0
        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));
        }
コード例 #2
0
        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));
            }
        }