/// <summary>
        /// 根据工号从缓存获取实体
        /// </summary>
        /// <param name="employeeNumber">工号</param>
        /// <returns></returns>
        public static BaseStaffEntity GetEntityByEmployeeNumberByCache(string employeeNumber)
        {
            BaseStaffEntity result = null;

            if (!string.IsNullOrEmpty(employeeNumber))
            {
                var cacheKey = "StaffByEmployeeNumber" + employeeNumber;
                result = CacheUtil.Cache(cacheKey, () => new BaseStaffManager().GetEntityByEmployeeNumber(employeeNumber), true);
            }
            return(result);
        }
Beispiel #2
0
        /// <summary>
        /// 批量打删除标志
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="ids">主键数组</param>
        /// <returns>影响行数</returns>
        public int SetDeleted(BaseUserInfo userInfo, string[] ids)
        {
            // 写入调试信息
            #if (DEBUG)
            int milliStart = BaseBusinessLogic.StartDebug(userInfo, MethodBase.GetCurrentMethod());
            #endif

            // 加强安全验证防止未授权匿名调用
            #if (!DEBUG)
            LogOnService.UserIsLogOn(userInfo);
            #endif

            int returnValue = 0;
            using (IDbHelper dbHelper = DbHelperFactory.GetHelper(BaseSystemInfo.UserCenterDbType))
            {
                try
                {
                    dbHelper.Open(UserCenterDbConnection);
                    BaseUserManager  userManager  = new BaseUserManager(dbHelper, userInfo);
                    BaseStaffManager staffManager = new BaseStaffManager(dbHelper, userInfo);
                    BaseStaffEntity  staffEntity  = null;
                    for (int i = 0; i < ids.Length; i++)
                    {
                        // 删除相应的用户
                        staffEntity = staffManager.GetEntity(ids[i]);
                        if (staffEntity.UserId != null)
                        {
                            userManager.SetDeleted(staffEntity.UserId);
                        }
                        // 删除职员
                        returnValue = staffManager.SetDeleted(ids[i], true);
                    }
                    BaseLogManager.Instance.Add(dbHelper, userInfo, this.serviceName, MethodBase.GetCurrentMethod());
                }
                catch (Exception ex)
                {
                    BaseExceptionManager.LogException(dbHelper, userInfo, ex);
                    throw ex;
                }
                finally
                {
                    dbHelper.Close();
                }
            }

            // 写入调试信息
            #if (DEBUG)
            BaseBusinessLogic.EndDebug(MethodBase.GetCurrentMethod(), milliStart);
            #endif

            return(returnValue);
        }
Beispiel #3
0
        /// <summary>
        /// 获取实体
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="id">主键</param>
        /// <returns>实体</returns>
        public BaseStaffEntity GetEntity(BaseUserInfo userInfo, string id)
        {
            BaseStaffEntity entity = null;

            var parameter = ServiceInfo.Create(userInfo, MethodBase.GetCurrentMethod());

            ServiceUtil.ProcessUserCenterReadDb(userInfo, parameter, (dbHelper) =>
            {
                var manager = new BaseStaffManager(dbHelper, userInfo);
                entity      = manager.GetEntity(id);
            });
            return(entity);
        }
Beispiel #4
0
 /// <summary>
 /// 添加或更新(主键是否为0)
 /// </summary>
 /// <param name="entity">实体</param>
 /// <param name="identity">自增量方式,表主键是否采用自增的策略</param>
 /// <param name="returnId">返回主键,不返回程序允许速度会快,主要是为了主细表批量插入数据优化用的</param>
 /// <returns>主键</returns>
 public string AddOrUpdate(BaseStaffEntity entity, bool identity = true, bool returnId = true)
 {
     Identity = identity;
     ReturnId = returnId;
     if (entity.Id == 0)
     {
         entity.Id = AddEntity(entity).ToInt();
         return(entity.Id.ToString());
     }
     else
     {
         return(UpdateEntity(entity) > 0 ? entity.Id.ToString() : string.Empty);
     }
 }
        /// <summary>
        /// 更新实体
        /// </summary>
        /// <param name="baseStaffEntity">实体</param>
        public int UpdateEntity(BaseStaffEntity baseStaffEntity)
        {
            SQLBuilder sqlBuilder = new SQLBuilder(DbHelper);

            sqlBuilder.BeginUpdate(this.CurrentTableName);
            this.SetEntity(sqlBuilder, baseStaffEntity);
            if (UserInfo != null)
            {
                sqlBuilder.SetValue(BaseStaffEntity.FieldModifiedUserId, UserInfo.Id);
                sqlBuilder.SetValue(BaseStaffEntity.FieldModifiedBy, UserInfo.RealName);
            }
            sqlBuilder.SetDBNow(BaseStaffEntity.FieldModifiedOn);
            sqlBuilder.SetWhere(BaseStaffEntity.FieldId, baseStaffEntity.Id);
            return(sqlBuilder.EndUpdate());
        }
Beispiel #6
0
        /// <summary>
        /// 通过编号获取选项的显示内容
        /// 这里是进行了内存缓存处理,减少数据库的I/O处理,提高程序的运行性能,
        /// 若有数据修改过,重新启动一下程序就可以了,这些基础数据也不是天天修改来修改去的,
        /// 所以没必要过度担忧,当然有需要时也可以写个刷新缓存的程序
        /// </summary>
        /// <param name="id">主键</param>
        /// <returns>显示值</returns>
        public static string GetRealName(string id)
        {
            string result = id;

            if (!string.IsNullOrEmpty(id))
            {
                List <BaseStaffEntity> entityList  = GetEntities();
                BaseStaffEntity        staffEntity = entityList.FirstOrDefault(entity => entity.Id.HasValue && entity.Id.ToString().Equals(id));
                if (staffEntity != null)
                {
                    result = staffEntity.RealName;
                }
            }
            return(result);
        }
Beispiel #7
0
        public static BaseStaffEntity GetObjectByCodeByCache(string code)
        {
            BaseStaffEntity result = null;

            System.Web.Caching.Cache cache = HttpRuntime.Cache;
            string cacheObject             = "StaffByCode" + code;

            if (cache != null && cache[cacheObject] == null)
            {
                BaseStaffManager staffManager = new BaseStaffManager();
                result = staffManager.GetObjectByCode(code);
                cache.Add(cacheObject, result, null, DateTime.Now.AddMinutes(10), TimeSpan.Zero, CacheItemPriority.Normal, null);
                System.Console.WriteLine(System.DateTime.Now.ToString(BaseSystemInfo.DateTimeFormat) + " cache Staff");
            }
            result = cache[cacheObject] as BaseStaffEntity;
            return(result);
        }
Beispiel #8
0
        /// <summary>
        /// 更新通讯地址
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="staffEntity">实体</param>
        /// <param name="statusCode">返回状态码</param>
        /// <param name="statusMessage">返回状态信息</param>
        /// <returns>影响行数</returns>
        public int UpdateAddress(BaseUserInfo userInfo, BaseStaffEntity staffEntity, out string statusCode, out string statusMessage)
        {
            // 写入调试信息
            #if (DEBUG)
            int milliStart = BaseBusinessLogic.StartDebug(userInfo, MethodBase.GetCurrentMethod());
            #endif

            // 加强安全验证防止未授权匿名调用
            #if (!DEBUG)
            LogOnService.UserIsLogOn(userInfo);
            #endif

            int returnValue = 0;
            using (IDbHelper dbHelper = DbHelperFactory.GetHelper(BaseSystemInfo.UserCenterDbType))
            {
                try
                {
                    dbHelper.Open(UserCenterDbConnection);
                    statusCode = string.Empty;
                    BaseStaffManager staffManager = new BaseStaffManager(dbHelper, userInfo);
                    // for (int i = 0; i < dataTable.Rows.Count; i++)
                    // {
                    returnValue += staffManager.UpdateAddress(staffEntity, out statusCode);
                    // }
                    statusMessage = staffManager.GetStateMessage(statusCode);
                    BaseLogManager.Instance.Add(dbHelper, userInfo, this.serviceName, AppMessage.StaffService_UpdateAddress, MethodBase.GetCurrentMethod());
                }
                catch (Exception ex)
                {
                    BaseExceptionManager.LogException(dbHelper, userInfo, ex);
                    throw ex;
                }
                finally
                {
                    dbHelper.Close();
                }
            }

            // 写入调试信息
            #if (DEBUG)
            BaseBusinessLogic.EndDebug(MethodBase.GetCurrentMethod(), milliStart);
            #endif

            return(returnValue);
        }
Beispiel #9
0
        /// <summary>
        /// 更新员工
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="entity">实体</param>
        /// <param name="status">状态</param>
        /// <param name="statusMessage">返回状消息</param>
        /// <returns>影响行数</returns>
        public int UpdateStaff(BaseUserInfo userInfo, BaseStaffEntity entity, out Status status, out string statusMessage)
        {
            var result = 0;

            var returnCode    = Status.Ok;
            var returnMessage = string.Empty;
            var parameter     = ServiceInfo.Create(userInfo, MethodBase.GetCurrentMethod());

            ServiceUtil.ProcessUserCenterWriteDb(userInfo, parameter, (dbHelper) =>
            {
                // 3.员工的修改
                var manager   = new BaseStaffManager(dbHelper, userInfo);
                result        = manager.UniqueUpdate(entity, out returnCode);
                returnMessage = manager.GetStateMessage(returnCode);
            });
            status        = returnCode;
            statusMessage = returnMessage;
            return(result);
        }
Beispiel #10
0
        /// <summary>
        /// 更新员工
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="staffEntity">实体</param>
        /// <param name="statusCode">返回状态码</param>
        /// <param name="statusMessage">返回状消息</param>
        /// <returns>影响行数</returns>
        public int UpdateStaff(BaseUserInfo userInfo, BaseStaffEntity staffEntity, out string statusCode, out string statusMessage)
        {
            // 写入调试信息
            #if (DEBUG)
            int milliStart = BaseBusinessLogic.StartDebug(userInfo, MethodBase.GetCurrentMethod());
            #endif

            // 加强安全验证防止未授权匿名调用
            if (!BaseSystemInfo.IsAuthorized(userInfo))
            {
                throw new Exception(AppMessage.MSG0800);
            }

            int returnValue = 0;
            using (IDbHelper dbHelper = DbHelperFactory.GetHelper(BaseSystemInfo.UserCenterDbType))
            {
                try
                {
                    dbHelper.Open(UserCenterDbConnection);
                    // 3.员工的修改
                    BaseStaffManager staffManager = new BaseStaffManager(dbHelper, userInfo);
                    returnValue   = staffManager.Update(staffEntity, out statusCode);
                    statusMessage = staffManager.GetStateMessage(statusCode);
                    BaseLogManager.Instance.Add(dbHelper, userInfo, this.serviceName, AppMessage.StaffService_UpdateStaff, MethodBase.GetCurrentMethod());
                }
                catch (Exception ex)
                {
                    BaseExceptionManager.LogException(dbHelper, userInfo, ex);
                    throw ex;
                }
                finally
                {
                    dbHelper.Close();
                }
            }

            // 写入调试信息
            #if (DEBUG)
            BaseBusinessLogic.EndDebug(MethodBase.GetCurrentMethod(), milliStart);
            #endif
            return(returnValue);
        }
Beispiel #11
0
        /// <summary>
        /// 添加员工
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="staffEntity">实体</param>
        /// <param name="statusCode">返回状态码</param>
        /// <param name="statusMessage">返回状消息</param>
        /// <returns>主键</returns>
        public string AddStaff(BaseUserInfo userInfo, BaseStaffEntity staffEntity, out string statusCode, out string statusMessage)
        {
            // 写入调试信息
            #if (DEBUG)
            int milliStart = BaseBusinessLogic.StartDebug(userInfo, MethodBase.GetCurrentMethod());
            #endif

            // 加强安全验证防止未授权匿名调用
            #if (!DEBUG)
            LogOnService.UserIsLogOn(userInfo);
            #endif

            string returnValue = string.Empty;
            using (IDbHelper dbHelper = DbHelperFactory.GetHelper(BaseSystemInfo.UserCenterDbType))
            {
                try
                {
                    dbHelper.Open(UserCenterDbConnection);
                    // 1.若添加用户成功,添加员工。
                    BaseStaffManager staffManager = new BaseStaffManager(dbHelper, userInfo);
                    returnValue   = staffManager.Add(staffEntity, out statusCode);
                    statusMessage = staffManager.GetStateMessage(statusCode);
                    // 2.自己不用给自己发提示信息,这个提示信息是为了提高工作效率的
                    BaseLogManager.Instance.Add(dbHelper, userInfo, this.serviceName, AppMessage.StaffService_AddStaff, MethodBase.GetCurrentMethod());
                }
                catch (Exception ex)
                {
                    BaseExceptionManager.LogException(dbHelper, userInfo, ex);
                    throw ex;
                }
                finally
                {
                    dbHelper.Close();
                }
            }

            // 写入调试信息
            #if (DEBUG)
            BaseBusinessLogic.EndDebug(MethodBase.GetCurrentMethod(), milliStart);
            #endif
            return(returnValue);
        }
Beispiel #12
0
        /// <summary>
        /// 添加员工
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="entity">实体</param>
        /// <param name="status">状态</param>
        /// <param name="statusMessage">返回状消息</param>
        /// <returns>主键</returns>
        public string AddStaff(BaseUserInfo userInfo, BaseStaffEntity entity, out Status status, out string statusMessage)
        {
            var result = string.Empty;

            var returnCode    = Status.Ok;
            var returnMessage = string.Empty;
            var parameter     = ServiceInfo.Create(userInfo, MethodBase.GetCurrentMethod());

            ServiceUtil.ProcessUserCenterWriteDb(userInfo, parameter, (dbHelper) =>
            {
                // 1.若添加用户成功,添加员工。
                var manager   = new BaseStaffManager(dbHelper, userInfo);
                result        = manager.UniqueAdd(entity, out returnCode);
                returnMessage = manager.GetStateMessage(returnCode);
                // 2.自己不用给自己发提示信息,这个提示信息是为了提高工作效率的
            });
            status        = returnCode;
            statusMessage = returnMessage;
            return(result);
        }
Beispiel #13
0
        /// <summary>
        /// 获取实体
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="id">主键</param>
        /// <returns>实体</returns>
        public BaseStaffEntity GetEntity(BaseUserInfo userInfo, string id)
        {
            // 写入调试信息
            #if (DEBUG)
            int milliStart = BaseBusinessLogic.StartDebug(userInfo, MethodBase.GetCurrentMethod());
            #endif

            // 加强安全验证防止未授权匿名调用
            #if (!DEBUG)
            LogOnService.UserIsLogOn(userInfo);
            #endif

            BaseStaffEntity staffEntity = null;
            using (IDbHelper dbHelper = DbHelperFactory.GetHelper(BaseSystemInfo.UserCenterDbType))
            {
                try
                {
                    dbHelper.Open(UserCenterDbConnection);
                    BaseStaffManager staffManager = new BaseStaffManager(dbHelper, userInfo);
                    staffEntity = staffManager.GetEntity(id);
                    BaseLogManager.Instance.Add(dbHelper, userInfo, this.serviceName, AppMessage.StaffService_GetEntity, MethodBase.GetCurrentMethod());
                }
                catch (Exception ex)
                {
                    BaseExceptionManager.LogException(dbHelper, userInfo, ex);
                    throw ex;
                }
                finally
                {
                    dbHelper.Close();
                }
            }

            // 写入调试信息
            #if (DEBUG)
            BaseBusinessLogic.EndDebug(MethodBase.GetCurrentMethod(), milliStart);
            #endif

            return(staffEntity);
        }
Beispiel #14
0
        /// <summary>
        /// 更新通讯地址
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="entity">实体</param>
        /// <param name="status">状态</param>
        /// <param name="statusMessage">返回状态信息</param>
        /// <returns>影响行数</returns>
        public int UpdateAddress(BaseUserInfo userInfo, BaseStaffEntity entity, out Status status, out string statusMessage)
        {
            var result = 0;

            var returnCode    = Status.Ok;
            var returnMessage = string.Empty;

            var parameter = ServiceInfo.Create(userInfo, MethodBase.GetCurrentMethod());

            ServiceUtil.ProcessUserCenterWriteDb(userInfo, parameter, (dbHelper) =>
            {
                var manager = new BaseStaffManager(dbHelper, userInfo);
                // for (int i = 0; i < result.Rows.Count; i++)
                // {
                result += manager.UpdateAddress(entity, out returnCode);
                // }
                returnMessage = manager.GetStateMessage(returnCode);
            });
            status        = returnCode;
            statusMessage = returnMessage;
            return(result);
        }
Beispiel #15
0
        /// <summary>
        /// 扮演用户
        /// </summary>
        /// <param name="id">用户主键</param>
        /// <param name="status">状态</param>
        /// <returns>用户类</returns>
        public BaseUserInfo Impersonation(int id, out Status status)
        {
            BaseUserInfo userInfo = null;
            // 获得登录信息
            var entity = new BaseUserLogonManager(DbHelper, UserInfo).GetEntityByUserId(id.ToString());

            // 只允许登录一次,需要检查是否自己重新登录了,或者自己扮演自己了
            if (!UserInfo.Id.Equals(id))
            {
                if (BaseSystemInfo.CheckOnline)
                {
                    if (entity.UserOnline > 0)
                    {
                        status = Status.ErrorOnline;
                        return(userInfo);
                    }
                }
            }

            var userEntity = GetEntity(id);

            userInfo = ConvertToUserInfo(userEntity);
            if (userEntity.IsStaff.Equals("1"))
            {
                // 获得员工的信息
                var staffEntity    = new BaseStaffEntity();
                var staffManager   = new BaseStaffManager(DbHelper, UserInfo);
                var dataTableStaff = staffManager.GetDataTableById(id.ToString());
                staffEntity.GetSingle(dataTableStaff);
                userInfo = staffManager.ConvertToUserInfo(userInfo, staffEntity);
            }
            status = Status.Ok;
            // 登录、重新登录、扮演时的在线状态进行更新
            var userLogonManager = new BaseUserLogonManager(DbHelper, UserInfo);

            userLogonManager.ChangeOnline(id);
            return(userInfo);
        }
Beispiel #16
0
        /// <summary>
        /// 扮演用户
        /// </summary>
        /// <param name="id">用户主键</param>
        /// <returns>用户类</returns>
        public BaseUserInfo Impersonation(string id, out string statusCode)
        {
            BaseUserInfo userInfo = null;
            // 获得登录信息
            BaseUserLogOnEntity entity = new BaseUserLogOnManager(this.DbHelper, this.UserInfo).GetObject(id);

            // 只允许登录一次,需要检查是否自己重新登录了,或者自己扮演自己了
            if (!UserInfo.Id.Equals(id))
            {
                if (BaseSystemInfo.CheckOnLine)
                {
                    if (entity.UserOnLine > 0)
                    {
                        statusCode = Status.ErrorOnLine.ToString();
                        return(userInfo);
                    }
                }
            }

            BaseUserEntity userEntity = this.GetObject(id);

            userInfo = this.ConvertToUserInfo(userEntity);
            if (userEntity.IsStaff.Equals("1"))
            {
                // 获得员工的信息
                BaseStaffEntity  staffEntity    = new BaseStaffEntity();
                BaseStaffManager staffManager   = new BaseStaffManager(DbHelper, UserInfo);
                DataTable        dataTableStaff = staffManager.GetDataTableById(id);
                staffEntity.GetSingle(dataTableStaff);
                userInfo = staffManager.ConvertToUserInfo(userInfo, staffEntity);
            }
            statusCode = Status.OK.ToString();
            // 登录、重新登录、扮演时的在线状态进行更新
            BaseUserLogOnManager userLogOnManager = new BaseUserLogOnManager(this.DbHelper, this.UserInfo);

            userLogOnManager.ChangeOnLine(id);
            return(userInfo);
        }
Beispiel #17
0
        /// <summary>
        /// 更新实体
        /// </summary>
        /// <param name="entity">实体</param>
        public int UpdateEntity(BaseStaffEntity entity)
        {
            var sqlBuilder = new SqlBuilder(DbHelper);

            sqlBuilder.BeginUpdate(CurrentTableName);
            SetEntity(sqlBuilder, entity);
            if (UserInfo != null)
            {
                sqlBuilder.SetValue(BaseStaffEntity.FieldUpdateUserId, UserInfo.UserId);
                sqlBuilder.SetValue(BaseStaffEntity.FieldUpdateUserName, UserInfo.UserName);
                sqlBuilder.SetValue(BaseStaffEntity.FieldUpdateBy, UserInfo.RealName);
            }
            sqlBuilder.SetDbNow(BaseStaffEntity.FieldUpdateTime);
            sqlBuilder.SetValue(BaseStaffEntity.FieldUpdateIp, Utils.GetIp());
            sqlBuilder.SetWhere(PrimaryKey, entity.Id);
            //return sqlBuilder.EndUpdate();
            var result = sqlBuilder.EndUpdate();

            if (result > 0)
            {
                RemoveCache(entity.Id);
            }
            return(result);
        }
 /// <summary>
 /// 添加
 /// </summary>
 /// <param name="baseStaffEntity">实体</param>
 /// <returns>主键</returns>
 public string Add(BaseStaffEntity baseStaffEntity)
 {
     return(this.AddEntity(baseStaffEntity));
 }
 /// <summary>
 /// 设置实体
 /// </summary>
 /// <param name="baseStaffEntity">实体</param>
 private void SetEntity(SQLBuilder sqlBuilder, BaseStaffEntity baseStaffEntity)
 {
     SetEntityExpand(sqlBuilder, baseStaffEntity);
     sqlBuilder.SetValue(BaseStaffEntity.FieldUserId, baseStaffEntity.UserId);
     sqlBuilder.SetValue(BaseStaffEntity.FieldUserName, baseStaffEntity.UserName);
     sqlBuilder.SetValue(BaseStaffEntity.FieldRealName, baseStaffEntity.RealName);
     sqlBuilder.SetValue(BaseStaffEntity.FieldCode, baseStaffEntity.Code);
     sqlBuilder.SetValue(BaseStaffEntity.FieldGender, baseStaffEntity.Gender);
     sqlBuilder.SetValue(BaseStaffEntity.FieldSubCompanyId, baseStaffEntity.SubCompanyId);
     sqlBuilder.SetValue(BaseStaffEntity.FieldCompanyId, baseStaffEntity.CompanyId);
     sqlBuilder.SetValue(BaseStaffEntity.FieldDepartmentId, baseStaffEntity.DepartmentId);
     sqlBuilder.SetValue(BaseStaffEntity.FieldWorkgroupId, baseStaffEntity.WorkgroupId);
     sqlBuilder.SetValue(BaseStaffEntity.FieldQuickQuery, baseStaffEntity.QuickQuery);
     sqlBuilder.SetValue(BaseStaffEntity.FieldDutyId, baseStaffEntity.DutyId);
     sqlBuilder.SetValue(BaseStaffEntity.FieldIdentificationCode, baseStaffEntity.IdentificationCode);
     sqlBuilder.SetValue(BaseStaffEntity.FieldIDCard, baseStaffEntity.IDCard);
     sqlBuilder.SetValue(BaseStaffEntity.FieldBankCode, baseStaffEntity.BankCode);
     sqlBuilder.SetValue(BaseStaffEntity.FieldEmail, baseStaffEntity.Email);
     sqlBuilder.SetValue(BaseStaffEntity.FieldMobile, baseStaffEntity.Mobile);
     sqlBuilder.SetValue(BaseStaffEntity.FieldShortNumber, baseStaffEntity.ShortNumber);
     sqlBuilder.SetValue(BaseStaffEntity.FieldTelephone, baseStaffEntity.Telephone);
     sqlBuilder.SetValue(BaseStaffEntity.FieldOICQ, baseStaffEntity.OICQ);
     sqlBuilder.SetValue(BaseStaffEntity.FieldOfficePhone, baseStaffEntity.OfficePhone);
     sqlBuilder.SetValue(BaseStaffEntity.FieldOfficeZipCode, baseStaffEntity.OfficeZipCode);
     sqlBuilder.SetValue(BaseStaffEntity.FieldOfficeAddress, baseStaffEntity.OfficeAddress);
     sqlBuilder.SetValue(BaseStaffEntity.FieldOfficeFax, baseStaffEntity.OfficeFax);
     sqlBuilder.SetValue(BaseStaffEntity.FieldAge, baseStaffEntity.Age);
     sqlBuilder.SetValue(BaseStaffEntity.FieldBirthday, baseStaffEntity.Birthday);
     sqlBuilder.SetValue(BaseStaffEntity.FieldEducation, baseStaffEntity.Education);
     sqlBuilder.SetValue(BaseStaffEntity.FieldSchool, baseStaffEntity.School);
     sqlBuilder.SetValue(BaseStaffEntity.FieldGraduationDate, baseStaffEntity.GraduationDate);
     sqlBuilder.SetValue(BaseStaffEntity.FieldMajor, baseStaffEntity.Major);
     sqlBuilder.SetValue(BaseStaffEntity.FieldDegree, baseStaffEntity.Degree);
     sqlBuilder.SetValue(BaseStaffEntity.FieldTitleId, baseStaffEntity.TitleId);
     sqlBuilder.SetValue(BaseStaffEntity.FieldTitleDate, baseStaffEntity.TitleDate);
     sqlBuilder.SetValue(BaseStaffEntity.FieldTitleLevel, baseStaffEntity.TitleLevel);
     sqlBuilder.SetValue(BaseStaffEntity.FieldWorkingDate, baseStaffEntity.WorkingDate);
     sqlBuilder.SetValue(BaseStaffEntity.FieldJoinInDate, baseStaffEntity.JoinInDate);
     sqlBuilder.SetValue(BaseStaffEntity.FieldHomeZipCode, baseStaffEntity.HomeZipCode);
     sqlBuilder.SetValue(BaseStaffEntity.FieldHomeAddress, baseStaffEntity.HomeAddress);
     sqlBuilder.SetValue(BaseStaffEntity.FieldHomePhone, baseStaffEntity.HomePhone);
     sqlBuilder.SetValue(BaseStaffEntity.FieldHomeFax, baseStaffEntity.HomeFax);
     sqlBuilder.SetValue(BaseStaffEntity.FieldProvince, baseStaffEntity.Province);
     sqlBuilder.SetValue(BaseStaffEntity.FieldCarCode, baseStaffEntity.CarCode);
     sqlBuilder.SetValue(BaseStaffEntity.FieldCity, baseStaffEntity.City);
     sqlBuilder.SetValue(BaseStaffEntity.FieldArea, baseStaffEntity.Area);
     sqlBuilder.SetValue(BaseStaffEntity.FieldNativePlace, baseStaffEntity.NativePlace);
     sqlBuilder.SetValue(BaseStaffEntity.FieldParty, baseStaffEntity.Party);
     sqlBuilder.SetValue(BaseStaffEntity.FieldNation, baseStaffEntity.Nation);
     sqlBuilder.SetValue(BaseStaffEntity.FieldNationality, baseStaffEntity.Nationality);
     sqlBuilder.SetValue(BaseStaffEntity.FieldWorkingProperty, baseStaffEntity.WorkingProperty);
     sqlBuilder.SetValue(BaseStaffEntity.FieldCompetency, baseStaffEntity.Competency);
     sqlBuilder.SetValue(BaseStaffEntity.FieldEmergencyContact, baseStaffEntity.EmergencyContact);
     sqlBuilder.SetValue(BaseStaffEntity.FieldIsDimission, baseStaffEntity.IsDimission);
     sqlBuilder.SetValue(BaseStaffEntity.FieldDimissionDate, baseStaffEntity.DimissionDate);
     sqlBuilder.SetValue(BaseStaffEntity.FieldDimissionCause, baseStaffEntity.DimissionCause);
     sqlBuilder.SetValue(BaseStaffEntity.FieldDimissionWhither, baseStaffEntity.DimissionWhither);
     sqlBuilder.SetValue(BaseStaffEntity.FieldEnabled, baseStaffEntity.Enabled);
     sqlBuilder.SetValue(BaseStaffEntity.FieldDeletionStateCode, baseStaffEntity.DeletionStateCode);
     sqlBuilder.SetValue(BaseStaffEntity.FieldSortCode, baseStaffEntity.SortCode);
     sqlBuilder.SetValue(BaseStaffEntity.FieldDescription, baseStaffEntity.Description);
 }
 // 这个是声明扩展方法
 partial void SetEntityExpand(SQLBuilder sqlBuilder, BaseStaffEntity baseStaffEntity);
        /// <summary>
        /// 添加实体
        /// </summary>
        /// <param name="baseStaffEntity">实体</param>
        public string AddEntity(BaseStaffEntity baseStaffEntity)
        {
            string sequence = string.Empty;

            if (baseStaffEntity.SortCode == null || baseStaffEntity.SortCode == 0)
            {
                BaseSequenceManager sequenceManager = new BaseSequenceManager(DbHelper, this.Identity);
                sequence = sequenceManager.GetSequence(this.CurrentTableName);
                baseStaffEntity.SortCode = int.Parse(sequence);
            }
            SQLBuilder sqlBuilder = new SQLBuilder(DbHelper, this.Identity, this.ReturnId);

            sqlBuilder.BeginInsert(this.CurrentTableName, BaseStaffEntity.FieldId);
            if (!this.Identity)
            {
                sqlBuilder.SetValue(BaseStaffEntity.FieldId, baseStaffEntity.Id);
            }
            else
            {
                if (!this.ReturnId && (DbHelper.CurrentDbType == CurrentDbType.Oracle || DbHelper.CurrentDbType == CurrentDbType.DB2))
                {
                    if (DbHelper.CurrentDbType == CurrentDbType.Oracle)
                    {
                        sqlBuilder.SetFormula(BaseStaffEntity.FieldId, "SEQ_" + this.CurrentTableName.ToUpper() + ".NEXTVAL ");
                    }
                    if (DbHelper.CurrentDbType == CurrentDbType.DB2)
                    {
                        sqlBuilder.SetFormula(BaseStaffEntity.FieldId, "NEXT VALUE FOR SEQ_" + this.CurrentTableName.ToUpper());
                    }
                }
                else
                {
                    if (this.Identity && (DbHelper.CurrentDbType == CurrentDbType.Oracle || DbHelper.CurrentDbType == CurrentDbType.DB2))
                    {
                        if (baseStaffEntity.Id == null)
                        {
                            if (string.IsNullOrEmpty(sequence))
                            {
                                BaseSequenceManager sequenceManager = new BaseSequenceManager(DbHelper, this.Identity);
                                sequence = sequenceManager.GetSequence(this.CurrentTableName);
                            }
                            baseStaffEntity.Id = int.Parse(sequence);
                        }
                        sqlBuilder.SetValue(BaseStaffEntity.FieldId, baseStaffEntity.Id);
                    }
                }
            }
            this.SetEntity(sqlBuilder, baseStaffEntity);
            if (UserInfo != null)
            {
                sqlBuilder.SetValue(BaseStaffEntity.FieldCreateUserId, UserInfo.Id);
                sqlBuilder.SetValue(BaseStaffEntity.FieldCreateBy, UserInfo.RealName);
            }
            sqlBuilder.SetDBNow(BaseStaffEntity.FieldCreateOn);
            if (UserInfo != null)
            {
                sqlBuilder.SetValue(BaseStaffEntity.FieldModifiedUserId, UserInfo.Id);
                sqlBuilder.SetValue(BaseStaffEntity.FieldModifiedBy, UserInfo.RealName);
            }
            sqlBuilder.SetDBNow(BaseStaffEntity.FieldModifiedOn);
            if (this.Identity && (DbHelper.CurrentDbType == CurrentDbType.SqlServer || DbHelper.CurrentDbType == CurrentDbType.Access))
            {
                sequence = sqlBuilder.EndInsert().ToString();
            }
            else
            {
                sqlBuilder.EndInsert();
            }
            return(sequence);
        }
        public BaseStaffEntity GetEntity(int id)
        {
            BaseStaffEntity baseStaffEntity = new BaseStaffEntity(this.GetDataTable(new KeyValuePair <string, object>(BaseStaffEntity.FieldId, id)));

            return(baseStaffEntity);
        }
Beispiel #23
0
 /// <summary>
 /// 设置实体
 /// </summary>
 /// <param name="sqlBuilder">Sql语句生成器</param>
 /// <param name="entity">实体</param>
 private void SetEntity(SqlBuilder sqlBuilder, BaseStaffEntity entity)
 {
     SetEntityExtend(sqlBuilder, entity);
     sqlBuilder.SetValue(BaseStaffEntity.FieldUserId, entity.UserId);
     sqlBuilder.SetValue(BaseStaffEntity.FieldUserName, entity.UserName);
     sqlBuilder.SetValue(BaseStaffEntity.FieldEmployeeNumber, entity.EmployeeNumber);
     sqlBuilder.SetValue(BaseStaffEntity.FieldRealName, entity.RealName);
     sqlBuilder.SetValue(BaseStaffEntity.FieldChineseName, entity.ChineseName);
     sqlBuilder.SetValue(BaseStaffEntity.FieldEnglishName, entity.EnglishName);
     sqlBuilder.SetValue(BaseStaffEntity.FieldQuickQuery, entity.QuickQuery);
     sqlBuilder.SetValue(BaseStaffEntity.FieldCompanyId, entity.CompanyId);
     sqlBuilder.SetValue(BaseStaffEntity.FieldCompanyName, entity.CompanyName);
     sqlBuilder.SetValue(BaseStaffEntity.FieldSubCompanyId, entity.SubCompanyId);
     sqlBuilder.SetValue(BaseStaffEntity.FieldSubCompanyName, entity.SubCompanyName);
     sqlBuilder.SetValue(BaseStaffEntity.FieldDepartmentId, entity.DepartmentId);
     sqlBuilder.SetValue(BaseStaffEntity.FieldDepartmentName, entity.DepartmentName);
     sqlBuilder.SetValue(BaseStaffEntity.FieldWorkgroupId, entity.WorkgroupId);
     sqlBuilder.SetValue(BaseStaffEntity.FieldWorkgroupName, entity.WorkgroupName);
     sqlBuilder.SetValue(BaseStaffEntity.FieldDutyId, entity.DutyId);
     sqlBuilder.SetValue(BaseStaffEntity.FieldGender, entity.Gender);
     sqlBuilder.SetValue(BaseStaffEntity.FieldBirthday, entity.Birthday);
     sqlBuilder.SetValue(BaseStaffEntity.FieldAge, entity.Age);
     sqlBuilder.SetValue(BaseStaffEntity.FieldHeight, entity.Height);
     sqlBuilder.SetValue(BaseStaffEntity.FieldWeight, entity.Weight);
     sqlBuilder.SetValue(BaseStaffEntity.FieldIdentificationCode, entity.IdentificationCode);
     sqlBuilder.SetValue(BaseStaffEntity.FieldIdCard, entity.IdCard);
     sqlBuilder.SetValue(BaseStaffEntity.FieldNation, entity.Nation);
     sqlBuilder.SetValue(BaseStaffEntity.FieldEducation, entity.Education);
     sqlBuilder.SetValue(BaseStaffEntity.FieldSchool, entity.School);
     sqlBuilder.SetValue(BaseStaffEntity.FieldGraduationDate, entity.GraduationDate);
     sqlBuilder.SetValue(BaseStaffEntity.FieldMajor, entity.Major);
     sqlBuilder.SetValue(BaseStaffEntity.FieldDegree, entity.Degree);
     sqlBuilder.SetValue(BaseStaffEntity.FieldTitleId, entity.TitleId);
     sqlBuilder.SetValue(BaseStaffEntity.FieldTitleDate, entity.TitleDate);
     sqlBuilder.SetValue(BaseStaffEntity.FieldTitleLevel, entity.TitleLevel);
     sqlBuilder.SetValue(BaseStaffEntity.FieldWorkingDate, entity.WorkingDate);
     sqlBuilder.SetValue(BaseStaffEntity.FieldJoinInDate, entity.JoinInDate);
     sqlBuilder.SetValue(BaseStaffEntity.FieldOfficePostCode, entity.OfficePostCode);
     sqlBuilder.SetValue(BaseStaffEntity.FieldOfficeAddress, entity.OfficeAddress);
     sqlBuilder.SetValue(BaseStaffEntity.FieldOfficePhone, entity.OfficePhone);
     sqlBuilder.SetValue(BaseStaffEntity.FieldOfficeFax, entity.OfficeFax);
     sqlBuilder.SetValue(BaseStaffEntity.FieldHomePostCode, entity.HomePostCode);
     sqlBuilder.SetValue(BaseStaffEntity.FieldHomeAddress, entity.HomeAddress);
     sqlBuilder.SetValue(BaseStaffEntity.FieldHomePhone, entity.HomePhone);
     sqlBuilder.SetValue(BaseStaffEntity.FieldHomeFax, entity.HomeFax);
     sqlBuilder.SetValue(BaseStaffEntity.FieldPlateNumber1, entity.PlateNumber1);
     sqlBuilder.SetValue(BaseStaffEntity.FieldPlateNumber2, entity.PlateNumber2);
     sqlBuilder.SetValue(BaseStaffEntity.FieldPlateNumber3, entity.PlateNumber3);
     sqlBuilder.SetValue(BaseStaffEntity.FieldRewardCard, entity.RewardCard);
     sqlBuilder.SetValue(BaseStaffEntity.FieldMedicalCard, entity.MedicalCard);
     sqlBuilder.SetValue(BaseStaffEntity.FieldUnionMember, entity.UnionMember);
     sqlBuilder.SetValue(BaseStaffEntity.FieldEmail, entity.Email);
     sqlBuilder.SetValue(BaseStaffEntity.FieldMobile, entity.Mobile);
     sqlBuilder.SetValue(BaseStaffEntity.FieldQq, entity.Qq);
     sqlBuilder.SetValue(BaseStaffEntity.FieldWeChat, entity.WeChat);
     sqlBuilder.SetValue(BaseStaffEntity.FieldShortNumber, entity.ShortNumber);
     sqlBuilder.SetValue(BaseStaffEntity.FieldTelephone, entity.Telephone);
     sqlBuilder.SetValue(BaseStaffEntity.FieldExtension, entity.Extension);
     sqlBuilder.SetValue(BaseStaffEntity.FieldEmergencyContact, entity.EmergencyContact);
     sqlBuilder.SetValue(BaseStaffEntity.FieldEmergencyMobile, entity.EmergencyMobile);
     sqlBuilder.SetValue(BaseStaffEntity.FieldEmergencyTelephone, entity.EmergencyTelephone);
     sqlBuilder.SetValue(BaseStaffEntity.FieldNativePlace, entity.NativePlace);
     sqlBuilder.SetValue(BaseStaffEntity.FieldBankName, entity.BankName);
     sqlBuilder.SetValue(BaseStaffEntity.FieldBankAccount, entity.BankAccount);
     sqlBuilder.SetValue(BaseStaffEntity.FieldBankUserName, entity.BankUserName);
     sqlBuilder.SetValue(BaseStaffEntity.FieldProvince, entity.Province);
     sqlBuilder.SetValue(BaseStaffEntity.FieldCity, entity.City);
     sqlBuilder.SetValue(BaseStaffEntity.FieldDistrict, entity.District);
     sqlBuilder.SetValue(BaseStaffEntity.FieldCurrentProvince, entity.CurrentProvince);
     sqlBuilder.SetValue(BaseStaffEntity.FieldCurrentCity, entity.CurrentCity);
     sqlBuilder.SetValue(BaseStaffEntity.FieldCurrentDistrict, entity.CurrentDistrict);
     sqlBuilder.SetValue(BaseStaffEntity.FieldParty, entity.Party);
     sqlBuilder.SetValue(BaseStaffEntity.FieldNationality, entity.Nationality);
     sqlBuilder.SetValue(BaseStaffEntity.FieldWorkingProperty, entity.WorkingProperty);
     sqlBuilder.SetValue(BaseStaffEntity.FieldCompetency, entity.Competency);
     sqlBuilder.SetValue(BaseStaffEntity.FieldMarriage, entity.Marriage);
     sqlBuilder.SetValue(BaseStaffEntity.FieldWeddingDate, entity.WeddingDate);
     sqlBuilder.SetValue(BaseStaffEntity.FieldDivorceDate, entity.DivorceDate);
     sqlBuilder.SetValue(BaseStaffEntity.FieldChild1Birthday, entity.Child1Birthday);
     sqlBuilder.SetValue(BaseStaffEntity.FieldChild2Birthday, entity.Child2Birthday);
     sqlBuilder.SetValue(BaseStaffEntity.FieldChild3Birthday, entity.Child3Birthday);
     sqlBuilder.SetValue(BaseStaffEntity.FieldChild4Birthday, entity.Child4Birthday);
     sqlBuilder.SetValue(BaseStaffEntity.FieldChild5Birthday, entity.Child5Birthday);
     sqlBuilder.SetValue(BaseStaffEntity.FieldIsDimission, entity.IsDimission);
     sqlBuilder.SetValue(BaseStaffEntity.FieldDimissionDate, entity.DimissionDate);
     sqlBuilder.SetValue(BaseStaffEntity.FieldDimissionCause, entity.DimissionCause);
     sqlBuilder.SetValue(BaseStaffEntity.FieldDimissionWhereabouts, entity.DimissionWhereabouts);
     sqlBuilder.SetValue(BaseStaffEntity.FieldExt1, entity.Ext1);
     sqlBuilder.SetValue(BaseStaffEntity.FieldExt2, entity.Ext2);
     sqlBuilder.SetValue(BaseStaffEntity.FieldExt3, entity.Ext3);
     sqlBuilder.SetValue(BaseStaffEntity.FieldExt4, entity.Ext4);
     sqlBuilder.SetValue(BaseStaffEntity.FieldExt5, entity.Ext5);
     sqlBuilder.SetValue(BaseStaffEntity.FieldDescription, entity.Description);
     sqlBuilder.SetValue(BaseStaffEntity.FieldSortCode, entity.SortCode);
     sqlBuilder.SetValue(BaseStaffEntity.FieldDeleted, entity.Deleted);
     sqlBuilder.SetValue(BaseStaffEntity.FieldEnabled, entity.Enabled);
 }
 /// <summary>
 /// 添加
 /// </summary>
 /// <param name="baseStaffEntity">实体</param>
 /// <param name="identity">自增量方式</param>
 /// <param name="returnId">返回主键</param>
 /// <returns>主键</returns>
 public string Add(BaseStaffEntity baseStaffEntity, bool identity, bool returnId)
 {
     this.Identity = identity;
     this.ReturnId = returnId;
     return(this.AddEntity(baseStaffEntity));
 }
 /// <summary>
 /// 添加
 /// </summary>
 /// <param name="entity">实体</param>
 /// <param name="identity">自增量方式</param>
 /// <param name="returnId">返回主键</param>
 /// <returns>主键</returns>
 public string Add(BaseStaffEntity entity, bool identity = true, bool returnId = false)
 {
     this.Identity = identity;
     this.ReturnId = returnId;
     return(this.AddObject(entity));
 }
 // 这个是声明扩展方法
 partial void SetObjectExpand(SQLBuilder sqlBuilder, BaseStaffEntity entity);
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="entity">实体</param>
 public int Update(BaseStaffEntity entity)
 {
     return(this.UpdateObject(entity));
 }
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="baseStaffEntity">实体</param>
 public int Update(BaseStaffEntity baseStaffEntity)
 {
     return(this.UpdateEntity(baseStaffEntity));
 }
 /// <summary>
 /// 设置实体
 /// </summary>
 /// <param name="entity">实体</param>
 private void SetObject(SQLBuilder sqlBuilder, BaseStaffEntity entity)
 {
     SetObjectExpand(sqlBuilder, entity);
     sqlBuilder.SetValue(BaseStaffEntity.FieldUserId, entity.UserId);
     sqlBuilder.SetValue(BaseStaffEntity.FieldUserName, entity.UserName);
     sqlBuilder.SetValue(BaseStaffEntity.FieldRealName, entity.RealName);
     sqlBuilder.SetValue(BaseStaffEntity.FieldCode, entity.Code);
     sqlBuilder.SetValue(BaseStaffEntity.FieldGender, entity.Gender);
     sqlBuilder.SetValue(BaseStaffEntity.FieldCompanyId, entity.CompanyId);
     sqlBuilder.SetValue(BaseStaffEntity.FieldCompanyName, entity.CompanyName);
     sqlBuilder.SetValue(BaseStaffEntity.FieldSubCompanyId, entity.SubCompanyId);
     sqlBuilder.SetValue(BaseStaffEntity.FieldDepartmentId, entity.DepartmentId);
     sqlBuilder.SetValue(BaseStaffEntity.FieldDepartmentName, entity.DepartmentName);
     sqlBuilder.SetValue(BaseStaffEntity.FieldWorkgroupId, entity.WorkgroupId);
     sqlBuilder.SetValue(BaseStaffEntity.FieldWorkgroupName, entity.WorkgroupName);
     sqlBuilder.SetValue(BaseStaffEntity.FieldQuickQuery, entity.QuickQuery);
     sqlBuilder.SetValue(BaseStaffEntity.FieldDutyId, entity.DutyId);
     sqlBuilder.SetValue(BaseStaffEntity.FieldIdentificationCode, entity.IdentificationCode);
     sqlBuilder.SetValue(BaseStaffEntity.FieldIDCard, entity.IDCard);
     sqlBuilder.SetValue(BaseStaffEntity.FieldBankCode, entity.BankCode);
     sqlBuilder.SetValue(BaseStaffEntity.FieldBankName, entity.BankName);
     // sqlBuilder.SetValue(BaseStaffEntity.FieldBankUserName, entity.BankUserName);
     sqlBuilder.SetValue(BaseStaffEntity.FieldRewarCard, entity.RewarCard);
     sqlBuilder.SetValue(BaseStaffEntity.FieldMedicalCard, entity.MedicalCard);
     sqlBuilder.SetValue(BaseStaffEntity.FieldUnionMember, entity.UnionMember);
     sqlBuilder.SetValue(BaseStaffEntity.FieldEmail, entity.Email);
     sqlBuilder.SetValue(BaseStaffEntity.FieldMobile, entity.Mobile);
     sqlBuilder.SetValue(BaseStaffEntity.FieldShortNumber, entity.ShortNumber);
     sqlBuilder.SetValue(BaseStaffEntity.FieldTelephone, entity.Telephone);
     sqlBuilder.SetValue(BaseStaffEntity.FieldExtension, entity.Extension);
     sqlBuilder.SetValue(BaseStaffEntity.FieldQQ, entity.QQ);
     sqlBuilder.SetValue(BaseStaffEntity.FieldOfficePhone, entity.OfficePhone);
     sqlBuilder.SetValue(BaseStaffEntity.FieldOfficePostCode, entity.OfficePostCode);
     sqlBuilder.SetValue(BaseStaffEntity.FieldOfficeAddress, entity.OfficeAddress);
     sqlBuilder.SetValue(BaseStaffEntity.FieldOfficeFax, entity.OfficeFax);
     sqlBuilder.SetValue(BaseStaffEntity.FieldAge, entity.Age);
     sqlBuilder.SetValue(BaseStaffEntity.FieldBirthday, entity.Birthday);
     sqlBuilder.SetValue(BaseStaffEntity.FieldHeight, entity.Height);
     sqlBuilder.SetValue(BaseStaffEntity.FieldWeight, entity.Weight);
     sqlBuilder.SetValue(BaseStaffEntity.FieldMarriage, entity.Marriage);
     sqlBuilder.SetValue(BaseStaffEntity.FieldEducation, entity.Education);
     sqlBuilder.SetValue(BaseStaffEntity.FieldSchool, entity.School);
     sqlBuilder.SetValue(BaseStaffEntity.FieldGraduationDate, entity.GraduationDate);
     sqlBuilder.SetValue(BaseStaffEntity.FieldMajor, entity.Major);
     sqlBuilder.SetValue(BaseStaffEntity.FieldDegree, entity.Degree);
     sqlBuilder.SetValue(BaseStaffEntity.FieldTitleId, entity.TitleId);
     sqlBuilder.SetValue(BaseStaffEntity.FieldTitleDate, entity.TitleDate);
     sqlBuilder.SetValue(BaseStaffEntity.FieldTitleLevel, entity.TitleLevel);
     sqlBuilder.SetValue(BaseStaffEntity.FieldWorkingDate, entity.WorkingDate);
     sqlBuilder.SetValue(BaseStaffEntity.FieldJoinInDate, entity.JoinInDate);
     sqlBuilder.SetValue(BaseStaffEntity.FieldHomePostCode, entity.HomePostCode);
     sqlBuilder.SetValue(BaseStaffEntity.FieldHomeAddress, entity.HomeAddress);
     sqlBuilder.SetValue(BaseStaffEntity.FieldHomePhone, entity.HomePhone);
     sqlBuilder.SetValue(BaseStaffEntity.FieldHomeFax, entity.HomeFax);
     sqlBuilder.SetValue(BaseStaffEntity.FieldCarCode, entity.CarCode);
     sqlBuilder.SetValue(BaseStaffEntity.FieldProvince, entity.Province);
     sqlBuilder.SetValue(BaseStaffEntity.FieldCity, entity.City);
     sqlBuilder.SetValue(BaseStaffEntity.FieldDistrict, entity.District);
     sqlBuilder.SetValue(BaseStaffEntity.FieldNativePlace, entity.NativePlace);
     sqlBuilder.SetValue(BaseStaffEntity.FieldCurrentProvince, entity.CurrentProvince);
     sqlBuilder.SetValue(BaseStaffEntity.FieldCurrentCity, entity.CurrentCity);
     sqlBuilder.SetValue(BaseStaffEntity.FieldCurrentDistrict, entity.CurrentDistrict);
     sqlBuilder.SetValue(BaseStaffEntity.FieldParty, entity.Party);
     sqlBuilder.SetValue(BaseStaffEntity.FieldNation, entity.Nation);
     sqlBuilder.SetValue(BaseStaffEntity.FieldNationality, entity.Nationality);
     sqlBuilder.SetValue(BaseStaffEntity.FieldWorkingProperty, entity.WorkingProperty);
     sqlBuilder.SetValue(BaseStaffEntity.FieldCompetency, entity.Competency);
     sqlBuilder.SetValue(BaseStaffEntity.FieldEmergencyContact, entity.EmergencyContact);
     sqlBuilder.SetValue(BaseStaffEntity.FieldWeddingday, entity.Weddingday);
     sqlBuilder.SetValue(BaseStaffEntity.FieldDivorce, entity.Divorce);
     sqlBuilder.SetValue(BaseStaffEntity.FieldChildbirthday1, entity.Childbirthday1);
     sqlBuilder.SetValue(BaseStaffEntity.FieldChildbirthday2, entity.Childbirthday2);
     sqlBuilder.SetValue(BaseStaffEntity.FieldIsDimission, entity.IsDimission);
     sqlBuilder.SetValue(BaseStaffEntity.FieldDimissionDate, entity.DimissionDate);
     sqlBuilder.SetValue(BaseStaffEntity.FieldDimissionCause, entity.DimissionCause);
     sqlBuilder.SetValue(BaseStaffEntity.FieldDimissionWhither, entity.DimissionWhither);
     sqlBuilder.SetValue(BaseStaffEntity.FieldEnabled, entity.Enabled);
     sqlBuilder.SetValue(BaseStaffEntity.FieldDeletionStateCode, entity.DeletionStateCode);
     sqlBuilder.SetValue(BaseStaffEntity.FieldSortCode, entity.SortCode);
     sqlBuilder.SetValue(BaseStaffEntity.FieldDescription, entity.Description);
 }
Beispiel #30
0
 // 这个是声明扩展方法
 partial void SetEntityExtend(SqlBuilder sqlBuilder, BaseStaffEntity entity);