public void Update(DbContext DbContext,App entity) { EntityState state = DbContext.Entry(entity).State; if (state == EntityState.Detached) { DbContext.Entry(entity).State = EntityState.Modified; } }
public void Delete(DbContext DbContext,App entity) { DbContext.Entry(entity).State = EntityState.Deleted; }
public void Insert(DbContext DbContext,App entity) { DbContext.Entry(entity).State = EntityState.Added; }
public static void AppDTE(AppInfo info, App entity) { if (info._IdIsDirty == 1) { entity.Id = info.Id; info._IdIsDirty = 0; } if (info._AppCodeIsDirty == 1) { entity.AppCode = info.AppCode; info._AppCodeIsDirty = 0; } if (info._AppNameIsDirty == 1) { entity.AppName = info.AppName; info._AppNameIsDirty = 0; } if (info._PublicKeyIsDirty == 1) { entity.PublicKey = info.PublicKey; info._PublicKeyIsDirty = 0; } if (info._PrivateKeyIsDirty == 1) { entity.PrivateKey = info.PrivateKey; info._PrivateKeyIsDirty = 0; } if (info._SYS_OrderSeqIsDirty == 1) { entity.SYS_OrderSeq = info.SYS_OrderSeq; info._SYS_OrderSeqIsDirty = 0; } if (info._SYS_IsValidIsDirty == 1) { entity.SYS_IsValid = info.SYS_IsValid; info._SYS_IsValidIsDirty = 0; } if (info._SYS_IsDeletedIsDirty == 1) { entity.SYS_IsDeleted = info.SYS_IsDeleted; info._SYS_IsDeletedIsDirty = 0; } if (info._SYS_RemarkIsDirty == 1) { entity.SYS_Remark = info.SYS_Remark; info._SYS_RemarkIsDirty = 0; } if (info._SYS_StaffIdIsDirty == 1) { entity.SYS_StaffId = info.SYS_StaffId; info._SYS_StaffIdIsDirty = 0; } if (info._SYS_StationIdIsDirty == 1) { entity.SYS_StationId = info.SYS_StationId; info._SYS_StationIdIsDirty = 0; } if (info._SYS_DepartmentIdIsDirty == 1) { entity.SYS_DepartmentId = info.SYS_DepartmentId; info._SYS_DepartmentIdIsDirty = 0; } if (info._SYS_CompanyIdIsDirty == 1) { entity.SYS_CompanyId = info.SYS_CompanyId; info._SYS_CompanyIdIsDirty = 0; } if (info._SYS_AppIdIsDirty == 1) { entity.SYS_AppId = info.SYS_AppId; info._SYS_AppIdIsDirty = 0; } if (info._SYS_CreateTimeIsDirty == 1) { entity.SYS_CreateTime = info.SYS_CreateTime; info._SYS_CreateTimeIsDirty = 0; } if (info._SYS_ModifyTimeIsDirty == 1) { entity.SYS_ModifyTime = info.SYS_ModifyTime; info._SYS_ModifyTimeIsDirty = 0; } if (info._SYS_DeleteTimeIsDirty == 1) { entity.SYS_DeleteTime = info.SYS_DeleteTime; info._SYS_DeleteTimeIsDirty = 0; } }