Exemplo n.º 1
0
 public void SetEntity(NonQueryBuilder sqlBuilder, OrganizeEntity entity)
 {
     sqlBuilder.SetValue(FieldID, entity.ID);
     sqlBuilder.SetValue(FieldParentID, entity.ParentID);
     sqlBuilder.SetValue(FieldOrganizeCategoryID, entity.OrganizeCategoryID);
     sqlBuilder.SetValue(FieldCode, entity.Code);
     sqlBuilder.SetValue(FieldFullName, entity.FullName);
     sqlBuilder.SetValue(FieldShortName, entity.ShortName);
     sqlBuilder.SetValue(FieldOuterPhone, entity.OuterPhone);
     sqlBuilder.SetValue(FieldInnerPhone, entity.InnerPhone);
     sqlBuilder.SetValue(FieldFax, entity.Fax);
     sqlBuilder.SetValue(FieldEmail, entity.Email);
     sqlBuilder.SetValue(FieldPostalcode, entity.Postalcode);
     sqlBuilder.SetValue(FieldAddress, entity.Address);
     sqlBuilder.SetValue(FieldWeb, entity.Web);
     sqlBuilder.SetValue(FieldLayer, entity.Layer);
     sqlBuilder.SetValue(FieldSortCode, entity.SortCode);
     sqlBuilder.SetValue(FieldDescription, entity.Description);
     sqlBuilder.SetValue(FieldDeletionStateCode, entity.DeletionStateCode);
     sqlBuilder.SetValue(FieldIsEnable, entity.IsEnable);
     sqlBuilder.SetValue(FieldCreateOn, entity.CreateOn);
     sqlBuilder.SetValue(FieldCreateUserId, entity.CreateUserId);
     sqlBuilder.SetValue(FieldCreateBy, entity.CreateBy);
     sqlBuilder.SetValue(FieldModifiedOn, entity.ModifiedOn);
     sqlBuilder.SetValue(FieldModifiedUserId, entity.ModifiedUserId);
     sqlBuilder.SetValue(FieldModifiedBy, entity.ModifiedBy);
 }
Exemplo n.º 2
0
 public void SetEntity(NonQueryBuilder sqlBuilder, OrderHandlerEntity entity)
 {
     sqlBuilder.SetValue(FieldOrderID, entity.OrderID);
     sqlBuilder.SetValue(FieldHandlerID, entity.HandlerID);
     sqlBuilder.SetValue(FieldWorkload, entity.Workload);
     sqlBuilder.SetValue(FieldIsLeader, entity.IsLeader);
 }
Exemplo n.º 3
0
 public void SetEntity(NonQueryBuilder sqlBuilder, ResourceEntity entity)
 {
     sqlBuilder.SetValue(FieldParentID, entity.ParentID);
     sqlBuilder.SetValue(FieldCode, entity.Code);
     sqlBuilder.SetValue(FieldFullName, entity.FullName);
     sqlBuilder.SetValue(FieldSysCategory, entity.SysCategory);
     sqlBuilder.SetValue(FieldResourceCategory, entity.ResourceCategory);
     sqlBuilder.SetValue(FieldType, entity.Type);
     sqlBuilder.SetValue(FieldGroups, entity.Groups);
     sqlBuilder.SetValue(FieldTarget, entity.Target);
     sqlBuilder.SetValue(FieldNavigateUrl, entity.NavigateUrl);
     sqlBuilder.SetValue(FieldImagUrl, entity.ImagUrl);
     sqlBuilder.SetValue(FieldIsVisible, entity.IsVisible);
     sqlBuilder.SetValue(FieldIsEnable, entity.IsEnable);
     sqlBuilder.SetValue(FieldIsPublic, entity.IsPublic);
     sqlBuilder.SetValue(FieldDescription, entity.Description);
     sqlBuilder.SetValue(FieldSortCode, entity.SortCode);
     sqlBuilder.SetValue(FieldDeletionStateCode, entity.DeletionStateCode);
     sqlBuilder.SetValue(FieldCreateOn, entity.CreateOn);
     sqlBuilder.SetValue(FieldCreateUserId, entity.CreateUserId);
     sqlBuilder.SetValue(FieldCreateBy, entity.CreateBy);
     sqlBuilder.SetValue(FieldModifiedOn, entity.ModifiedOn);
     sqlBuilder.SetValue(FieldModifiedUserId, entity.ModifiedUserId);
     sqlBuilder.SetValue(FieldModifiedBy, entity.ModifiedBy);
 }
Exemplo n.º 4
0
        /// <summary>
        /// 更新实体数据,返回受影响的行数
        /// </summary>
        /// <param name="dbHelper"></param>
        /// <param name="this.CurrentTableName">数据表名</param>
        /// <param name="targetFields">更新的目标字段 数组</param>
        /// <param name="targetValues">更新的目标值 数组</param>
        /// <param name="whereClause">WHERE 从句</param>
        /// <returns></returns>
        public int Update(List <KeyValuePair <string, object> > targetKVPs, WhereStatement whereStatement)
        {
            whereStatement.DbHelper = this.DbHelper;
            NonQueryBuilder sqlBuilder = new NonQueryBuilder(this.DbHelper, DbOperation.Update);

            sqlBuilder.SetFromTable(this.CurrentTableName);

            foreach (KeyValuePair <string, object> kv in targetKVPs)
            {
                sqlBuilder.SetValue(kv.Key, kv.Value);
            }

            if (whereStatement.ClauseLevels > 0)
            {
                sqlBuilder.AddWhere(whereStatement);
            }
            else
            {
                throw new Exception("whereClause contains 0 element");
            }

            DbParameter[] parameters = null;
            string        sql        = sqlBuilder.BuildSQL(out parameters);

            int rows = this.DbHelper.ExecuteNonQuery(sql, parameters);

            return(rows);
        }
Exemplo n.º 5
0
 public void SetEntity(NonQueryBuilder sqlBuilder, OrderFlowEntity entity)
 {
     sqlBuilder.SetValue(FieldOrderID, entity.OrderID);
     sqlBuilder.SetValue(FieldOperatorID, entity.OperatorID);
     sqlBuilder.SetValue(FieldNextOperatorID, entity.NextOperatorID);
     sqlBuilder.SetValue(FieldOperation, entity.Operation);
     sqlBuilder.SetValue(FieldOperateTime, entity.OperateTime);
     sqlBuilder.SetValue(FieldRemark, entity.Remark);
 }
Exemplo n.º 6
0
 public void SetEntity(NonQueryBuilder sqlBuilder, OrderHandleDetailEntity entity)
 {
     sqlBuilder.SetValue(FieldOrderID, entity.OrderID);
     sqlBuilder.SetValue(FieldHandlerID, entity.HandlerID);
     sqlBuilder.SetValue(FieldHandleType, entity.HandleType);
     sqlBuilder.SetValue(FieldHandleDetail, entity.HandleDetail);
     sqlBuilder.SetValue(FieldProgress, entity.Progress);
     sqlBuilder.SetValue(FieldHandleTime, entity.HandleTime);
     sqlBuilder.SetValue(FieldRemark, entity.Remark);
 }
Exemplo n.º 7
0
 public void SetEntity(NonQueryBuilder sqlBuilder, UserEntity entity)
 {
     sqlBuilder.SetValue(this.FieldF1, entity.F1);
     sqlBuilder.SetValue(this.FieldF2, entity.F2);
     sqlBuilder.SetValue(this.FieldF3, entity.F3);
     sqlBuilder.SetValue(this.FieldDateTimeType, entity.DateTimeType);
     sqlBuilder.SetValue(this.FieldNumberType, entity.NumberType);
     sqlBuilder.SetValue(this.FieldDoubleType, entity.DoubleType);
     sqlBuilder.SetValue(this.FieldFloatType, entity.FloatType);
     sqlBuilder.SetValue(this.FieldDecimalType, entity.DecimalType);
     sqlBuilder.SetValue(this.FieldNullType, entity.NullType);
 }
Exemplo n.º 8
0
 public void SetEntity(NonQueryBuilder sqlBuilder, RolePermissionEntity entity)
 {
     sqlBuilder.SetValue(FieldRoleID, entity.RoleID);
     sqlBuilder.SetValue(FieldPermissionID, entity.PermissionID);
     sqlBuilder.SetValue(FieldDeletionStateCode, entity.DeletionStateCode);
     sqlBuilder.SetValue(FieldCreateOn, entity.CreateOn);
     sqlBuilder.SetValue(FieldCreateUserId, entity.CreateUserId);
     sqlBuilder.SetValue(FieldCreateBy, entity.CreateBy);
     sqlBuilder.SetValue(FieldModifiedOn, entity.ModifiedOn);
     sqlBuilder.SetValue(FieldModifiedUserId, entity.ModifiedUserId);
     sqlBuilder.SetValue(FieldModifiedBy, entity.ModifiedBy);
 }
Exemplo n.º 9
0
        /// <summary>
        /// 添加实体
        /// </summary>
        /// <param name="entity">实体类型</param>
        /// <param name="returnId">返回新增的ID</param>
        /// <returns></returns>
        public string Insert(T entity, bool returnId = true)
        {
            DbParameter[] parameters = null;

            NonQueryBuilder sqlBuilder = new NonQueryBuilder(this.DbHelper, DbOperation.Insert);

            sqlBuilder.SetFromTable(this.CurrentTableName);

            this._iEntity.SetEntity(sqlBuilder, entity);
            string sql = sqlBuilder.BuildSQL(out parameters);

            return(DoInsert(parameters, sql, returnId));
        }
Exemplo n.º 10
0
 public void SetEntity(NonQueryBuilder sqlBuilder, PermissionEntity entity)
 {
     sqlBuilder.SetValue(FieldPermissionItemID, entity.PermissionItemID);
     sqlBuilder.SetValue(FieldResourceID, entity.ResourceID);
     sqlBuilder.SetValue(FieldPermissionConstraint, entity.PermissionConstraint);
     sqlBuilder.SetValue(FieldDeletionStateCode, entity.DeletionStateCode);
     sqlBuilder.SetValue(FieldCreateOn, entity.CreateOn);
     sqlBuilder.SetValue(FieldCreateUserId, entity.CreateUserId);
     sqlBuilder.SetValue(FieldCreateBy, entity.CreateBy);
     sqlBuilder.SetValue(FieldModifiedOn, entity.ModifiedOn);
     sqlBuilder.SetValue(FieldModifiedUserId, entity.ModifiedUserId);
     sqlBuilder.SetValue(FieldModifiedBy, entity.ModifiedBy);
 }
Exemplo n.º 11
0
 public void SetEntity(NonQueryBuilder sqlBuilder, RoleEntity entity)
 {
     sqlBuilder.SetValue(FieldParentID, entity.ParentID);
     sqlBuilder.SetValue(FieldOrganizeID, entity.OrganizeID);
     sqlBuilder.SetValue(FieldFullName, entity.FullName);
     sqlBuilder.SetValue(FieldDescription, entity.Description);
     sqlBuilder.SetValue(FieldDeletionStateCode, entity.DeletionStateCode);
     sqlBuilder.SetValue(FieldCreateOn, entity.CreateOn);
     sqlBuilder.SetValue(FieldCreateUserId, entity.CreateUserId);
     sqlBuilder.SetValue(FieldCreateBy, entity.CreateBy);
     sqlBuilder.SetValue(FieldModifiedOn, entity.ModifiedOn);
     sqlBuilder.SetValue(FieldModifiedUserId, entity.ModifiedUserId);
     sqlBuilder.SetValue(FieldModifiedBy, entity.ModifiedBy);
 }
Exemplo n.º 12
0
        public int Delete(WhereStatement whereStatement)
        {
            whereStatement.DbHelper = this.DbHelper;
            NonQueryBuilder sqlBuilder = new NonQueryBuilder(this.DbHelper, DbOperation.Delete);

            sqlBuilder.SetFromTable(this.CurrentTableName);
            sqlBuilder.AddWhere(whereStatement);

            DbParameter[] parameters = null;
            string        sql        = sqlBuilder.BuildSQL(out parameters);

            int rows = this.DbHelper.ExecuteNonQuery(sql, parameters);

            return(rows);
        }
Exemplo n.º 13
0
        /// <summary>
        /// 插入指定键值对的数据
        /// </summary>
        /// <param name="targetKVPs">需要插入的数据</param>
        /// <param name="returnId">返回新增的ID</param>
        /// <returns></returns>
        public string Insert(List <KeyValuePair <string, object> > targetKVPs, bool returnId = false)
        {
            DbParameter[] parameters = null;

            NonQueryBuilder sqlBuilder = new NonQueryBuilder(this.DbHelper, DbOperation.Insert);

            sqlBuilder.SetFromTable(this.CurrentTableName);

            foreach (KeyValuePair <string, object> kvp in targetKVPs)
            {
                sqlBuilder.SetValue(kvp.Key, kvp.Value);
            }
            string sql = sqlBuilder.BuildSQL(out parameters);

            return(DoInsert(parameters, sql, returnId));
        }
Exemplo n.º 14
0
 public void SetEntity(NonQueryBuilder sqlBuilder, UserEntity entity)
 {
     sqlBuilder.SetValue(FieldUserName, entity.UserName);
     sqlBuilder.SetValue(FieldPassword, entity.Password);
     sqlBuilder.SetValue(FieldOpenID, entity.OpenID);
     sqlBuilder.SetValue(FieldIsLogin, entity.IsLogin);
     sqlBuilder.SetValue(FieldIsEnable, entity.IsEnable);
     sqlBuilder.SetValue(FieldDescription, entity.Description);
     sqlBuilder.SetValue(FieldDeletionStateCode, entity.DeletionStateCode);
     sqlBuilder.SetValue(FieldCreateOn, entity.CreateOn);
     sqlBuilder.SetValue(FieldCreateUserId, entity.CreateUserId);
     sqlBuilder.SetValue(FieldCreateBy, entity.CreateBy);
     sqlBuilder.SetValue(FieldModifiedOn, entity.ModifiedOn);
     sqlBuilder.SetValue(FieldModifiedUserId, entity.ModifiedUserId);
     sqlBuilder.SetValue(FieldModifiedBy, entity.ModifiedBy);
 }
Exemplo n.º 15
0
 public void SetEntity(NonQueryBuilder sqlBuilder, StaffEntity entity)
 {
     sqlBuilder.SetValue(FieldUserID, entity.UserID);
     sqlBuilder.SetValue(FieldOrganizeID, entity.OrganizeID);
     sqlBuilder.SetValue(FieldName, entity.Name);
     sqlBuilder.SetValue(FieldTel, entity.Tel);
     sqlBuilder.SetValue(FieldAddr, entity.Addr);
     sqlBuilder.SetValue(FieldIsEnable, entity.IsEnable);
     sqlBuilder.SetValue(FieldIsOnJob, entity.IsOnJob);
     sqlBuilder.SetValue(FieldSex, entity.Sex);
     sqlBuilder.SetValue(FieldDeletionStateCode, entity.DeletionStateCode);
     sqlBuilder.SetValue(FieldCreateOn, entity.CreateOn);
     sqlBuilder.SetValue(FieldCreateUserId, entity.CreateUserId);
     sqlBuilder.SetValue(FieldCreateBy, entity.CreateBy);
     sqlBuilder.SetValue(FieldModifiedOn, entity.ModifiedOn);
     sqlBuilder.SetValue(FieldModifiedUserId, entity.ModifiedUserId);
     sqlBuilder.SetValue(FieldModifiedBy, entity.ModifiedBy);
 }
Exemplo n.º 16
0
        /// <summary>
        /// 更新实体数据,返回受影响的行数
        /// </summary>
        /// <param name="dbHelper"></param>
        /// <param name="this.CurrentTableName">数据表名</param>
        /// <param name="targetFields">更新的目标字段 数组</param>
        /// <param name="targetValues">更新的目标值 数组</param>
        /// <param name="whereClause">WHERE 从句</param>
        /// <returns></returns>
        public int Update(List <KeyValuePair <string, object> > targetKVPs, WhereClause whereClause)
        {
            NonQueryBuilder sqlBuilder = new NonQueryBuilder(this.DbHelper, DbOperation.Update);

            sqlBuilder.SetFromTable(this.CurrentTableName);
            sqlBuilder.AddWhere(whereClause);

            foreach (KeyValuePair <string, object> kv in targetKVPs)
            {
                sqlBuilder.SetValue(kv.Key, kv.Value);
            }

            DbParameter[] parameters = null;
            string        sql        = sqlBuilder.BuildSQL(out parameters);

            int rows = this.DbHelper.ExecuteNonQuery(sql, parameters);

            return(rows);
        }
Exemplo n.º 17
0
 public void SetEntity(NonQueryBuilder sqlBuilder, OrderEntity entity)
 {
     sqlBuilder.SetValue(FieldID, entity.ID);
     sqlBuilder.SetValue(FieldOrderNo, entity.OrderNo);
     sqlBuilder.SetValue(FieldStarterID, entity.StarterID);
     sqlBuilder.SetValue(FieldHandlerID, entity.HandlerID);
     sqlBuilder.SetValue(FieldAppointerID, entity.AppointerID);
     sqlBuilder.SetValue(FieldOperatorID, entity.OperatorID);
     sqlBuilder.SetValue(FieldNextOperatorID, entity.NextOperatorID);
     sqlBuilder.SetValue(FieldAssignDpt, entity.AssignDpt);
     sqlBuilder.SetValue(FieldRemark, entity.Remark);
     sqlBuilder.SetValue(FieldPriority, entity.Priority);
     sqlBuilder.SetValue(FieldStatus, entity.Status);
     sqlBuilder.SetValue(FieldFinishTime, entity.FinishTime);
     sqlBuilder.SetValue(FieldBookingTime, entity.BookingTime);
     sqlBuilder.SetValue(FieldAttn, entity.Attn);
     sqlBuilder.SetValue(FieldAttnTel, entity.AttnTel);
     sqlBuilder.SetValue(FieldContent, entity.Content);
     sqlBuilder.SetValue(FieldStartTime, entity.StartTime);
     sqlBuilder.SetValue(FieldOperateTime, entity.OperateTime);
 }
Exemplo n.º 18
0
 public void SetEntity(NonQueryBuilder sqlBuilder, PermissionItemEntity entity)
 {
     sqlBuilder.SetValue(FieldParentId, entity.ParentId);
     sqlBuilder.SetValue(FieldCode, entity.Code);
     sqlBuilder.SetValue(FieldFullName, entity.FullName);
     sqlBuilder.SetValue(FieldSysCategory, entity.SysCategory);
     sqlBuilder.SetValue(FieldActionName, entity.ActionName);
     sqlBuilder.SetValue(FieldActionParameter, entity.ActionParameter);
     sqlBuilder.SetValue(FieldAllowEdit, entity.AllowEdit);
     sqlBuilder.SetValue(FieldAllowDelete, entity.AllowDelete);
     sqlBuilder.SetValue(FieldIsVisible, entity.IsVisible);
     sqlBuilder.SetValue(FieldIsEnable, entity.IsEnable);
     sqlBuilder.SetValue(FieldIsPublic, entity.IsPublic);
     sqlBuilder.SetValue(FieldDescription, entity.Description);
     sqlBuilder.SetValue(FieldSortCode, entity.SortCode);
     sqlBuilder.SetValue(FieldDeletionStateCode, entity.DeletionStateCode);
     sqlBuilder.SetValue(FieldCreateOn, entity.CreateOn);
     sqlBuilder.SetValue(FieldCreateUserId, entity.CreateUserId);
     sqlBuilder.SetValue(FieldCreateBy, entity.CreateBy);
     sqlBuilder.SetValue(FieldModifiedOn, entity.ModifiedOn);
     sqlBuilder.SetValue(FieldModifiedUserId, entity.ModifiedUserId);
     sqlBuilder.SetValue(FieldModifiedBy, entity.ModifiedBy);
 }
Exemplo n.º 19
0
 public void SetEntity(NonQueryBuilder sqlBuilder, TabSNEntity entity)
 {
     sqlBuilder.SetValue(FieldSn, entity.Sn);
     sqlBuilder.SetValue(FieldSnDt, entity.SnDt);
 }
Exemplo n.º 20
0
 public void SetEntity(NonQueryBuilder sqlBuilder, RoleUserEntity entity)
 {
     sqlBuilder.SetValue(FieldRoleID, entity.RoleID);
     sqlBuilder.SetValue(FieldUserID, entity.UserID);
 }