public static void AddToBuffer(UserTB NewUser, DATAACTION UserAction) { TransectionBuffer NewTransection = new TransectionBuffer(); NewTransection.UserAction = UserAction; NewTransection.UserInformation = NewUser; BufferList.Enqueue(NewTransection); }
public Object DatabaseSync(STATIONNAME StationName, String TableName, DATAACTION Action, List <Object[]> Value) { if (TableName == "UserTB") { return(DatabaseSynchronization.SyncUser(Action, Value, StationName)); } else { return(DatabaseSynchronization.SyncLog(StationName.ToString(), Action, Value)); } }
public static Object SyncLog(String StationName, DATAACTION Action, List <Object[]> TableField) { if (Action == DATAACTION.INSERT || Action == DATAACTION.SYNCALL) { InsertLog(StationName, TableField); } else if (Action == DATAACTION.DELETE) { DeleteLog(TableField.ElementAt(0)[0].ToString()); } else if (Action == DATAACTION.UPDATE) { UpdateLog(StationName, TableField); } return(null); }
public static Object SyncUser(DATAACTION Action, List <Object[]> TableField, STATIONNAME StationName) { if (Action == DATAACTION.SYNCALL) { return(SyncExistingUser(TableField)); } else if (Action == DATAACTION.UPDATE || Action == DATAACTION.INSERT) { UpdateUser(TableField, StationName); } else if (Action == DATAACTION.DELETE) { DeleteUser(TableField); } return(null); }
public static ReturnKnowType UpdateStationUser(String UserID, String UserName, String UserLoginName, String UserLoginPassword, String UserPermissionType, String USerStationPermission, String StationName, DATAACTION UserAction) { STATIONNAME ThisStationName = TTCSHelper.StationStrConveter(StationName); StationHandler ThisSite = KeeperData.FirstOrDefault(Item => Item.StationName == ThisStationName); if (ThisSite != null) { ReturnKnowType ThisResult = ThisSite.UpdateStationUser(UserID, UserName, UserLoginName, UserLoginPassword, UserPermissionType, USerStationPermission, UserAction); if (ThisResult.ReturnType == ReturnStatus.SUCESSFUL) { return(ThisResult); } } return(ReturnKnowType.DefineReturn(ReturnStatus.FAILED, "(#TT004) Can not update user data to station. Will try again.", false)); }