text
stringlengths
13
6.01M
using UnityEngine; using System.Collections; using System.Collections.Generic; using System.Linq; public class LevelDescription { public const float defaultSpriteSkew = 10; public enum WaveType { // Quasi-random, no two mice out of one hole same time. DISTRIBUTED = 0, // a hole -> stream of mice. SPOUT, // N holes simultaneous mice all same direction. PARADE, NUM_TYPES } public string specialText; public List<ExplicitMouseDesc> explicitMouseDescs; public Sprite sprite; public float spriteSkew; public float spriteScale; public float spriteYOffset; public TipConfig tipConfig; public float tipPause; public List<int> debugWaveTypes; public EnumAccumulator<MouseSinkController.MouseHoleLocation> mouseHolesAccumulator; public EnumAccumulator<BoostConfig.BoostType> boostsAccumulator; public EnumAccumulator<MouseConfig.MouseWiggleType> wigglesAccumulator; public EnumAccumulator<MouseConfig.MouseType> mouseTypesAccumulator; public EnumAccumulator<WaveType> waveTypesAccumulator; public int gameLevel; public GameCenterHelper.AchievementID previousLevelClearedAchievementID; public Accumulator realAngusAccumulator; public LevelDescription () { specialText = ""; explicitMouseDescs = new List<ExplicitMouseDesc> (); debugWaveTypes = new List<int> (); sprite = null; spriteSkew = defaultSpriteSkew; spriteScale = 1f; spriteYOffset = 0; previousLevelClearedAchievementID = GameCenterHelper.AchievementID.NUM_VALUES; mouseHolesAccumulator = new EnumAccumulator<MouseSinkController.MouseHoleLocation> ( (int)MouseSinkController.MouseHoleLocation.NUM_TYPES); boostsAccumulator = new EnumAccumulator<BoostConfig.BoostType> ( (int)BoostConfig.BoostType.NUM_TYPES); wigglesAccumulator = new EnumAccumulator<MouseConfig.MouseWiggleType> ( (int)MouseConfig.MouseWiggleType.NUM_TYPES); mouseTypesAccumulator = new EnumAccumulator<MouseConfig.MouseType> ( (int)MouseConfig.MouseType.NUM_TYPES); waveTypesAccumulator = new EnumAccumulator<WaveType> ( (int)WaveType.NUM_TYPES); realAngusAccumulator = new Accumulator (); } public void PropagateAccumulators(LevelDescription previousLd) { boostsAccumulator.DeriveFrom (previousLd.boostsAccumulator); mouseHolesAccumulator.DeriveFrom (previousLd.mouseHolesAccumulator); wigglesAccumulator.DeriveFrom (previousLd.wigglesAccumulator); mouseTypesAccumulator.DeriveFrom (previousLd.mouseTypesAccumulator); waveTypesAccumulator.DeriveFrom (previousLd.waveTypesAccumulator); realAngusAccumulator.DeriveFrom (previousLd.realAngusAccumulator); } } public class LevelConfig : MonoBehaviour { public float paradePause = 0.1f; public int minParadeMice = 2; public int maxParadeMice = 4; public float paradeEndPause = 4f; public int minDistributedMice = 3; public int maxDistributedMice = 7; public float[] distributedPauseDist; public float distributedEndPause = 2f; public float minSpoutPause = 0.2f; public float maxSpoutPause = 0.5f; public float spoutEndPause = 3f; public int minSpoutMice = 6; public int maxSpoutMice = 10; public int superSpeedMiceLevel = 7; private QuasiRandomGenerator<MouseSinkController.MouseHoleLocation> mouseHoleGenerator; private QuasiRandomGenerator<MouseSinkController.MouseHoleLocation> paradeMouseHoleGenerator; private QuasiRandomGenerator<int> trackGenerator; private QuasiRandomGenerator<float> distributedPauseGenerator; private Dictionary<int, LevelDescription> levelDescMap; private int[] boostLevelLocks; //We make a static variable to our MusicManager instance public static LevelConfig instance { get; private set; } const string newMouseTrapSpritePath = "Textures/Misc/mousetrap.01"; string[] angusIntroSpritePaths = { "Textures/Misc/screen_art_angus.01", "Textures/Misc/screen_art_angus.02", }; float[] angusIntroSpriteYOffsets = { 15, -60, }; Sprite newMouseTrapSprite; Sprite [] angusIntroSprites; void Awake () { instance = this; levelDescMap = new Dictionary<int, LevelDescription> (); } void Start () { LoadSprites (); MakeQuasiRandomGenerators (); GeneratePresetLevels (); GenerateLevelLockInfo (); } void LoadSprites() { newMouseTrapSprite = Resources.Load<UnityEngine.Sprite> (newMouseTrapSpritePath); int count = angusIntroSpritePaths.Length; angusIntroSprites = new Sprite[count]; for (int i = 0; i < count; i++) { angusIntroSprites[i] = Resources.Load<UnityEngine.Sprite> (angusIntroSpritePaths[i]); } } void GenerateLevelLockInfo () { boostLevelLocks = new int[(int)BoostConfig.BoostType.NUM_TYPES]; for (int boostTypeInt = 0; boostTypeInt < (int)BoostConfig.BoostType.NUM_TYPES; boostTypeInt++) { int gameLevel = GetLevelLockInfoForBoost ((BoostConfig.BoostType)boostTypeInt); boostLevelLocks [boostTypeInt] = gameLevel; } } int GetLevelLockInfoForBoost (BoostConfig.BoostType bt) { int gameLevel = 0; int btIndex = (int)bt; while (true) { gameLevel += 1; LevelDescription ld = GetLevelDescription (gameLevel); if (ld.boostsAccumulator.accumulators[btIndex].newCount > 0) { return gameLevel; } } } public int GetLevelLock (BoostConfig.BoostType bType) { int index = (int)bType; return boostLevelLocks [index]; } private void AddExplicitMouseDesc (ref List<ExplicitMouseDesc> retVal, float delayToNextMouse, bool isClockwise, MouseSinkController.MouseHoleLocation location, MouseConfig.MouseType mType, int track, MouseConfig.MouseWiggleType wType = MouseConfig.MouseWiggleType.NONE) { ExplicitMouseDesc emd = new ExplicitMouseDesc (delayToNextMouse, isClockwise, location, mType, track, wType); retVal.Add (emd); } public LevelDescription GetCurrentLevelDescription () { int level = GameLevelState.instance.gameLevel; return GetLevelDescription (level); } public LevelDescription GetLevelDescription (int gameLevel) { LevelDescription ld; if (levelDescMap.ContainsKey (gameLevel)) { return levelDescMap [gameLevel]; } ld = GenerateRandomLevelDescription (gameLevel); levelDescMap.Remove (gameLevel); ld.gameLevel = gameLevel; levelDescMap.Add (gameLevel, ld); return ld; } void GeneratePresetLevels () { levelDescMap.Clear (); LevelDescription ld; int skeletonLevelCount = 50; int [] realAngusLevels = { 1, 2, 4, 7, 10, 13, 17, 21, 25, 29, 33, 37 }; int gameLevel = 0; for (gameLevel = 1; gameLevel <= skeletonLevelCount; gameLevel++) { ld = MakePresetGameLevelSkeleton (gameLevel); ld.gameLevel = gameLevel; levelDescMap.Add (gameLevel, ld); } for (int i = 0; i < realAngusLevels.Length; i++) { int levelIndex = realAngusLevels[i]; if (!levelDescMap.ContainsKey(levelIndex)) { if (Debug.isDebugBuild) { Debug.Log("\n\n\nNot enough levels!!!\n\n\n"); } break; } ld = levelDescMap[levelIndex]; ld.realAngusAccumulator.AddNew (); } FillOutPresetGameLevelSkeletons (); AddPreviousLevelClearedAchievements (); } void AddPreviousLevelClearedAchievements() { LevelDescription ld; /* ld = GetLevelDescription (2); ld.previousLevelClearedAchievementID = "Test01"; ld = GetLevelDescription (3); ld.previousLevelClearedAchievementID = "Test02"; */ ld = GetLevelDescription (6); ld.previousLevelClearedAchievementID = GameCenterHelper.AchievementID.WAVE_05; ld = GetLevelDescription (11); ld.previousLevelClearedAchievementID = GameCenterHelper.AchievementID.WAVE_10; ld = GetLevelDescription (21); ld.previousLevelClearedAchievementID = GameCenterHelper.AchievementID.WAVE_20; ld = GetLevelDescription (41); ld.previousLevelClearedAchievementID = GameCenterHelper.AchievementID.WAVE_40; } void FillOutPresetGameLevelSkeletons () { int gameLevel = 0; while (true) { gameLevel += 1; if (!levelDescMap.ContainsKey (gameLevel)) { return; } LevelDescription ld = levelDescMap [gameLevel]; LevelDescription previousLd = null; if (levelDescMap.ContainsKey (gameLevel - 1)) { previousLd = levelDescMap [gameLevel - 1]; } if (previousLd != null) { ld.PropagateAccumulators(previousLd); } if (ld.explicitMouseDescs.Count == 0) { ld.explicitMouseDescs = GenerateRandomMiceForLevel (ld); GenerateRandomWigglesForLevel (ld); } if (ld.sprite == null) { SetRandomSpriteForLevel(ld); } } } void SetRandomSpriteForLevel(LevelDescription ld) { // Not that random.... int index = ld.gameLevel % angusIntroSprites.Length; ld.sprite = angusIntroSprites [index]; ld.spriteSkew = 0; ld.spriteScale = 2; ld.spriteYOffset = angusIntroSpriteYOffsets [index]; } void SetupInitialAccumulators (LevelDescription ld) { // N capacity per hole. ld.mouseHolesAccumulator.AddDerived ((int)MouseSinkController.MouseHoleLocation.NORTH, TweakableParams.GetInitialTrapsPerHole()); ld.mouseHolesAccumulator.AddDerived ((int)MouseSinkController.MouseHoleLocation.SOUTH, TweakableParams.GetInitialTrapsPerHole()); ld.mouseHolesAccumulator.AddDerived ((int)MouseSinkController.MouseHoleLocation.EAST, TweakableParams.GetInitialTrapsPerHole()); ld.mouseHolesAccumulator.AddDerived ((int)MouseSinkController.MouseHoleLocation.WEST, TweakableParams.GetInitialTrapsPerHole()); // only slow mice. ld.mouseTypesAccumulator.AddDerived ((int)MouseConfig.MouseType.SLOW); // Only non-wiggles. ld.wigglesAccumulator.AddDerived ((int)MouseConfig.MouseWiggleType.NONE); // Basic distribution of wave types. ld.waveTypesAccumulator.AddDerived ((int)LevelDescription.WaveType.DISTRIBUTED, 3); ld.waveTypesAccumulator.AddDerived ((int)LevelDescription.WaveType.PARADE, 1); ld.realAngusAccumulator.AddNew(); ld.realAngusAccumulator.AddDerived(); } LevelDescription MakePresetGameLevelSkeleton (int gameLevel) { LevelDescription ld = new LevelDescription (); ld.explicitMouseDescs = new List<ExplicitMouseDesc> (); // Better than switch b/c it's easier to re-arrange levels. switch (gameLevel) { case 1: // Four slow mice, all same direction, long pauses. ld.specialText = ""; SetupInitialAccumulators (ld); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 3.0f, true, MouseSinkController.MouseHoleLocation.NORTH, MouseConfig.MouseType.SLOW, 2); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 3.5f, true, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.SLOW, 1); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 3.0f, true, MouseSinkController.MouseHoleLocation.NORTH, MouseConfig.MouseType.SLOW, 0); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 3.5f, true, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.SLOW, 2); return ld; case 2: ld.specialText = LazyAngusStrings.inst.Str("INTRO_BOOST_FAST"); ld.sprite = BoostConfig.instance.GetIntroImageForType ( BoostConfig.BoostType.BOOST_TYPE_FAST_PAWS); ld.tipConfig = new TipConfig ("explainBoosts", "TIP_EXPLAIN_BOOSTS"); ld.tipPause = 1.7f; ld.boostsAccumulator.AddNew ((int)BoostConfig.BoostType.BOOST_TYPE_FAST_PAWS); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 4.0f, true, MouseSinkController.MouseHoleLocation.EAST, MouseConfig.MouseType.SLOW, 2); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 3.0f, true, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.SLOW, 1); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.0f, false, MouseSinkController.MouseHoleLocation.WEST, MouseConfig.MouseType.SLOW, 0); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 0.6f, true, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.SLOW, 2); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 0.8f, false, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.SLOW, 2); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.0f, true, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.SLOW, 0); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.0f, false, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.SLOW, 0); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 3.0f, false, MouseSinkController.MouseHoleLocation.NORTH, MouseConfig.MouseType.SLOW, 2); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 4.0f, false, MouseSinkController.MouseHoleLocation.WEST, MouseConfig.MouseType.SLOW, 1); return ld; case 3: ld.specialText = LazyAngusStrings.inst.Str ("LEVEL_START_FAST_MICE_01"); ld.sprite = MouseConfig.instance.GetIntroSpriteForMouseType ( MouseConfig.MouseType.MEDIUM); ld.mouseTypesAccumulator.AddNew ((int)MouseConfig.MouseType.MEDIUM); // Eight mice, two medium. AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.0f, false, MouseSinkController.MouseHoleLocation.WEST, MouseConfig.MouseType.SLOW, 0); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.1f, true, MouseSinkController.MouseHoleLocation.EAST, MouseConfig.MouseType.SLOW, 2); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 3.1f, true, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.MEDIUM, 1); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.5f, true, MouseSinkController.MouseHoleLocation.WEST, MouseConfig.MouseType.SLOW, 2); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 3.0f, false, MouseSinkController.MouseHoleLocation.NORTH, MouseConfig.MouseType.SLOW, 0); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 4.0f, true, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.MEDIUM, 2); return ld; case 4: ld.specialText = LazyAngusStrings.inst.Str ("LEVEL_START_NEW_MOUSETRAP_01"); ld.sprite = newMouseTrapSprite; ld.mouseHolesAccumulator.AddNew ((int)MouseSinkController.MouseHoleLocation.NORTH); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.0f, false, MouseSinkController.MouseHoleLocation.WEST, MouseConfig.MouseType.SLOW, 1); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 0.1f, true, MouseSinkController.MouseHoleLocation.NORTH, MouseConfig.MouseType.SLOW, 1); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 0.1f, true, MouseSinkController.MouseHoleLocation.WEST, MouseConfig.MouseType.SLOW, 2); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.0f, false, MouseSinkController.MouseHoleLocation.WEST, MouseConfig.MouseType.MEDIUM, 1); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.0f, true, MouseSinkController.MouseHoleLocation.WEST, MouseConfig.MouseType.MEDIUM, 2); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.3f, false, MouseSinkController.MouseHoleLocation.EAST, MouseConfig.MouseType.SLOW, 0); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.5f, false, MouseSinkController.MouseHoleLocation.WEST, MouseConfig.MouseType.SLOW, 1); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 4.0f, true, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.SLOW, 1); return ld; case 5: ld.specialText = LazyAngusStrings.inst.Str ("LEVEL_START_NEW_MOUSETRAP_02"); ld.sprite = newMouseTrapSprite; ld.mouseHolesAccumulator.AddNew ((int)MouseSinkController.MouseHoleLocation.SOUTH); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.0f, false, MouseSinkController.MouseHoleLocation.NORTH, MouseConfig.MouseType.MEDIUM, 0); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.0f, false, MouseSinkController.MouseHoleLocation.EAST, MouseConfig.MouseType.SLOW, 1); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 3.0f, true, MouseSinkController.MouseHoleLocation.WEST, MouseConfig.MouseType.MEDIUM, 2); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.0f, true, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.SLOW, 0); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.0f, false, MouseSinkController.MouseHoleLocation.WEST, MouseConfig.MouseType.MEDIUM, 1); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 0.1f, false, MouseSinkController.MouseHoleLocation.EAST, MouseConfig.MouseType.SLOW, 2); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.5f, true, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.MEDIUM, 0); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 4.0f, true, MouseSinkController.MouseHoleLocation.NORTH, MouseConfig.MouseType.SLOW, 1); return ld; case 6: ld.specialText = LazyAngusStrings.inst.Str("INTRO_BOOST_SEE"); ld.sprite = BoostConfig.instance.GetIntroImageForType ( BoostConfig.BoostType.BOOST_TYPE_GOOD_EYES); ld.boostsAccumulator.AddNew ((int)BoostConfig.BoostType.BOOST_TYPE_GOOD_EYES); // Eight mice, two medium. AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.0f, false, MouseSinkController.MouseHoleLocation.EAST, MouseConfig.MouseType.SLOW, 1); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.0f, true, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.MEDIUM, 1); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.0f, true, MouseSinkController.MouseHoleLocation.NORTH, MouseConfig.MouseType.SLOW, 2); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 0.1f, false, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.MEDIUM, 0); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 3.0f, false, MouseSinkController.MouseHoleLocation.NORTH, MouseConfig.MouseType.SLOW, 1); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 3.0f, true, MouseSinkController.MouseHoleLocation.EAST, MouseConfig.MouseType.SLOW, 2); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 0.1f, false, MouseSinkController.MouseHoleLocation.WEST, MouseConfig.MouseType.SLOW, 0); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 4.0f, true, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.SLOW, 1); return ld; case 7: ld.specialText = LazyAngusStrings.inst.Str ("LEVEL_START_FAST_MICE_02"); ld.sprite = MouseConfig.instance.GetIntroSpriteForMouseType ( MouseConfig.MouseType.FAST); ld.mouseTypesAccumulator.AddNew ((int)MouseConfig.MouseType.MEDIUM); ld.mouseTypesAccumulator.AddNew ((int)MouseConfig.MouseType.FAST); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 3.0f, false, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.SLOW, 2); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.0f, true, MouseSinkController.MouseHoleLocation.NORTH, MouseConfig.MouseType.SLOW, 1); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.0f, false, MouseSinkController.MouseHoleLocation.NORTH, MouseConfig.MouseType.FAST, 0); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.0f, false, MouseSinkController.MouseHoleLocation.EAST, MouseConfig.MouseType.SLOW, 1); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 3.0f, false, MouseSinkController.MouseHoleLocation.NORTH, MouseConfig.MouseType.MEDIUM, 2); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.0f, true, MouseSinkController.MouseHoleLocation.EAST, MouseConfig.MouseType.SLOW, 1); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.0f, false, MouseSinkController.MouseHoleLocation.WEST, MouseConfig.MouseType.SLOW, 0); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 4.0f, true, MouseSinkController.MouseHoleLocation.NORTH, MouseConfig.MouseType.MEDIUM, 2); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.0f, false, MouseSinkController.MouseHoleLocation.WEST, MouseConfig.MouseType.FAST, 1); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 4.0f, true, MouseSinkController.MouseHoleLocation.NORTH, MouseConfig.MouseType.SLOW, 1); return ld; case 8: ld.specialText = LazyAngusStrings.inst.Str ("LEVEL_START_NEW_MOUSETRAP_03"); ld.sprite = newMouseTrapSprite; ld.mouseHolesAccumulator.AddNew ((int)MouseSinkController.MouseHoleLocation.EAST); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 3.0f, false, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.SLOW, 2); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.0f, true, MouseSinkController.MouseHoleLocation.EAST, MouseConfig.MouseType.MEDIUM, 1); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 4.0f, true, MouseSinkController.MouseHoleLocation.NORTH, MouseConfig.MouseType.FAST, 0); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.0f, true, MouseSinkController.MouseHoleLocation.NORTH, MouseConfig.MouseType.SLOW, 2); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.0f, false, MouseSinkController.MouseHoleLocation.EAST, MouseConfig.MouseType.MEDIUM, 1); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.0f, false, MouseSinkController.MouseHoleLocation.WEST, MouseConfig.MouseType.MEDIUM, 0); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.0f, true, MouseSinkController.MouseHoleLocation.NORTH, MouseConfig.MouseType.SLOW, 2); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 3.0f, false, MouseSinkController.MouseHoleLocation.NORTH, MouseConfig.MouseType.MEDIUM, 1); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.0f, false, MouseSinkController.MouseHoleLocation.WEST, MouseConfig.MouseType.FAST, 0); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 4.0f, false, MouseSinkController.MouseHoleLocation.NORTH, MouseConfig.MouseType.FAST, 2); return ld; case 9: ld.specialText = LazyAngusStrings.inst.Str ("LEVEL_START_NEW_MOVEMENT_01"); ld.sprite = MouseConfig.instance.GetIntroSpriteForMouseWiggle ( MouseConfig.MouseWiggleType.BACK_FORTH); ld.wigglesAccumulator.AddNew ((int)MouseConfig.MouseWiggleType.BACK_FORTH); // Eight mice, two medium. AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.0f, false, MouseSinkController.MouseHoleLocation.NORTH, MouseConfig.MouseType.MEDIUM, 2, MouseConfig.MouseWiggleType.BACK_FORTH); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.5f, true, MouseSinkController.MouseHoleLocation.EAST, MouseConfig.MouseType.MEDIUM, 1); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.0f, true, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.SLOW, 0, MouseConfig.MouseWiggleType.BACK_FORTH); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 3.0f, false, MouseSinkController.MouseHoleLocation.NORTH, MouseConfig.MouseType.SLOW, 1); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 0.1f, false, MouseSinkController.MouseHoleLocation.NORTH, MouseConfig.MouseType.SLOW, 2); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 0.5f, true, MouseSinkController.MouseHoleLocation.EAST, MouseConfig.MouseType.MEDIUM, 0); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.0f, false, MouseSinkController.MouseHoleLocation.WEST, MouseConfig.MouseType.FAST, 1, MouseConfig.MouseWiggleType.BACK_FORTH); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.0f, true, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.FAST, 2); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.0f, false, MouseSinkController.MouseHoleLocation.NORTH, MouseConfig.MouseType.SLOW, 2); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 0.1f, true, MouseSinkController.MouseHoleLocation.EAST, MouseConfig.MouseType.MEDIUM, 0, MouseConfig.MouseWiggleType.BACK_FORTH); return ld; case 10: ld.specialText = LazyAngusStrings.inst.Str("INTRO_BOOST_GIANT"); ld.sprite = BoostConfig.instance.GetIntroImageForType ( BoostConfig.BoostType.BOOST_TYPE_BIG_PAWS); ld.boostsAccumulator.AddNew ((int)BoostConfig.BoostType.BOOST_TYPE_BIG_PAWS); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 0.1f, true, MouseSinkController.MouseHoleLocation.EAST, MouseConfig.MouseType.SLOW, 2, MouseConfig.MouseWiggleType.BACK_FORTH); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.0f, false, MouseSinkController.MouseHoleLocation.WEST, MouseConfig.MouseType.MEDIUM, 2); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 0.5f, true, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.MEDIUM, 0, MouseConfig.MouseWiggleType.BACK_FORTH); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.5f, false, MouseSinkController.MouseHoleLocation.EAST, MouseConfig.MouseType.MEDIUM, 1); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.8f, true, MouseSinkController.MouseHoleLocation.NORTH, MouseConfig.MouseType.SLOW, 2, MouseConfig.MouseWiggleType.BACK_FORTH); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.3f, false, MouseSinkController.MouseHoleLocation.WEST, MouseConfig.MouseType.MEDIUM, 1); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 0.4f, true, MouseSinkController.MouseHoleLocation.EAST, MouseConfig.MouseType.MEDIUM, 0, MouseConfig.MouseWiggleType.BACK_FORTH); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 0.3f, true, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.FAST, 2); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 0.3f, false, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.FAST, 1); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 0.3f, true, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.FAST, 0); return ld; case 11: ld.specialText = LazyAngusStrings.inst.Str ("LEVEL_START_NEW_MOUSETRAP_04"); ld.sprite = newMouseTrapSprite; ld.mouseHolesAccumulator.AddNew ((int)MouseSinkController.MouseHoleLocation.WEST); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 0.4f, true, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.SLOW, 2, MouseConfig.MouseWiggleType.BACK_FORTH); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 0.6f, false, MouseSinkController.MouseHoleLocation.EAST, MouseConfig.MouseType.FAST, 1, MouseConfig.MouseWiggleType.BACK_FORTH); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.0f, true, MouseSinkController.MouseHoleLocation.NORTH, MouseConfig.MouseType.MEDIUM, 2, MouseConfig.MouseWiggleType.BACK_FORTH); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.2f, false, MouseSinkController.MouseHoleLocation.WEST, MouseConfig.MouseType.FAST, 2); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.4f, true, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.MEDIUM, 2); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.6f, false, MouseSinkController.MouseHoleLocation.EAST, MouseConfig.MouseType.SLOW, 1); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 3.6f, true, MouseSinkController.MouseHoleLocation.NORTH, MouseConfig.MouseType.MEDIUM, 3, MouseConfig.MouseWiggleType.BACK_FORTH); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 4.0f, false, MouseSinkController.MouseHoleLocation.EAST, MouseConfig.MouseType.MEDIUM, 1); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 4.8f, true, MouseSinkController.MouseHoleLocation.EAST, MouseConfig.MouseType.MEDIUM, 1); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 5.4f, false, MouseSinkController.MouseHoleLocation.EAST, MouseConfig.MouseType.MEDIUM, 1); return ld; case 12: ld.specialText = LazyAngusStrings.inst.Str ("LEVEL_START_FAST_MICE_03"); ld.sprite = MouseConfig.instance.GetIntroSpriteForMouseType ( MouseConfig.MouseType.SUPERFAST); ld.mouseTypesAccumulator.AddNew ((int)MouseConfig.MouseType.MEDIUM); ld.mouseTypesAccumulator.AddNew ((int)MouseConfig.MouseType.FAST); ld.mouseTypesAccumulator.AddNew ((int)MouseConfig.MouseType.SUPERFAST); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.0f, true, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.MEDIUM, 1); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.0f, false, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.SLOW, 2, MouseConfig.MouseWiggleType.BACK_FORTH); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 3.0f, true, MouseSinkController.MouseHoleLocation.WEST, MouseConfig.MouseType.SUPERFAST, 2); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.0f, false, MouseSinkController.MouseHoleLocation.NORTH, MouseConfig.MouseType.FAST, 0); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.0f, true, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.MEDIUM, 1); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.0f, true, MouseSinkController.MouseHoleLocation.WEST, MouseConfig.MouseType.SLOW, 2, MouseConfig.MouseWiggleType.BACK_FORTH); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.0f, true, MouseSinkController.MouseHoleLocation.NORTH, MouseConfig.MouseType.SUPERFAST, 1); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.0f, false, MouseSinkController.MouseHoleLocation.EAST, MouseConfig.MouseType.MEDIUM, 0, MouseConfig.MouseWiggleType.BACK_FORTH); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.0f, true, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.SLOW, 1); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.0f, false, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.MEDIUM, 0); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.0f, false, MouseSinkController.MouseHoleLocation.WEST, MouseConfig.MouseType.SUPERFAST, 0, MouseConfig.MouseWiggleType.BACK_FORTH); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.0f, true, MouseSinkController.MouseHoleLocation.NORTH, MouseConfig.MouseType.SLOW, 2, MouseConfig.MouseWiggleType.BACK_FORTH); return ld; case 13: ld.specialText = LazyAngusStrings.inst.Str("INTRO_BOOST_FART"); ld.sprite = BoostConfig.instance.GetIntroImageForType ( BoostConfig.BoostType.BOOST_TYPE_FART); ld.boostsAccumulator.AddNew ((int)BoostConfig.BoostType.BOOST_TYPE_FART); return ld; case 14: ld.specialText = LazyAngusStrings.inst.Str ("LEVEL_START_NEW_MOUSETRAP_05"); ld.sprite = newMouseTrapSprite; ld.mouseHolesAccumulator.AddNew ((int)MouseSinkController.MouseHoleLocation.WEST); ld.waveTypesAccumulator.AddNew ((int)LevelDescription.WaveType.DISTRIBUTED, 1); ld.waveTypesAccumulator.AddNew ((int)LevelDescription.WaveType.PARADE, 1); return ld; case 15: ld.specialText = LazyAngusStrings.inst.Str ("LEVEL_START_NEW_MOVEMENT_02"); ld.sprite = MouseConfig.instance.GetIntroSpriteForMouseWiggle ( MouseConfig.MouseWiggleType.SIDE_SIDE); ld.wigglesAccumulator.AddNew ((int)MouseConfig.MouseWiggleType.SIDE_SIDE); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.0f, false, MouseSinkController.MouseHoleLocation.WEST, MouseConfig.MouseType.SLOW, 1, MouseConfig.MouseWiggleType.SIDE_SIDE); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.0f, false, MouseSinkController.MouseHoleLocation.EAST, MouseConfig.MouseType.MEDIUM, 2, MouseConfig.MouseWiggleType.SIDE_SIDE); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.0f, true, MouseSinkController.MouseHoleLocation.WEST, MouseConfig.MouseType.SLOW, 2, MouseConfig.MouseWiggleType.SIDE_SIDE); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 3.0f, false, MouseSinkController.MouseHoleLocation.NORTH, MouseConfig.MouseType.FAST, 0); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.0f, true, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.FAST, 1, MouseConfig.MouseWiggleType.SIDE_SIDE); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.0f, true, MouseSinkController.MouseHoleLocation.WEST, MouseConfig.MouseType.FAST, 2, MouseConfig.MouseWiggleType.SIDE_SIDE); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 0.1f, true, MouseSinkController.MouseHoleLocation.NORTH, MouseConfig.MouseType.SLOW, 1); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 0.1f, false, MouseSinkController.MouseHoleLocation.EAST, MouseConfig.MouseType.MEDIUM, 0, MouseConfig.MouseWiggleType.SIDE_SIDE); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.0f, true, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.SLOW, 1); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.0f, true, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.SUPERFAST, 0, MouseConfig.MouseWiggleType.SIDE_SIDE); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.0f, false, MouseSinkController.MouseHoleLocation.WEST, MouseConfig.MouseType.SLOW, 0, MouseConfig.MouseWiggleType.SIDE_SIDE); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 0.1f, true, MouseSinkController.MouseHoleLocation.EAST, MouseConfig.MouseType.MEDIUM, 2, MouseConfig.MouseWiggleType.SIDE_SIDE); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.0f, true, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.SLOW, 1); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.0f, false, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.SLOW, 0); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.0f, false, MouseSinkController.MouseHoleLocation.WEST, MouseConfig.MouseType.SLOW, 0, MouseConfig.MouseWiggleType.SIDE_SIDE); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.0f, true, MouseSinkController.MouseHoleLocation.NORTH, MouseConfig.MouseType.SLOW, 2, MouseConfig.MouseWiggleType.SIDE_SIDE); return ld; case 16: ld.specialText = LazyAngusStrings.inst.Str ("LEVEL_START_TROUBLE"); ld.sprite = MouseConfig.instance.GetIntroSpriteForMouseType ( MouseConfig.MouseType.SUPERFAST); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.2f, true, MouseSinkController.MouseHoleLocation.NORTH, MouseConfig.MouseType.SUPERFAST, 1); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.4f, true, MouseSinkController.MouseHoleLocation.EAST, MouseConfig.MouseType.SUPERFAST, 2); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.0f, false, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.SUPERFAST, 0); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.1f, true, MouseSinkController.MouseHoleLocation.WEST, MouseConfig.MouseType.SLOW, 1); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.5f, true, MouseSinkController.MouseHoleLocation.NORTH, MouseConfig.MouseType.SUPERFAST, 2); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.2f, false, MouseSinkController.MouseHoleLocation.WEST, MouseConfig.MouseType.SUPERFAST, 0); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.3f, false, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.SUPERFAST, 1); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.0f, true, MouseSinkController.MouseHoleLocation.EAST, MouseConfig.MouseType.SLOW, 2); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 0.1f, false, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.SUPERFAST, 0); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.1f, true, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.SUPERFAST, 1); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 0.1f, false, MouseSinkController.MouseHoleLocation.WEST, MouseConfig.MouseType.SUPERFAST, 2); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.5f, true, MouseSinkController.MouseHoleLocation.NORTH, MouseConfig.MouseType.SUPERFAST, 0); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.2f, true, MouseSinkController.MouseHoleLocation.EAST, MouseConfig.MouseType.SLOW, 1); return ld; case 17: ld.specialText = LazyAngusStrings.inst.Str ("LEVEL_START_NEW_MOUSETRAP_01"); ld.sprite = newMouseTrapSprite; ld.mouseHolesAccumulator.AddNew ((int)MouseSinkController.MouseHoleLocation.EAST); ld.waveTypesAccumulator.AddNew ((int)LevelDescription.WaveType.DISTRIBUTED); ld.waveTypesAccumulator.AddNew ((int)LevelDescription.WaveType.SPOUT); return ld; case 19: ld.specialText = LazyAngusStrings.inst.Str ("LEVEL_START_NEW_MOVEMENT_03"); ld.sprite = MouseConfig.instance.GetIntroSpriteForMouseWiggle ( MouseConfig.MouseWiggleType.ROUND); ld.wigglesAccumulator.AddNew ((int)MouseConfig.MouseWiggleType.ROUND); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.3f, true, MouseSinkController.MouseHoleLocation.NORTH, MouseConfig.MouseType.MEDIUM, 1, MouseConfig.MouseWiggleType.ROUND); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 0.1f, false, MouseSinkController.MouseHoleLocation.WEST, MouseConfig.MouseType.SLOW, 2, MouseConfig.MouseWiggleType.ROUND); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 2.0f, true, MouseSinkController.MouseHoleLocation.EAST, MouseConfig.MouseType.MEDIUM, 2, MouseConfig.MouseWiggleType.ROUND); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 0.1f, false, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.SUPERFAST, 0, MouseConfig.MouseWiggleType.ROUND); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.1f, false, MouseSinkController.MouseHoleLocation.WEST, MouseConfig.MouseType.SLOW, 1); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.4f, true, MouseSinkController.MouseHoleLocation.EAST, MouseConfig.MouseType.SLOW, 2, MouseConfig.MouseWiggleType.ROUND); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.0f, true, MouseSinkController.MouseHoleLocation.SOUTH, MouseConfig.MouseType.SLOW, 0, MouseConfig.MouseWiggleType.ROUND); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.1f, true, MouseSinkController.MouseHoleLocation.WEST, MouseConfig.MouseType.MEDIUM, 1); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.2f, true, MouseSinkController.MouseHoleLocation.NORTH, MouseConfig.MouseType.SUPERFAST, 1, MouseConfig.MouseWiggleType.ROUND); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.5f, false, MouseSinkController.MouseHoleLocation.NORTH, MouseConfig.MouseType.FAST, 2, MouseConfig.MouseWiggleType.ROUND); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.2f, false, MouseSinkController.MouseHoleLocation.WEST, MouseConfig.MouseType.MEDIUM, 0); AddExplicitMouseDesc (ref ld.explicitMouseDescs, 1.5f, true, MouseSinkController.MouseHoleLocation.NORTH, MouseConfig.MouseType.FAST, 0, MouseConfig.MouseWiggleType.ROUND); return ld; case 20: ld.specialText = LazyAngusStrings.inst.Str ("LEVEL_START_NEW_MOUSETRAP_02"); ld.sprite = newMouseTrapSprite; ld.mouseHolesAccumulator.AddNew ((int)MouseSinkController.MouseHoleLocation.SOUTH); return ld; case 21: ld.waveTypesAccumulator.AddNew ((int)LevelDescription.WaveType.SPOUT); ld.waveTypesAccumulator.AddNew ((int)LevelDescription.WaveType.DISTRIBUTED); ld.waveTypesAccumulator.AddNew ((int)LevelDescription.WaveType.PARADE); return ld; case 23: ld.specialText = LazyAngusStrings.inst.Str ("LEVEL_START_NEW_MOUSETRAP_03"); ld.sprite = newMouseTrapSprite; ld.mouseHolesAccumulator.AddNew ((int)MouseSinkController.MouseHoleLocation.NORTH); return ld; case 26: ld.specialText = LazyAngusStrings.inst.Str ("LEVEL_START_NEW_MOUSETRAP_04"); ld.sprite = newMouseTrapSprite; ld.mouseHolesAccumulator.AddNew ((int)MouseSinkController.MouseHoleLocation.NORTH); return ld; case 27: ld.waveTypesAccumulator.AddNew ((int)LevelDescription.WaveType.SPOUT); ld.waveTypesAccumulator.AddNew ((int)LevelDescription.WaveType.DISTRIBUTED); ld.waveTypesAccumulator.AddNew ((int)LevelDescription.WaveType.PARADE); return ld; case 29: ld.specialText = LazyAngusStrings.inst.Str ("LEVEL_START_NEW_MOUSETRAP_06"); ld.sprite = newMouseTrapSprite; ld.mouseHolesAccumulator.AddNew ((int)MouseSinkController.MouseHoleLocation.WEST); return ld; case 32: ld.specialText = LazyAngusStrings.inst.Str ("LEVEL_START_NEW_MOUSETRAP_07"); ld.sprite = newMouseTrapSprite; ld.mouseHolesAccumulator.AddNew ((int)MouseSinkController.MouseHoleLocation.SOUTH); return ld; case 35: ld.specialText = LazyAngusStrings.inst.Str ("LEVEL_START_NEW_MOUSETRAP_08"); ld.sprite = newMouseTrapSprite; ld.mouseHolesAccumulator.AddNew ((int)MouseSinkController.MouseHoleLocation.EAST); return ld; default: return ld; } } LevelDescription GenerateRandomLevelDescription (int gameLevel) { if (levelDescMap.Count == 0) { throw new System.Exception("Calling GenerateRandomLevel before any levels initialized."); } LevelDescription previousLd = null; if (gameLevel > 0) { previousLd = GetLevelDescription (gameLevel - 1); } else { throw new System.Exception("Called GenerateRandomLevel with zero or negative gameLevel"); } LevelDescription ld = new LevelDescription (); ld.gameLevel = gameLevel; if (previousLd != null) { ld.PropagateAccumulators(previousLd); } ld.explicitMouseDescs = GenerateRandomMiceForLevel (ld); SetRandomSpriteForLevel(ld); GenerateRandomWigglesForLevel (ld); return ld; } void GenerateRandomWigglesForLevel (LevelDescription ld) { Random.seed = ld.gameLevel; List<int> wiggleDistribution = ld.wigglesAccumulator.GetDistribution (); QuasiRandomGenerator<int> wiggleTypeGenerator = new QuasiRandomGenerator<int> (wiggleDistribution); for (int i = 0; i < ld.explicitMouseDescs.Count; i++) { ExplicitMouseDesc emd = ld.explicitMouseDescs [i]; MouseConfig.MouseWiggleType wt = (MouseConfig.MouseWiggleType)wiggleTypeGenerator.GetNextValue (); emd.AddWiggle (wt); } } List<ExplicitMouseDesc> GenerateRandomMiceForLevel (LevelDescription ld) { List<ExplicitMouseDesc> retVal = new List<ExplicitMouseDesc> (); Random.seed = ld.gameLevel; List<int> waveDistribution = ld.waveTypesAccumulator.GetDistribution (); QuasiRandomGenerator<int> waveTypeGenerator = new QuasiRandomGenerator<int> (waveDistribution); List<int> mouseDistribution = ld.mouseTypesAccumulator.GetDistribution (); QuasiRandomGenerator<int> mouseTypeGenerator = new QuasiRandomGenerator<int> (mouseDistribution); // One wave per two levels. for (int i = 0; i < ld.gameLevel/2; i++) { LevelDescription.WaveType waveType = (LevelDescription.WaveType)waveTypeGenerator.GetNextValue (); retVal.AddRange (this.GenerateWaveForLevel (waveType, mouseTypeGenerator, ld)); ld.debugWaveTypes.Add((int)waveType); } return retVal; } List<ExplicitMouseDesc> GenerateWaveForLevel (LevelDescription.WaveType wt, QuasiRandomGenerator<int> mouseTypeGenerator, LevelDescription ld) { switch (wt) { case LevelDescription.WaveType.DISTRIBUTED: return GenerateDistributedWave (mouseTypeGenerator); case LevelDescription.WaveType.PARADE: return GenerateParadeWave (mouseTypeGenerator); default: return GenerateSpoutWave (mouseTypeGenerator); } } List<ExplicitMouseDesc> GenerateDistributedWave ( QuasiRandomGenerator<int> mouseTypeGenerator) { List<ExplicitMouseDesc> retVal = new List<ExplicitMouseDesc> (); int count = Random.Range (minDistributedMice, maxDistributedMice + 1); for (int i = 0; i < count; i++) { float pause = distributedPauseGenerator.GetNextValue (); bool isClockwise = (Random.Range (0, 2) == 0); MouseSinkController.MouseHoleLocation location = mouseHoleGenerator.GetNextValue (); MouseConfig.MouseType mType = (MouseConfig.MouseType)mouseTypeGenerator.GetNextValue (); int track = trackGenerator.GetNextValue (); if (i == count - 1) { pause = distributedEndPause; } AddExplicitMouseDesc (ref retVal, pause, isClockwise, location, mType, track); } return retVal; } List<ExplicitMouseDesc> GenerateParadeWave ( QuasiRandomGenerator<int> mouseTypeGenerator) { List<ExplicitMouseDesc> retVal = new List<ExplicitMouseDesc> (); bool isClockwise = (Random.Range (0, 2) == 0); paradeMouseHoleGenerator.RefreshValues (); int count = Random.Range (minParadeMice, maxParadeMice + 1); for (int i = 0; i < count; i++) { float pause = paradePause; MouseConfig.MouseType mType = (MouseConfig.MouseType)mouseTypeGenerator.GetNextValue (); int track = trackGenerator.GetNextValue (); MouseSinkController.MouseHoleLocation location = paradeMouseHoleGenerator.GetNextValue (); if (retVal.Count == count - 1) { pause = paradeEndPause; } AddExplicitMouseDesc (ref retVal, pause, isClockwise, location, mType, track); } return retVal; } List<ExplicitMouseDesc> GenerateSpoutWave ( QuasiRandomGenerator<int> mouseTypeGenerator) { List<ExplicitMouseDesc> retVal = new List<ExplicitMouseDesc> (); int count = Random.Range (minSpoutMice, maxSpoutMice + 1); MouseSinkController.MouseHoleLocation location = mouseHoleGenerator.GetNextValue (); bool isClockwise = (Random.Range (0, 2) == 0); for (int i = 0; i < count; i++) { float pause = Random.Range (minSpoutPause, maxSpoutPause); MouseConfig.MouseType mType = (MouseConfig.MouseType)mouseTypeGenerator.GetNextValue (); int track = trackGenerator.GetNextValue (); if (i == count - 1) { pause = spoutEndPause; } AddExplicitMouseDesc (ref retVal, pause, isClockwise, location, mType, track); isClockwise = !isClockwise; } return retVal; } void MakeQuasiRandomGenerators () { List<MouseSinkController.MouseHoleLocation> holeDist = new List<MouseSinkController.MouseHoleLocation> (); holeDist.Add (MouseSinkController.MouseHoleLocation.NORTH); holeDist.Add (MouseSinkController.MouseHoleLocation.EAST); holeDist.Add (MouseSinkController.MouseHoleLocation.SOUTH); holeDist.Add (MouseSinkController.MouseHoleLocation.WEST); paradeMouseHoleGenerator = new QuasiRandomGenerator<MouseSinkController.MouseHoleLocation> (holeDist); paradeMouseHoleGenerator.refreshTrigger = 0; holeDist.Add (MouseSinkController.MouseHoleLocation.NORTH); holeDist.Add (MouseSinkController.MouseHoleLocation.EAST); holeDist.Add (MouseSinkController.MouseHoleLocation.SOUTH); holeDist.Add (MouseSinkController.MouseHoleLocation.WEST); mouseHoleGenerator = new QuasiRandomGenerator<MouseSinkController.MouseHoleLocation> (holeDist); mouseHoleGenerator.refreshTrigger = 1; List<int> trackDist = new List<int> (); for (int i = 0; i < TweakableParams.numTracks; i++) { trackDist.Add (i); } trackGenerator = new QuasiRandomGenerator<int> (trackDist); distributedPauseGenerator = new QuasiRandomGenerator<float> (distributedPauseDist); } public int LevelForRealAngusUnlocks(int numUnlocks) { LevelDescription ld; int gameLevel = 0; while (true) { gameLevel++; if (!levelDescMap.ContainsKey(gameLevel)) { return gameLevel; } ld = levelDescMap[gameLevel]; if (ld.realAngusAccumulator.derivedCount == numUnlocks) { return gameLevel; } } } }
using System; using System.Collections.Generic; using System.Data; using System.Data.Common; using System.Text; using System.Threading.Tasks; namespace DbConnector.Core { public interface IDbConnector<TDbConnection> where TDbConnection : DbConnection { DbConnectorJob<List<T>, TDbConnection> Read<T>( Action<IDbConnectorSettings> onInit, Func<List<T>, List<T>> onLoad = null, Func<Exception, IDbResult<List<T>>, IDbResult<List<T>>> onError = null) where T : new(); DbConnectorJob<T, TDbConnection> ReadSingle<T>( Action<IDbConnectorSettings> onInit, Func<T, T> onLoad = null, Func<Exception, IDbResult<T>, IDbResult<T>> onError = null); DbConnectorJob<DataTable, TDbConnection> ReadToDataTable( Action<IDbConnectorSettings> onInit, Func<DataTable, DataTable> onLoad = null, Func<Exception, IDbResult<DataTable>, IDbResult<DataTable>> onError = null); DbConnectorJob<List<Dictionary<string, object>>, TDbConnection> ReadToDictionary( Action<IDbConnectorSettings> onInit, Func<List<Dictionary<string, object>>, List<Dictionary<string, object>>> onLoad = null, Func<Exception, IDbResult<List<Dictionary<string, object>>>, IDbResult<List<Dictionary<string, object>>>> onError = null, List<string> columnNamesToInclude = null, List<string> columnNamesToExclude = null); DbConnectorJob<T, TDbConnection> Read<T>( Action<IDbConnectorSettings> onInit, Func<DbDataReader, T> onLoad, CommandBehavior commandBehavior = CommandBehavior.Default, Func<Exception, IDbResult<T>, IDbResult<T>> onError = null); DbConnectorJob<bool, TDbConnection> NonQuery( Action<IDbConnectorSettings> onInit, Func<int, DbParameterCollection, bool, bool> onExecute = null, Func<Exception, IDbResult<bool>, IDbResult<bool>> onError = null); DbConnectorJob<T, TDbConnection> NonQuery<T>( Action<IDbConnectorSettings> onInit, Func<int, DbParameterCollection, T> onExecute, Func<Exception, IDbResult<T>, IDbResult<T>> onError = null); DbConnectorJob<bool, TDbConnection> NonQueries( Func<List<IDbConnectorSettings>> onInit, Action<int, DbParameterCollection> onExecuteOne = null, Func<Exception, IDbResult<bool>, IDbResult<bool>> onError = null); bool IsConnected(); Task<bool> IsConnectedAsync(); } }
using System.Collections; using System.Collections.Generic; using UnityEngine; public class FloorController : MonoBehaviour { // Start is called before the first frame update void Start() { GameManager.instance.floorController = this; } void OnParticleCollision(GameObject TargetedParticle) { Debug.Log("<color=orange> FloorController Collided with particle</color>"); GameManager.instance.FloorCollisionHandler(); } void OnParticleTrigger() { Debug.Log("<color=orange>FloorController Triggered with particle</color>"); GameManager.instance.FloorCollisionHandler(); } private void CollisionEnter(object sender, RFX4_PhysicsMotion.RFX4_CollisionInfo e) { Debug.Log("<color=green>== FloorController.CollisionEnter ==</color>"); Debug.Log(e.HitPoint); //a collision coordinates in world space Debug.Log(e.HitGameObject.name); //a collided gameobject Debug.Log(e.HitCollider.name); //a collided collider :) GameManager.instance.FloorCollisionHandler(); } // Update is called once per frame void Update() { } }
using ShopTT.Areas.Admin.Models; using ShopTT.Models; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace ShopTT.Areas.Admin.Controllers { public class SanPhamController : Controller { // GET: Admin/Products private ShopTTEntities _dbContext = new ShopTTEntities(); public ActionResult Index() { var lstProduct = from sanpham in _dbContext.Products join LSP in _dbContext.ProductTypes on sanpham.typeID equals LSP.typeID join NSX in _dbContext.Producers on sanpham.pdcID equals NSX.pdcID orderby sanpham.proUpdateDate descending select new SanPhamModel { proID = sanpham.proID, proName = sanpham.proName, proPrice = sanpham.proPrice, proPhoto = sanpham.proPhoto, proSize = sanpham.proSize, proDescription = sanpham.proDescription, proUpdateDate = sanpham.proUpdateDate, proDiscount = sanpham.proDiscount, typeID = sanpham.typeID, typeName = LSP.typeName, pdcID = sanpham.pdcID, pdcName = NSX.pdcName }; return View(lstProduct.ToList()); } [HttpGet] public ActionResult Create() { return View(); } [HttpPost] [ValidateInput(false)] public ActionResult Create(SanPhamModel id, HttpPostedFileBase fileUpload) { try { if (ModelState.IsValid) { if (id.proID == null) { ViewBag.message = "ID sản phẩm is null"; return RedirectToAction("Index", "SanPham"); } var newsp = new Product(); newsp.proID = id.proID; newsp.proName = id.proName; newsp.typeID = id.typeID; newsp.pdcID = id.pdcID; newsp.proSize = id.proSize; newsp.proPrice = id.proPrice; newsp.proDiscount = id.proDiscount; newsp.proDescription = id.proDescription; newsp.proUpdateDate = id.proUpdateDate; // if (id.Image != null) // { // lay hinh anh // var fileName = System.IO.Path.GetFileName(id.Image.FileName); // LAY tu severs // var path = Path.Combine(Server.MapPath("~/images/image_sp/"), fileName); // if (System.IO.File.Exists(path)) // { // ViewBag.message = "Image is exited"; // } // else // { // fileUpload.SaveAs(path); // } // gan value image for anhbia // newsp.SPAnh = id.Image.FileName; // } // SetViewBag1(); // SetViewBag(); //} _dbContext.Products.Add(newsp); _dbContext.SaveChanges(); if (newsp.proID != null) { ViewBag.message = "Insert success.."; } ModelState.Clear(); } } catch (System.Data.Entity.Validation.DbUnexpectedValidationException e) { Console.WriteLine(e); throw; } return RedirectToAction("Index", "SanPham"); } [HandleError] public ActionResult Delete(string id, Product obj) { var deletesp = _dbContext.Products.FirstOrDefault(x => x.proID == id); if (deletesp == null) { ViewBag.message = "Sản phẩm Không tồn tại"; return RedirectToAction("Index", "Products"); } else { _dbContext.Products.Remove(deletesp); _dbContext.SaveChanges(); ViewBag.message = "Thêm sản phẩm thành Công"; return RedirectToAction("Index", "SanPham"); } } } }
using Com.Colin.Forms.Common; using System; using System.Windows.Forms; namespace Com.Colin.Forms.Template { /// <summary> /// 标题模块 /// </summary> public partial class MenuTemplate : UserControl { public MenuTemplate() { InitializeComponent(); } /// <summary> /// 关闭按钮事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button1_Click(object sender, EventArgs e) { // 获取当前主界面 Control currentUI = CommonFuc.getUIForm(this); if(currentUI is Form) { Form form = (Form)currentUI; form.Close(); } } /// <summary> /// 标题隐藏方法 /// </summary> /// <param name="visible"></param> public void setTitleVisible(bool visible) { label1.Visible = visible; } } }
using System; using System.Collections.Generic; using System.Linq; namespace _08_Map_Districts { public class _08_Map_Districts { public static void Main() { var input = Console.ReadLine().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).ToArray(); var number = long.Parse(Console.ReadLine()); var result = new Dictionary<string, List<long>>(); for (int i = 0; i < input.Length; i++) { var line = input[i].Split(':'); var city = line[0]; var population = long.Parse(line[1]); if (!result.ContainsKey(city)) { result[city] = new List<long>(); } result[city].Add(population); } foreach (var city in result.Where(x => x.Value.Sum()>number).OrderByDescending(x => x.Value.Sum())) { var populationOfCity = city.Value.OrderByDescending(x => x).Take(5); Console.WriteLine($"{city.Key}: {string.Join(" ", populationOfCity)}"); } } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using MyClassLibrary; namespace Exercise3 { class Program { static void Main(string[] args) { /*3.а) Написать программу, которая подсчитывает расстояние между точками с координатами x1, y1 и x2,y2 по формуле r=Math.Sqrt(Math.Pow(x2-x1,2)+Math.Pow(y2-y1,2). Вывести результат, используя спецификатор формата .2f (с двумя знаками после запятой); б) *Выполнить предыдущее задание, оформив вычисления расстояния между точками в виде метода.*/ #region MyMetods.Print("Укажите координату X1."); double x1 = MyMetods.ReadDouble(); MyMetods.Print("Укажите координату Y1."); double y1 = MyMetods.ReadDouble(); MyMetods.Print("Укажите координату X2."); double x2 = MyMetods.ReadDouble(); MyMetods.Print("Укажите координату Y2."); double y2 = MyMetods.ReadDouble(); double r = Math.Sqrt(Math.Pow(x2 - x1, 2) + Math.Pow(y2 - y1, 2)); Console.WriteLine($"Вариант а.\nРасстояние между точками составляет : {r:f}."); Console.WriteLine($"Вариант б.\nРасстояние между точками составляет : {MyMetods.distance(x1, y1, x2, y2):f}."); MyMetods.Pause(); #endregion } } }
using UnityEngine; public class PlayerStatus : MonoBehaviour { [SerializeField] private TextManager TextManager = null; private int player0HP = (int)EnumNumbers.PlayerHP; private int player1HP = (int)EnumNumbers.PlayerHP; private readonly int[] tower0HP = new int[(int)EnumBoardLength.MaxBoardLengthY]; private readonly int[] tower1HP = new int[(int)EnumBoardLength.MaxBoardLengthY]; private void Start() { TextManager.SetText(player1HP, true); TextManager.SetText(player0HP, false); InitTower(); } void InitTower() { for (int i = 0; i < tower0HP.Length; i++) { tower0HP[i] = 8; tower1HP[i] = 8; } } internal void AddDirectDamage(int damage, bool player, int laneY) { if (player) { if (tower0HP[laneY] > 0) { tower0HP[laneY] -= damage; TextManager.SetTowerHPText(tower0HP[laneY], player, laneY); } else { player0HP -= damage; TextManager.SetText(player0HP, player); if (player0HP <= 0) { var loadScene = new LoadScene(); loadScene.ResetGames(); } } } else if (!player) { if (tower1HP[laneY] > 0) { tower1HP[laneY] -= damage; TextManager.SetTowerHPText(tower1HP[laneY], player, laneY); } else { player1HP -= damage; TextManager.SetText(player1HP, player); if (player1HP <= 0) { var loadScene = new LoadScene(); loadScene.ResetGames(); } } } } }
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Reflection; using Microsoft.Data.Entity.Metadata.Internal; using Microsoft.Data.Entity.Utilities; namespace Microsoft.Data.Entity.Metadata.Conventions.Internal { public class ForeignKeyAttributeConvention : IForeignKeyConvention { public virtual InternalRelationshipBuilder Apply(InternalRelationshipBuilder relationshipBuilder) { Check.NotNull(relationshipBuilder, nameof(relationshipBuilder)); var foreignKey = relationshipBuilder.Metadata; var fkPropertyOnPrincipal = FindCandidateDependentPropertyThroughEntityType(foreignKey.PrincipalEntityType, foreignKey.PrincipalToDependent?.Name); var fkPropertyOnDependent = FindCandidateDependentPropertyThroughEntityType(foreignKey.DeclaringEntityType, foreignKey.DependentToPrincipal?.Name); if (!string.IsNullOrEmpty(fkPropertyOnDependent) && !string.IsNullOrEmpty(fkPropertyOnPrincipal)) { // TODO: Log Error that unable to determine principal end based on foreign key attributes var principalTypeNavigationName = foreignKey.PrincipalToDependent?.Name; var dependentTypeNavigationName = foreignKey.DependentToPrincipal?.Name; var dependentEntityTypebuilder = relationshipBuilder.ModelBuilder.Entity(foreignKey.DeclaringEntityType.Name, ConfigurationSource.Convention); var removedConfigurationSource = dependentEntityTypebuilder.RemoveRelationship(foreignKey, ConfigurationSource.DataAnnotation); if (removedConfigurationSource == null) { return relationshipBuilder; } var principalEntityTypeBuilder = relationshipBuilder.ModelBuilder.Entity(foreignKey.PrincipalEntityType.Name, ConfigurationSource.Convention); dependentEntityTypebuilder.Relationship( principalEntityTypeBuilder, dependentEntityTypebuilder, navigationToPrincipalName: dependentTypeNavigationName, navigationToDependentName: null, configurationSource: ConfigurationSource.DataAnnotation); principalEntityTypeBuilder.Relationship( dependentEntityTypebuilder, principalEntityTypeBuilder, navigationToPrincipalName: principalTypeNavigationName, navigationToDependentName: null, configurationSource: ConfigurationSource.DataAnnotation); return null; } var fkPropertiesOnPrincipalToDependent = FindCandidateDependentPropertiesThroughNavigation(relationshipBuilder, pointsToPrincipal: false); var fkPropertiesOnDependentToPrincipal = FindCandidateDependentPropertiesThroughNavigation(relationshipBuilder, pointsToPrincipal: true); if (fkPropertiesOnDependentToPrincipal != null && fkPropertiesOnPrincipalToDependent != null && !fkPropertiesOnDependentToPrincipal.SequenceEqual(fkPropertiesOnPrincipalToDependent)) { // TODO: Log error that mismatch in foreignKey Attribute on both navigations return relationshipBuilder; } var fkPropertiesOnNavigation = fkPropertiesOnDependentToPrincipal ?? fkPropertiesOnPrincipalToDependent; InternalRelationshipBuilder newRelationshipBuilder = null; if (fkPropertiesOnNavigation == null || fkPropertiesOnNavigation.Count == 0) { if (fkPropertyOnDependent == null && fkPropertyOnPrincipal == null) { return relationshipBuilder; } if (fkPropertyOnDependent != null) { newRelationshipBuilder = relationshipBuilder.ForeignKey(new List<string> { fkPropertyOnDependent }, ConfigurationSource.DataAnnotation); } else { newRelationshipBuilder = relationshipBuilder.Invert(ConfigurationSource.DataAnnotation) ?.ForeignKey(new List<string> { fkPropertyOnPrincipal }, ConfigurationSource.DataAnnotation); } } else { if (fkPropertyOnDependent == null && fkPropertyOnPrincipal == null) { if (fkPropertiesOnNavigation.All(p => foreignKey.DeclaringEntityType.FindProperty(p) != null) || fkPropertiesOnNavigation.Any(p => foreignKey.PrincipalEntityType.FindProperty(p) == null)) { newRelationshipBuilder = relationshipBuilder.ForeignKey(fkPropertiesOnNavigation, ConfigurationSource.DataAnnotation); } else { newRelationshipBuilder = relationshipBuilder.Invert(ConfigurationSource.DataAnnotation) ?.ForeignKey(fkPropertiesOnNavigation, ConfigurationSource.DataAnnotation); } } else { if (fkPropertiesOnNavigation.Count != 1 || !string.Equals(fkPropertiesOnNavigation.First(), fkPropertyOnDependent ?? fkPropertyOnPrincipal)) { // TODO: Log error that mismatch in foreignKey Attribute on navigation and property return relationshipBuilder; } if (fkPropertyOnDependent != null) { newRelationshipBuilder = relationshipBuilder.ForeignKey(fkPropertiesOnNavigation, ConfigurationSource.DataAnnotation); } else { newRelationshipBuilder = relationshipBuilder.Invert(ConfigurationSource.DataAnnotation) ?.ForeignKey(fkPropertiesOnNavigation, ConfigurationSource.DataAnnotation); } } } return newRelationshipBuilder ?? relationshipBuilder; } private ForeignKeyAttribute GetForeignKeyAttribute(EntityType entityType, string propertyName) { return entityType.ClrType?.GetRuntimeProperties(). FirstOrDefault(p => string.Equals(p.Name, propertyName, StringComparison.OrdinalIgnoreCase))?.GetCustomAttribute<ForeignKeyAttribute>(true); } private string FindCandidateDependentPropertyThroughEntityType(EntityType entityType, string navigationName) { if (string.IsNullOrWhiteSpace(navigationName) || !entityType.HasClrType) { return null; } var candidateProperties = new List<string>(); foreach (var propertyInfo in entityType.ClrType.GetRuntimeProperties().OrderBy(p => p.Name)) { var targetType = propertyInfo.FindCandidateNavigationPropertyType(); if (targetType != null) { continue; } var attribute = GetForeignKeyAttribute(entityType, propertyInfo.Name); if (attribute != null && attribute.Name == navigationName) { candidateProperties.Add(propertyInfo.Name); } } if (candidateProperties.Count > 1) { // TODO: Log error that multiple ForeignKey Attribute pointing to same Navigation found. return null; } return candidateProperties.FirstOrDefault(); } private IReadOnlyList<string> FindCandidateDependentPropertiesThroughNavigation(InternalRelationshipBuilder relationshipBuilder, bool pointsToPrincipal) { var navigation = pointsToPrincipal ? relationshipBuilder.Metadata.DependentToPrincipal : relationshipBuilder.Metadata.PrincipalToDependent; var navigationFkAttribute = navigation != null ? GetForeignKeyAttribute(navigation.DeclaringEntityType, navigation.Name) : null; if (navigationFkAttribute != null) { var properties = navigationFkAttribute.Name.Split(',').Select(p => p.Trim()).ToList(); if (properties.Any(string.IsNullOrWhiteSpace)) { // TODO: Log error stating invalid propertyName in ForeignKeyAttribute return null; } return properties; } return null; } } }
using Common; using Common.Data; using Common.Log; using SessionSettings; using System; using System.Configuration; using System.DirectoryServices; using System.DirectoryServices.AccountManagement; using System.Drawing; using System.Drawing.Drawing2D; using System.Linq; using System.Reflection; using System.Windows.Forms; namespace Switchboard.Presentation { /// <summary> /// Entry form for the application. /// </summary> public partial class LoginForm : Form { #region Private Fields //Common functions for the Client tier. private ClientPresentation mClientPresentation = new ClientPresentation(); private string[] mComputerNames = { "2192", "2119", "2139W", "DEV2", "2172", "20429", "2172", "2172T", "DEV3" }; private string mCurrentName = String.Empty; private string[] mDataSources = { @"NBISQL2K8\NBISQL2K8", @"NFMSQLS\NFMSQLS" }; #endregion #region Constructors /// <summary> /// Creates a new instance of LoginForm. /// </summary> public LoginForm() { InitializeComponent(); DoSetup(); } #endregion #region Private Methods /// <summary> /// Cancels the operation. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void CancelButton_Click(object sender, EventArgs e) { Application.Exit(); } /// <summary> /// Determines whether to display the DSN dropdown. /// </summary> /// <returns>True if the calling computer name is in the list; otherwise false.</returns> private bool CheckComputerName() { string computerName = Environment.MachineName.Substring(3, 4); if (Environment.MachineName.Length > 7) computerName = Environment.MachineName.Substring(3, 5); bool show = false; //Set the current computer name for use elsewhere on this form. if (mComputerNames.Contains(computerName)) { show = true; mCurrentName = computerName; } return show; } /// <summary> /// Determines which key has been pressed. /// </summary> /// <param name="e"></param> private void CheckKeys(KeyEventArgs e) { switch (e.KeyCode) { case Keys.CapsLock: case Keys.NumLock: case Keys.Scroll: capsLockOn.Visible = CheckKeyState(); break; default: e.Handled = true; break; } } /// <summary> /// Determines whether the Lock keys on the user's keyboard are on. /// </summary> /// <returns>True if any of the Lock keys is on; otherwise false.</returns> private bool CheckKeyState() { return Control.IsKeyLocked(Keys.CapsLock) || Control.IsKeyLocked(Keys.NumLock) || Control.IsKeyLocked(Keys.Scroll); } /// <summary> /// Logs the user in. /// </summary> private void DoLogin() { try { //Default to Live. //Maybe go ahead and hard-code these, since they are unlikely to change. Settings.ConnectionString = ConfigurationManager.ConnectionStrings["live"].ConnectionString; Settings.DbLiveStaging = "Live"; if (!liveRadioButton.Checked) { Settings.ConnectionString = ConfigurationManager.ConnectionStrings["staging"].ConnectionString; Settings.DbLiveStaging = "Staging"; } //Set the minimum log level and logging connection string. //Logging.MinimumLogLevel = (LogLevel)Enum.Parse(typeof(LogLevel), ConfigurationManager.AppSettings["LogLevel"]); Logging.ConnectionString = Settings.ConnectionString; //Check if the user is valid - using Active directory. bool checkUser = IsUserValid("LDAP://nfmcodc1.co.noof.com/CN=*USG - db_movie_rebuild_a,OU=Database Access Control Groups,OU=New Security Groups,OU=Groups,OU=NOOF,DC=CO,DC=NOOF,DC=com", loginNameTextBox.Text, passwordTextBox.Text, "", ""); if (!checkUser) // invalid user mClientPresentation.ShowError("You have entered an invalid Login Name and/or password."); else // valid user { //For use by BIS for testing. if (dsns.Visible && dsns.SelectedIndex > 0) { string dataSource = mDataSources[0]; if (dsns.SelectedIndex == 1) dataSource = mDataSources[1]; Settings.ConnectionString = String.Format(ConfigurationManager.ConnectionStrings["dsn"].ConnectionString, dataSource, dsns.SelectedItem.ToString()); } try { //Get the name of the host computer to use for this session. Settings.SetSessionServer(); // Get the Users object for this user. Settings.UserName = loginNameTextBox.Text.ToUpper(); Settings.GetUser(); Settings.DeleteActiveModules(); } catch (InvalidOperationException ioe) { Logging.Log(ioe, "Switchboard.Presentation", "LoginForm.DoLogin"); mClientPresentation.ShowError(ioe.Message + "\n" + ioe.StackTrace); } catch (Exception ee) { Logging.Log(ee, "Switchboard.Presentation", "LoginForm.DoLogin"); mClientPresentation.ShowError(ee.Message + "\n" + ee.StackTrace); } //Show the main menu. MainMenuForm mainMenuForm = new MainMenuForm(Settings.CommonSettings()); mainMenuForm.Show(); this.Hide(); } } catch (InvalidOperationException ioe) { Logging.Log(ioe, "Switchboard.Presentation", "LoginForm.DoLogin"); mClientPresentation.ShowError(ioe.Message + "\n" + ioe.StackTrace); } catch (Exception ee) { Logging.Log(ee, "Switchboard.Presentation", "LoginForm.DoLogin"); mClientPresentation.ShowError(ee.Message + "\n" + ee.StackTrace); } } /// <summary> /// Sets up the form before load. /// </summary> private void DoSetup() { //////https://msdn.microsoft.com/en-us/library/system.security.permissions.principalpermissionattribute%28v=vs.110%29.aspx // AppDomain.CurrentDomain.SetPrincipalPolicy(System.Security.Principal.PrincipalPolicy.WindowsPrincipal); ////// UpdateLabels(); capsLockOn.Visible = CheckKeyState(); } /// <summary> /// Gets the current version number of this assembly. /// </summary> /// <returns>The version number.</returns> private string GetVersionNumber() { return Assembly.GetExecutingAssembly().FullName.Split(',')[1].Substring(8); } /// <summary> /// Paints the header label with a gradient. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// <remarks>This code is necessary because the BorderedLabel that used to be headerLabel did not /// respond to the MouseDown event for dragging, so we are custom painting the label here.</remarks> private void HeaderLabel_Paint(object sender, PaintEventArgs e) { using (LinearGradientBrush brush = new LinearGradientBrush(headerLabel.ClientRectangle, Color.DarkGray, Color.Black, LinearGradientMode.Vertical)) { e.Graphics.FillRectangle(brush, headerLabel.ClientRectangle); SizeF size = e.Graphics.MeasureString(headerLabel.Text, headerLabel.Font); PointF location = new PointF(headerLabel.ClientRectangle.Width / 2 - size.Width / 2, headerLabel.ClientRectangle.Height / 2 - size.Height / 2); e.Graphics.DrawString(headerLabel.Text, headerLabel.Font, new SolidBrush(headerLabel.ForeColor), location); } } /// <summary> /// Checks whether the current user is a valid user. /// </summary> /// <param name="srvr">The domain.</param> /// <param name="usr">The username.</param> /// <param name="pwd">The password.</param> /// <returns>True if the user is valid; otherwise false.</returns> private bool IsUserValid(string srvr, string usr, string pwd, string serviceAccountUsername, string serviceAccountPassword) { bool result = false; try { try { ////Used for COM objects. //DirectoryEntry entry = new DirectoryEntry(srvr, usr, pwd); //object nativeObject = entry.NativeObject; //result = true; // This uses the service account to query the LDAP server with the supplied credentials // U: moviesa // P: 1She-Ra! using(var context = new PrincipalContext(ContextType.Domain, "BOULDER_CO", "BOULDER_CO\\moviesa", "1She-Ra!")) { result = context.ValidateCredentials(usr, pwd); } } catch (DirectoryServicesCOMException cex) { Logging.Log(cex); } catch (Exception ex) { Logging.Log(ex); } } catch (Exception e) { Logging.Log(e); } return result; } /// <summary> /// Handles the LoginButton.Click() event. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void LoginButton_Click(object sender, EventArgs e) { DoLogin(); } /// <summary> /// Closes the form. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void LoginForm_FormClosing(object sender, FormClosingEventArgs e) { headerLabel.Paint -= HeaderLabel_Paint; Environment.Exit(0); } /// <summary> /// Handles keyboard input. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void LoginForm_KeyDown(object sender, KeyEventArgs e) { if ((e.Modifiers & Keys.Alt) != 0) { switch (e.KeyCode) { case Keys.A: MessageBox.Show("The current version is:\n\n" + GetVersionNumber(), "Version"); break; default: e.Handled = true; break; } } else CheckKeys(e); } /// <summary> /// Handles keyboard input. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void LoginForm_KeyUp(object sender, KeyEventArgs e) { CheckKeys(e); } /// <summary> /// Loads the form. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void LoginForm_Load(object sender, EventArgs e) { headerLabel.Text = TextGen.GenerateText(); dsns.Visible = CheckComputerName(); // hardcode login / password if (Environment.UserName.ToUpper() == "RMIDDLETON") { dsns.SelectedIndex = 3; loginNameTextBox.Text = "RMIDDLETON"; passwordTextBox.Text = "3Welcome#"; } else if (Environment.UserName.ToUpper() == "BISTEST") { dsns.SelectedIndex = 3; loginNameTextBox.Text = "BISTEST"; passwordTextBox.Text = "Canada1!"; } else if (dsns.Visible) { dsns.SelectedIndex = 0; if (stagingRadioButton.Checked) { if (mCurrentName == "2139" || mCurrentName == "DEV2") { dsns.SelectedIndex = 3; } #if DEBUG else { loginNameTextBox.Text = ""; passwordTextBox.Text = ""; } #endif } } else { // default to Live database for regular users liveRadioButton.Checked = true; } } /// <summary> /// Allows the form to be moved around by its title bar. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void LoginForm_MouseDown(object sender, MouseEventArgs e) { if (SafeNativeMethods.ReleaseCapture()) { // Ordering the form // Simulating left mouse button clicking on the title bar if (SafeNativeMethods.SendMessage(this.Handle, // Form handle SafeNativeMethods.WM_NCLBUTTONDOWN, // Simulating the click SafeNativeMethods.HTCAPTION, // Attaching it to the title bar 0) != 0) // No further options required { string message = "Unable to drag form " + this.Name + ". Contact BIS and have someone there investigate."; MessageBox.Show(message, "LoginForm", MessageBoxButtons.OK, MessageBoxIcon.Error); Logging.Log(message, "Login", "MouseDown"); } } } /// <summary> /// Handles the PreviewKeyDown() event. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void LoginForm_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) { capsLockOn.Visible = CheckKeyState(); } /// <summary> /// Attaches overridden Paint events to their respective controls. /// </summary> private void UpdateLabels() { headerLabel.Paint += HeaderLabel_Paint; headerLabel.Refresh(); adultContentLabel.Refresh(); loginNameTextBox.Text = ""; passwordTextBox.Text = ""; } #endregion } }
using System.Collections.Generic; using Uintra.Core.Feed.Models; using Uintra.Features.CentralFeed.Commands; namespace Uintra.Features.CentralFeed.Builders { public interface IActivityTabsBuilder { IEnumerable<ActivityFeedTabViewModel> Build(CentralFeedFilterCommand command); ActivityTabsBuilder BuildSocialTab(); ActivityTabsBuilder BuildNewsTab(); ActivityTabsBuilder BuildEventsTab(); } }
using UnityEngine; using System.Collections; public class ShowSensor : MonoBehaviour { //reference to light intesnity private float int1; private float int2; private float int3; //reference to sensors related to button public GameObject trigger1 = null; public GameObject trigger2 = null; public GameObject trigger3 = null; public bool debugFlag = false; // Use this for initialization void Start() { if(trigger1 != null) int1 = trigger1.GetComponent<Light>().intensity; if(trigger2 != null) int2 = trigger2.GetComponent<Light>().intensity; if(trigger3 != null) int3 = trigger3.GetComponent<Light>().intensity; } void OnTriggerEnter(Collider col) { if (debugFlag) { Debug.Log("entered collider"); } //if there exists a trigger if (trigger1 != null) { //make it visible, turn on the light, set the intensity trigger1.GetComponent<MeshRenderer>().enabled = true; trigger1.GetComponent<Light>().enabled = true; trigger1.GetComponent<Light>().intensity = int1; } if (trigger2 != null) { trigger2.GetComponent<MeshRenderer>().enabled = true; trigger2.GetComponent<Light>().enabled = true; trigger2.GetComponent<Light>().intensity = int2; } if (trigger3 != null) { trigger3.GetComponent<MeshRenderer>().enabled = true; trigger3.GetComponent<Light>().enabled = true; trigger3.GetComponent<Light>().intensity = int3; } } void OnTriggerExit(Collider col) { if (debugFlag) { Debug.Log("Exited collider"); } //if there is a trigger if (trigger1 != null) { //make it invisible, turn off the light. trigger1.GetComponent<MeshRenderer>().enabled = false; trigger1.GetComponent<Light>().enabled = false; trigger1.GetComponent<Light>().intensity = 0; } if (trigger2 != null) { trigger2.GetComponent<MeshRenderer>().enabled = false; trigger2.GetComponent<Light>().enabled = false; trigger2.GetComponent<Light>().intensity = 0; } if (trigger3 != null) { trigger3.GetComponent<MeshRenderer>().enabled = false; trigger3.GetComponent<Light>().enabled = false; trigger3.GetComponent<Light>().intensity = 0; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Yoonseop_Lee_Sec003_Lab02_Exercise02 { class Program { static void Main(string[] args) { StringBuilder sb = new StringBuilder("This is to test whether the extension method count can return a right answer or not"); CountWords countw = new CountWords(); Console.WriteLine(countw.Uppercase(sb.ToString())); // Extension method Console.WriteLine(countw.Count2(sb.ToString())); } } public static class CountWordsExtensions { public static int Count2(this CountWords value, string sentence) { string[] strArray = sentence.Split(); int result = strArray.Length; return result; } } }
namespace SlicingFile { using System; using System.Collections.Generic; using System.IO; public class Startup { private static List<string> filterParts = new List<string>(); private static void Main(string[] args) { int partsCount = int.Parse(Console.ReadLine().Replace("parts= ", "")); SliceFile(partsCount); AssembleFile(); } private static void SliceFile(int partsCount) { var buffer = new byte[4096]; using (var sourceFile = new FileStream(@"D:\Vsichki Startupi\Softuni\C# Advanced 2\Streams\files\sliceMe.mp4", FileMode.Open)) { var partSize = Math.Ceiling((double)sourceFile.Length / partsCount); for (int i = 0; i < partsCount; i++) { var filePartName = $@"D:\Vsichki Startupi\Softuni\C# Advanced 2\Streams\files\Part-{i}.mp4"; filterParts.Add(filePartName); using (var destinationFile = new FileStream(filePartName, FileMode.Create)) { int totalBytes = 0; while (totalBytes < partSize) { int readBytes = sourceFile.Read(buffer, 0, buffer.Length); if (readBytes == 0) break; destinationFile.Write(buffer, 0, readBytes); totalBytes += readBytes; } } } } } private static void AssembleFile() { var buffer = new byte[4096]; using (var assembledImage = new FileStream(@"D:\Vsichki Startupi\Softuni\C# Advanced 2\Streams\files\assembled.mp4", FileMode.Create)) { for (int i = 0; i < filterParts.Count; i++) { using (var reader = new FileStream(filterParts[i], FileMode.Open)) { while (true) { int readBytes = reader.Read(buffer, 0, buffer.Length); if (readBytes == 0) break; assembledImage.Write(buffer, 0, readBytes); } } } } } } }
using System; using System.Linq; using System.Collections.Generic; using System.Text.RegularExpressions; using System.Text; namespace _1 { class Program { static void Main(string[] args) { string regexValid = @"[^d-z{}|#]"; string input = Console.ReadLine(); string[] twoLetters = Console.ReadLine().Split(" "); string decyphered = string.Empty; StringBuilder sb = new StringBuilder(); if (Regex.IsMatch(input,regexValid)) { Console.WriteLine("This is not the book you are looking for."); } else { char[] chararr = input.ToCharArray(); foreach (var item in chararr) { decyphered += (char)(item - 3); } //Console.WriteLine(decyphered); sb.Append(decyphered); string firstWord = twoLetters[0]; string secondWord = twoLetters[1]; sb.Replace(firstWord, secondWord); Console.WriteLine(sb); } } } }
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.HttpsPolicy; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.EntityFrameworkCore; using NetNote.Models; using NetNote.Repository; using NetNote.Middleware; using Microsoft.AspNetCore.Identity; namespace NetNote { public class Startup { public Startup(IConfiguration configuration) { Configuration = configuration; } public IConfiguration Configuration { get; } // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddRazorPages(); services.AddControllers(); services.AddDbContext<NoteContext>(options =>options.UseSqlite(Configuration.GetConnectionString("NetNote"))); services.AddIdentity<NoteUser, IdentityRole>() .AddEntityFrameworkStores<NoteContext>() .AddDefaultTokenProviders(); services.AddScoped<INoteRepository, NoteRepository>(); services.AddScoped<INoteTypeRepository,NoteTypeRepository>(); services.Configure<IdentityOptions>(options => { options.Password.RequireNonAlphanumeric = false; options.Password.RequireUppercase = false; options.Password.RequiredLength = 8; }); services.ConfigureApplicationCookie(options => { options.Cookie.HttpOnly = true; options.ExpireTimeSpan = TimeSpan.FromHours(12); options.LoginPath = "/Login"; }); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { InitData(app.ApplicationServices); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Error"); app.UseHsts(); } app.UseHttpsRedirection(); //app.UseBasicMiddleware(new BasicUser { UserName = "admin", Password = "123456" }); app.UseStaticFiles(); app.UseRouting(); app.UseAuthentication(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapRazorPages(); endpoints.MapControllers(); }); } private void InitData(IServiceProvider serviceProvider) { using (var serviceScope = serviceProvider.GetRequiredService<IServiceScopeFactory>().CreateScope()) { //获取注入的NoteContext var context = serviceScope.ServiceProvider.GetRequiredService<NoteContext>(); context.Database.EnsureCreated();//如果数据库不存在则创建,存在则不做操作 if (!context.NoteTypes.Any())//不存在类型则添加 { var notetypes = new List<NoteType>{ new NoteType{ Name="日常记录"}, new NoteType{ Name="代码收藏"}, new NoteType{ Name="消费记录"}, new NoteType{ Name="网站收藏"} }; context.NoteTypes.AddRange(notetypes); context.SaveChanges(); } if (!context.Users.Any()) //不存在用户,默认添加admin用户 { var userManager = serviceScope.ServiceProvider.GetRequiredService<UserManager<NoteUser>>(); var noteUser = new NoteUser { UserName = "admin", Email = "admin@dot.net" }; userManager.CreateAsync(noteUser, "admin123").Wait(); } } } } }
using System; using System.Collections.Generic; using System.Linq; using System.Web; using CEMAPI.Models; using log4net; using static CEMAPI.Models.InvoiceTaxCalculationUtility; namespace CEMAPI.DAL { public class TransferOrderDAL { TETechuvaDBContext context = new TETechuvaDBContext(); private static readonly ILog log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); public string PostTransferFeeInvoicetoSAP(TEOffer offer, TEInvoice invoice, List<TEInVoiceBreakUp> invoiceBrkup) { string SAPInvoiceID = string.Empty; try { var projlist = (from teproject in context.TEProjects join ofr in context.TEOffers on teproject.ProjectID equals ofr.ProjectID join unit in context.TEUnits on ofr.UnitID equals unit.UnitID join company in context.TECompanies on teproject.CompanyID equals company.Uniqueid where (ofr.ProjectID == offer.ProjectID) select new { teproject.ProjectID, company.CompanyCode, teproject.ProjectCode, ProjectSAPCode = teproject.SapCode, unit.OwnerShipType }).FirstOrDefault(); ////var invoiceBrkup = (from invBrkup in context.TEInVoiceBreakUps //// join inv in context.TEInvoices on invBrkup.InVoiceID equals inv.InVoiceID //// where inv.InVoiceID == invoice.InVoiceID //// select invBrkup).ToList(); //decimal? landCost = 0, constnCost = 0, maintCost = 0; decimal? transferOrder = invoice.TotalInvoiceAmount; decimal? totServiceTax = 0, totVat = 0, totSBC = 0, totKKC = 0; decimal? reimbServiceTax = 0, reimbVat = 0, reimbSBC = 0, reimbKKC = 0; string serviceTaxCode = "", vatCode = "", sbcCode = "", kkcCode = ""; string reimbServiceTaxCode = "", reimbVatCode = "", reimbSbcCode = "", reimbKkcCode = ""; #region Tax breakup calculation if (invoiceBrkup.Count > 0) { foreach (TEInVoiceBreakUp brkup in invoiceBrkup) { if (brkup.ConsiderationType == "TransferOrder") { //landCost = brkup.ConsiderationAmount; transferOrder = brkup.ConsiderationAmount; if (brkup.SAPTaxCode == "ZSER") if (brkup.TaxAmount > 0) { totServiceTax += brkup.TaxAmount; serviceTaxCode = brkup.SAPTaxCode; } if (brkup.SAPTaxCode == "ZVAT") if (brkup.TaxAmount > 0) { totVat += brkup.TaxAmount; vatCode = brkup.SAPTaxCode; } if (brkup.SAPTaxCode == "ZSBC") if (brkup.TaxAmount > 0) { totSBC += brkup.TaxAmount; sbcCode = brkup.SAPTaxCode; } if (brkup.SAPTaxCode == "ZKKC") if (brkup.TaxAmount > 0) { totKKC += brkup.TaxAmount; kkcCode = brkup.SAPTaxCode; } if (brkup.SAPTaxCode == "ZRST") if (brkup.TaxAmount > 0) { reimbServiceTax += brkup.TaxAmount; reimbServiceTaxCode = brkup.SAPTaxCode; } if (brkup.SAPTaxCode == "ZRVT") if (brkup.TaxAmount > 0) { reimbVat += brkup.TaxAmount; reimbVatCode = brkup.SAPTaxCode; } if (brkup.SAPTaxCode == "RSBC") if (brkup.TaxAmount > 0) { reimbSBC += brkup.TaxAmount; reimbSbcCode = brkup.SAPTaxCode; } if (brkup.SAPTaxCode == "RKKC") if (brkup.TaxAmount > 0) { reimbKKC += brkup.TaxAmount; reimbKkcCode = brkup.SAPTaxCode; } } } } #endregion Tax breakup calculation //Checking this Invoice is for JD Or Normal... string OwnerShipType = projlist.OwnerShipType; //Getting Values from SAP rules //string check = Convert.ToString(invoice.Evaluate("<SAP Value:CustomerInvoiceCheck>", null)); string check = "0"; if (check == "0") { //Variable Declaration and Initialization DateTime Invoicedate = DateTime.Now; DateTime Createdon = DateTime.Now; string DocumentinDate = string.Format("{0:dd.MM.yyyy}", Createdon); //Getting Values from SAP rules //string DocumentType = Convert.ToString(invoice.Evaluate("<SAP Value:BLARTInvoice>", null)); string DocumentType = "DR"; string CompanyofCode = projlist.CompanyCode; string PostinginDate = string.Format("{0:dd.MM.yyyy}", Invoicedate); string ReferenceDoc = Convert.ToString(invoice.InVoiceID); string DocumnetHeaderText = "Transfer Fee"; string CustomerNumber = Convert.ToString(offer.SAPCustomerID); string Amountindoccurrency = Convert.ToString(invoice.TotalInvoiceAmount); //Getting Values from SAP rules string Termsofpaymentkey = "0001"; string Paymentmethod = "T"; string Taxonsalescode = string.Empty; string Costcenter = string.Empty; string Itemtextitem = string.Empty; string Salesdocument = Convert.ToString(offer.SAPOrderID); string Salesdocumenttem = "10"; string Taxindicator = string.Empty; //Getting Values from SAP rules //string CurrencyKey = Convert.ToString(invoice.Evaluate("<SAP Value:WAERS>", null)); string CurrencyKey = "INR"; //Creating an instance of CustomerInvoice which is defined in service EbuildService.CustomerInvoice.CusInvCrMemoReqItem Invoice = new EbuildService.CustomerInvoice.CusInvCrMemoReqItem(); IList<EbuildService.CustomerInvoice.CusInvCrMemoReqItemItem> InvoiceitemList = new List<EbuildService.CustomerInvoice.CusInvCrMemoReqItemItem>(); if (OwnerShipType != "JD") { // System.Diagnostics.Trace.WriteLine("For Normal Invoice Creation"); //SubItem for Others - Transfer Fee... //if (transferOrder > 0) //{ // double otherPrice = Convert.ToDouble(transferOrder); // EbuildService.CustomerInvoice.CusInvCrMemoReqItemItem subitemConst = new EbuildService.CustomerInvoice.CusInvCrMemoReqItemItem(); // subitemConst.KSCHL = "ZTHR"; // subitemConst.WRBTR = Convert.ToString(otherPrice); // subitemConst.KOSTL = string.Empty; // subitemConst.MWSKZ = string.Empty; // subitemConst.PROJK = projlist.ProjectSAPCode; // subitemConst.SGTXT = string.Empty; // InvoiceitemList.Add(subitemConst); // string Cons1 = Convert.ToString(otherPrice); // System.Diagnostics.Trace.WriteLine(String.Format("Cons1 {0}", Cons1)); //} } else { //Temporarily commented by swamy need clarification // System.Diagnostics.Trace.WriteLine("For JD Invoice Creation"); //Subitem for Reimbursement Service Tax... if (reimbServiceTax > 0) { EbuildService.CustomerInvoice.CusInvCrMemoReqItemItem subitemReimbursementServiceTax = new EbuildService.CustomerInvoice.CusInvCrMemoReqItemItem(); subitemReimbursementServiceTax.KSCHL = "ZRST"; subitemReimbursementServiceTax.WRBTR = Convert.ToString(reimbServiceTax); subitemReimbursementServiceTax.KOSTL = string.Empty; subitemReimbursementServiceTax.MWSKZ = string.Empty; subitemReimbursementServiceTax.PROJK = projlist.ProjectSAPCode; subitemReimbursementServiceTax.SGTXT = string.Empty; InvoiceitemList.Add(subitemReimbursementServiceTax); } //Subitem for Reimbursement VAT... if (reimbVat > 0) { EbuildService.CustomerInvoice.CusInvCrMemoReqItemItem subitemReimbursementVAT = new EbuildService.CustomerInvoice.CusInvCrMemoReqItemItem(); subitemReimbursementVAT.KSCHL = "ZRVT"; subitemReimbursementVAT.WRBTR = Convert.ToString(reimbVat); subitemReimbursementVAT.KOSTL = string.Empty; subitemReimbursementVAT.MWSKZ = string.Empty; subitemReimbursementVAT.PROJK = projlist.ProjectSAPCode; subitemReimbursementVAT.SGTXT = string.Empty; InvoiceitemList.Add(subitemReimbursementVAT); } //Subitem for Reimbursement SBC... if (reimbSBC > 0) { EbuildService.CustomerInvoice.CusInvCrMemoReqItemItem subitemReimbursementRSBC = new EbuildService.CustomerInvoice.CusInvCrMemoReqItemItem(); subitemReimbursementRSBC.KSCHL = "RSBC"; subitemReimbursementRSBC.WRBTR = Convert.ToString(reimbSBC); subitemReimbursementRSBC.KOSTL = string.Empty; subitemReimbursementRSBC.MWSKZ = string.Empty; subitemReimbursementRSBC.PROJK = projlist.ProjectSAPCode; subitemReimbursementRSBC.SGTXT = string.Empty; InvoiceitemList.Add(subitemReimbursementRSBC); } //Subitem for Reimbursement KKC... if (reimbKKC > 0) { EbuildService.CustomerInvoice.CusInvCrMemoReqItemItem subitemReimbursementRKKC = new EbuildService.CustomerInvoice.CusInvCrMemoReqItemItem(); subitemReimbursementRKKC.KSCHL = "RKKC"; subitemReimbursementRKKC.WRBTR = Convert.ToString(reimbKKC); subitemReimbursementRKKC.KOSTL = string.Empty; subitemReimbursementRKKC.MWSKZ = string.Empty; subitemReimbursementRKKC.PROJK = projlist.ProjectSAPCode; subitemReimbursementRKKC.SGTXT = string.Empty; InvoiceitemList.Add(subitemReimbursementRKKC); } } //////////SubItem for MaintainenceFund Price... ////////if (maintCost > 0) ////////{ //////// EbuildService.CustomerInvoice.CusInvCrMemoReqItemItem subitemMaintenance = new EbuildService.CustomerInvoice.CusInvCrMemoReqItemItem(); //////// subitemMaintenance.KSCHL = "ZMAN"; //////// subitemMaintenance.WRBTR = Convert.ToString(maintCost); //////// subitemMaintenance.KOSTL = string.Empty; //////// subitemMaintenance.MWSKZ = string.Empty; //////// subitemMaintenance.PROJK = projlist.ProjectSAPCode; //////// subitemMaintenance.SGTXT = string.Empty; //////// InvoiceitemList.Add(subitemMaintenance); ////////} //Temporarily commented by swamy need clarity ////SubItem for Other Price... //if (Convert.ToString(invoice["OthersPrice"]) != "0") //{ // ReversalTransactionClass.CustomerInvoice.CusInvCrMemoReqItemItem subitemOthers = new ReversalTransactionClass.CustomerInvoice.CusInvCrMemoReqItemItem(); // subitemOthers.KSCHL = "ZTHR"; // subitemOthers.WRBTR = Convert.ToString(invoice["OthersPrice"]); // System.Diagnostics.Trace.WriteLine(String.Format("invoice[OthersPrice]: {0}", invoice["OthersPrice"].ToString())); // System.Diagnostics.Trace.WriteLine(String.Format("subitemOthers.WRBTR:: {0}", subitemOthers.WRBTR)); // subitemOthers.KOSTL = string.Empty; // subitemOthers.MWSKZ = string.Empty; // subitemOthers.PROJK = string.Empty; // subitemOthers.SGTXT = string.Empty; // InvoiceitemList.Add(subitemOthers); // string othrpr = Convert.ToString(invoice["OthersPrice"]); // System.Diagnostics.Trace.WriteLine(String.Format("othrpr {0}", othrpr)); //} ////SubItem for Other Price... if (transferOrder > 0) { EbuildService.CustomerInvoice.CusInvCrMemoReqItemItem subitemOthers = new EbuildService.CustomerInvoice.CusInvCrMemoReqItemItem(); subitemOthers.KSCHL = "ZTHR"; subitemOthers.WRBTR = Convert.ToString(transferOrder); System.Diagnostics.Trace.WriteLine(String.Format("invoice[OthersPrice]: {0}", transferOrder.ToString())); System.Diagnostics.Trace.WriteLine(String.Format("subitemOthers.WRBTR:: {0}", subitemOthers.WRBTR)); subitemOthers.KOSTL = string.Empty; subitemOthers.MWSKZ = "AO"; subitemOthers.PROJK = string.Empty; subitemOthers.SGTXT = string.Empty; InvoiceitemList.Add(subitemOthers); string othrpr = Convert.ToString(transferOrder); System.Diagnostics.Trace.WriteLine(String.Format("othrpr {0}", othrpr)); } //SubItem for Service tax... if (totServiceTax > 0) { EbuildService.CustomerInvoice.CusInvCrMemoReqItemItem subitemService = new EbuildService.CustomerInvoice.CusInvCrMemoReqItemItem(); subitemService.KSCHL = "ZSER"; subitemService.WRBTR = Convert.ToString(totServiceTax); subitemService.KOSTL = string.Empty; subitemService.MWSKZ = serviceTaxCode = "A4"; subitemService.PROJK = projlist.ProjectSAPCode; subitemService.SGTXT = string.Empty; InvoiceitemList.Add(subitemService); } //SubItem for Total VAT... if (totVat > 0) { EbuildService.CustomerInvoice.CusInvCrMemoReqItemItem subitemVAT = new EbuildService.CustomerInvoice.CusInvCrMemoReqItemItem(); subitemVAT.KSCHL = "ZVAT"; subitemVAT.WRBTR = Convert.ToString(totVat); subitemVAT.KOSTL = string.Empty; subitemVAT.MWSKZ = vatCode = "B3"; subitemVAT.PROJK = projlist.ProjectSAPCode; subitemVAT.SGTXT = string.Empty; InvoiceitemList.Add(subitemVAT); } //SubItem for Total SBC... if (totSBC > 0) { EbuildService.CustomerInvoice.CusInvCrMemoReqItemItem subitemSBC = new EbuildService.CustomerInvoice.CusInvCrMemoReqItemItem(); subitemSBC.KSCHL = "ZSBC"; subitemSBC.WRBTR = Convert.ToString(totSBC); subitemSBC.KOSTL = string.Empty; subitemSBC.MWSKZ = sbcCode = "B3"; subitemSBC.PROJK = projlist.ProjectSAPCode; subitemSBC.SGTXT = string.Empty; InvoiceitemList.Add(subitemSBC); } //SubItem for Total KKC... if (totKKC > 0) { EbuildService.CustomerInvoice.CusInvCrMemoReqItemItem subitemKKC = new EbuildService.CustomerInvoice.CusInvCrMemoReqItemItem(); subitemKKC.KSCHL = "ZKKC"; subitemKKC.WRBTR = Convert.ToString(totKKC); subitemKKC.KOSTL = string.Empty; subitemKKC.MWSKZ = kkcCode = "A4"; subitemKKC.PROJK = projlist.ProjectSAPCode; subitemKKC.SGTXT = string.Empty; InvoiceitemList.Add(subitemKKC); } Invoice.item = InvoiceitemList.ToArray(); EbuildService.CustomerInvoice.CusInvCrMemoReq Request = new EbuildService.CustomerInvoice.CusInvCrMemoReq(); Invoice.BLDAT = DocumentinDate; Invoice.BLART = DocumentType; Invoice.BUKRS = CompanyofCode; Invoice.BUDAT = PostinginDate; Invoice.XBLNR = ReferenceDoc; Invoice.BKTXT = DocumnetHeaderText; Invoice.KUNNR = CustomerNumber; Invoice.WRBTR = Amountindoccurrency; Invoice.ZTERM = Termsofpaymentkey; Invoice.ZLSCH = Paymentmethod; Invoice.SGTXT = Itemtextitem; Invoice.MWSKZ = Taxonsalescode; Invoice.VBELN = Salesdocument; Invoice.POSNR = Salesdocumenttem; Invoice.WAERS = CurrencyKey; Request.item = Invoice; //Creating an instance of the object which has function defined and call IList<EbuildService.CustomerInvoice.CusInvCrMemoResItem> ResponseCustomerInvoiceList = new List<EbuildService.CustomerInvoice.CusInvCrMemoResItem>(); SAPCallConnector sapCall = new SAPCallConnector(); ResponseCustomerInvoiceList = sapCall.CustomerInvoice(Request); foreach (EbuildService.CustomerInvoice.CusInvCrMemoResItem item in ResponseCustomerInvoiceList) { if (item.RETCODE == "0") { SAPInvoiceID = Convert.ToString(item.BELNR); } else { SAPInvoiceID = string.Empty; if (log.IsDebugEnabled) log.Debug("Failed To Generate Invoice:" + item.MESSAGE); } } } } catch (Exception) { throw; } return SAPInvoiceID; } public string SaleOrderGenerationUpdation(int? offerId, string sapcustomerid, string saporderid) { string SaleOrderID = string.Empty; decimal? HomeIP = 0; decimal? RServiceTax = 0; decimal? RVat = 0; decimal? RSBc = 0; decimal? RKKc = 0; decimal? MFPrice = 0; int? unitId = 0; int? projectId = 0; var prjUnit = (from ofr in context.TEOffers where ofr.OfferID == offerId select new { ofr.ProjectID, ofr.UnitID }).FirstOrDefault(); unitId = prjUnit.UnitID; projectId = prjUnit.ProjectID; var unitslist = (from unit in context.TEUnits join tower in context.TETowerMasters on unit.TowerID equals tower.TowerID join project in context.TEProjects on tower.ProjectID equals project.ProjectID join termsndcondition in context.TESaleTermsANDConditions on project.ProjectID equals termsndcondition.ProjectID where (unit.UnitID == unitId && unit.ApprovedStatus == "Approved") select new { unit.TowerID, unit.OwnerShipType, unit.UnitNumber, unit.SoldDate, tower.LaunchStatus, termsndcondition.LaunchType }).FirstOrDefault(); //Getting the values for "LaunchStage","LaunchType", and "JDUnit"... string launchtype = unitslist.LaunchType; string launchstage = unitslist.LaunchStatus; string jdUnit = unitslist.OwnerShipType; /*Need to get value from SAP table*/ //string check1 = Convert.ToString(so.Evaluate("<SAP Value:CreateSaleOrderCheck>", null)); string check1 = "0"; if (check1 == "0") { //A saleorder can be created, if the unit belongs to "Post" launch stage if (launchstage == "PostLaunch") { //Creating instance of an object and associating values to fields EbuildService.SalesOrder.SalesOrderReqItem SalesOrderReq = new EbuildService.SalesOrder.SalesOrderReqItem(); /*Need to get value from SAP table*/ //string SalesDoctype = Convert.ToString(so.Evaluate("<SAP Value:AUART>", null)); string salesDoctype = "ZHOM"; //To get the Company code for a project.Company code is a mandadory part for creation of saleorder... var projectAndcompanyCode = (from prject in context.TEProjects join company in context.TECompanies on prject.CompanyID equals company.Uniqueid where (prject.ProjectID == projectId && prject.IsDeleted == false) select new { company.CompanyCode, prject.ProjectCode, ProjectSAPCode = prject.SapCode }).FirstOrDefault(); string projCompanyCode = projectAndcompanyCode.CompanyCode.ToString(); /*Need to get value from SAP table*/ //string DistruChanel = Convert.ToString(so.Evaluate("<SAP Value:VTWEG>", null)); string DistruChanel = "10"; //Getting the Division of the SaleOrder... string Divsion; var offerObj = (from ofr in context.TEOffers join ofrpricebkup in context.TEOfferPriceBreakUpDetails on ofr.OfferID equals ofrpricebkup.OfferID where (ofr.OfferID == offerId && ofr.IsDeleted == false) select new { ofr.OfferID, ofr.SAPOrderID, ofr.BusinesSEGMENT, ofr.SAPCustomerID, //ofrpricebkup.PriceElementname, //ofrpricebkup.PriceElementPrice, ofr.LandPrice, ofr.ConstructionPrice }).FirstOrDefault(); if (jdUnit != "JD") { if (offerObj.BusinesSEGMENT == null || offerObj.BusinesSEGMENT == "") { Divsion = "HS"; } else { Divsion = "HS"; } } else { Divsion = "CT"; } //If the Saleorder Exists,Then this call will update the saleorder... if not then creates a new SaleOrder... string SalesandDistrdoc; if (offerObj.SAPOrderID == null || offerObj.SAPOrderID == "" || offerObj.SAPOrderID == "0") { SalesandDistrdoc = string.Empty; } else { SalesandDistrdoc = offerObj.SAPOrderID; } //Sending the FugueSaleorderId... //string FugueSaleOrderID = Convert.ToString(so["SaleOrderID"]); string FugueSaleOrderID = offerObj.OfferID.ToString(); /*Need to get value from SAP table*/ //string Temnumbersddoc = Convert.ToString(so.Evaluate("<SAP Value:POSNR>", null)); string Temnumbersddoc = "10"; //Sending the SAPCustomerID,whom the SaleOrder created for... string Customer_Number = offerObj.SAPCustomerID; /*Following code is not ncessary as of now, if ncessary need to pass as follows*/ //Transfer Logic for sending the Tarnsfer-From SaleOrderId in the Creation of Transfer-To SaleOrderId string transferredSoId = string.Empty; //string dateflag = string.Empty; //if (Convert.ToBoolean(so["IsTransferredOrder"])) //{ // transferredSoId = Convert.ToString(so["TransferredOrder.SAPSaleOrderID"]); // dateflag = "tranffered"; //} //Sending the TermsheetDate... string Customerpurchaseorderdate = string.Empty; DateTime D_Date;//= DateTime.Now; var landagreement = (from doc in context.TEDocuments where (doc.KeyId == offerId && doc.IsDeleted == false && doc.Objectid == "LandAggrement") select new { doc.Uniqueid, doc.UploadedOn }).FirstOrDefault(); var Doclist = (from doc in context.TEDocuments where (doc.KeyId == offerId && doc.IsDeleted == false && doc.Objectid == "TS Signed") select new { doc.UploadedOn, doc.Uniqueid }).FirstOrDefault(); //If the Termsheet date is available take it, otherwise get it from the Transffered SaleOrder... //if (dateflag == "tranffered") //{ // if (landagreement == null) // { // D_Date = Convert.ToDateTime(so["TransferredOrder.SaleOrderDocuments.TermsheetDate"]); // D_Date = Convert.ToDateTime(TranstionOrderId.CreatedDate); // } // else // { // D_Date = AgreementDate; // } // Customerpurchaseorderdate = string.Format("{0:dd.MM.yyyy}", D_Date); // System.Diagnostics.Trace.WriteLine(String.Format("Customerpurchaseorderdate {0}", Customerpurchaseorderdate)); // System.Diagnostics.Trace.WriteLine("Termsheet Date From Transfer-from saleOrder"); //} //else //{ if (landagreement == null) { D_Date = Doclist.UploadedOn; } else { D_Date = landagreement.UploadedOn; } Customerpurchaseorderdate = string.Format("{0:dd.MM.yyyy}", D_Date); //} /*Need to get value from SAP table*/ //string Materialnumber = Convert.ToString(so.Evaluate("<SAP Value:MATNR>", null)); string Materialnumber = "HOMESALES"; //Sending the Short Text Which is currently the "ProjectCode-UnitNumber"... string Shorttextforsalesorder = projectAndcompanyCode.ProjectSAPCode + "_" + unitslist.UnitNumber; //Sending the CumulativeOrderQuantitySalesUnits. Currently the value is "1"... string CumulativeOrderQuantitySalesUnits = "1"; //sending the Plant Value. it is same as Project Code. For "Windmills of Your Mind" the value is "1000"... string Plant; if (projectAndcompanyCode.ProjectSAPCode == "0043" || projectAndcompanyCode.ProjectSAPCode == "0053") { Plant = "1000"; } else { Plant = projectAndcompanyCode.ProjectSAPCode; } //sending WorkBreakdownStructure which is currently same as Project code... string WorkBreakdownStructure = projectAndcompanyCode.ProjectSAPCode; //saledate field to be added string Doc_Date = string.Format("{0:dd.MM.yyyy}", D_Date); SalesOrderReq.AUART = salesDoctype; /*Passing Testing Values*/ SalesOrderReq.VKORG = projCompanyCode; // SalesOrderReq.VKORG = "1000"; SalesOrderReq.VTWEG = DistruChanel; SalesOrderReq.SPART = Divsion; SalesOrderReq.VBELN = SalesandDistrdoc; SalesOrderReq.POSNR = Temnumbersddoc; SalesOrderReq.KUNNR = Customer_Number; SalesOrderReq.BSTKD = transferredSoId;//Transfered from SaleOrderId... //Customer_purchase_order; SalesOrderReq.BSTDK = Customerpurchaseorderdate; SalesOrderReq.MATNR = Materialnumber; /*Passing Testing Values*/ SalesOrderReq.ARKTX = Shorttextforsalesorder; //SalesOrderReq.ARKTX = "0072-B8-N"; SalesOrderReq.KWMENG = CumulativeOrderQuantitySalesUnits; /*Passing Testing Values*/ SalesOrderReq.WERKS = Plant; // SalesOrderReq.WERKS = "0072"; /*Passing Testing Values*/ SalesOrderReq.PS_PSP_PNR = WorkBreakdownStructure; // SalesOrderReq.PS_PSP_PNR = "0072"; //SalesOrderReq.SO_URL = Insertlink; /*Need to pass Term Sheet DMS url here*/ SalesOrderReq.SO_URL = string.Empty; SalesOrderReq.DOC_DATE = Doc_Date; SalesOrderReq.REASON = string.Empty; SalesOrderReq.IHREZ = FugueSaleOrderID; //SalesOrderReq.KPOSN = ConditionItemNumber; //Creating an instance of List IList<EbuildService.SalesOrder.SalesOrderReqItemItem> SalesOrderitemList = new List<EbuildService.SalesOrder.SalesOrderReqItemItem>(); //For Normal Unit SaleOrder creation... if (jdUnit != "JD") { //Creating SOSubItems Land EbuildService.SalesOrder.SalesOrderReqItemItem subitemLand = new EbuildService.SalesOrder.SalesOrderReqItemItem(); subitemLand.KPOSN = "10"; subitemLand.KSCHL = "ZLND"; subitemLand.KBETR = Convert.ToString(offerObj.LandPrice); SalesOrderitemList.Add(subitemLand); //Creating SOSubItems Construction EbuildService.SalesOrder.SalesOrderReqItemItem subitemConst = new EbuildService.SalesOrder.SalesOrderReqItemItem(); subitemConst.KPOSN = "10"; subitemConst.KSCHL = "ZOCN"; subitemConst.KBETR = Convert.ToString(offerObj.ConstructionPrice); SalesOrderitemList.Add(subitemConst); //Creating SOSubItems Others - Transfer EbuildService.SalesOrder.SalesOrderReqItemItem subitemOther = new EbuildService.SalesOrder.SalesOrderReqItemItem(); subitemConst.KPOSN = "10"; subitemConst.KSCHL = "ZTHR"; subitemConst.KBETR = Convert.ToString(offerObj.ConstructionPrice); SalesOrderitemList.Add(subitemConst); } //For JD Unit Saleorder Creation... else { List<TaxBreakUpDetail> JdRempricebrkuplist = new List<TaxBreakUpDetail>(); JdRempricebrkuplist = (from ofrprice in context.TEOfferPriceBreakUpDetails join ofr in context.TEOffers on ofrprice.OfferID equals ofr.OfferID where (ofrprice.OfferID == offerId && ofrprice.IsDeleted == false && ofrprice.IsPD == true) select new TaxBreakUpDetail { OfferBreakUpDetailsID = ofrprice.OfferBreakUpDetailsID, OfferID = ofrprice.OfferID, OfferTitleName = ofr.OfferTitleName, OfferCustomerName = ofr.OfferCustomerName, PriceElementname = ofrprice.PriceElementname, PriceElementPrice = ofrprice.PriceElementPrice, PriceElementQuantity = ofrprice.PriceElementQuantity, PriceElementRate = ofrprice.PriceElementRate, SaleableAreaBasis = ofrprice.SaleableAreaBasis, ElementType = ofrprice.ElementType }).ToList(); foreach (var p in JdRempricebrkuplist) { if (p.PriceElementname.Contains("Home Improvement charges")) { HomeIP = p.PriceElementPrice; } if (p.PriceElementname == ("Reimbursement for Service Tax on Owner/Promoter share")) { RServiceTax = p.PriceElementPrice; } if (p.PriceElementname.Contains("Reimbursement for VAT on Owner/Promoter share")) { RVat = p.PriceElementPrice; } if (p.PriceElementname == ("Reimbursement for Swachh Bharat Cess on Owner/Promoter share")) { RSBc = p.PriceElementPrice; } if (p.PriceElementname == ("Reimbursement for Krishi Kalyan Cess on Owner/Promoter share")) { RKKc = p.PriceElementPrice; } if (p.PriceElementname == "Maintenance Fund") { MFPrice = p.PriceElementPrice; } } //Creating SOSubItems Reimbursement Service Tax EbuildService.SalesOrder.SalesOrderReqItemItem subitemReimbursementServiceTax = new EbuildService.SalesOrder.SalesOrderReqItemItem(); subitemReimbursementServiceTax.KPOSN = "10"; subitemReimbursementServiceTax.KSCHL = "ZRST"; subitemReimbursementServiceTax.KBETR = Convert.ToString(RServiceTax); SalesOrderitemList.Add(subitemReimbursementServiceTax); //Creating SOSubItems Reimbursement VAT EbuildService.SalesOrder.SalesOrderReqItemItem subitemReimbursementVAT = new EbuildService.SalesOrder.SalesOrderReqItemItem(); subitemReimbursementVAT.KPOSN = "10"; subitemReimbursementVAT.KSCHL = "ZRVT"; subitemReimbursementVAT.KBETR = Convert.ToString(RVat); SalesOrderitemList.Add(subitemReimbursementVAT); /*RSBC*/ //Creating SOSubItems Reimbursement SBC EbuildService.SalesOrder.SalesOrderReqItemItem subitemReimbursementSBC = new EbuildService.SalesOrder.SalesOrderReqItemItem(); subitemReimbursementSBC.KPOSN = "10"; subitemReimbursementSBC.KSCHL = "RSBC"; subitemReimbursementSBC.KBETR = Convert.ToString(RSBc); SalesOrderitemList.Add(subitemReimbursementSBC); /*RKKC*/ //Creating SOSubItems Reimbursement KKC EbuildService.SalesOrder.SalesOrderReqItemItem subitemReimbursementKKC = new EbuildService.SalesOrder.SalesOrderReqItemItem(); subitemReimbursementKKC.KPOSN = "10"; subitemReimbursementKKC.KSCHL = "RKKC"; subitemReimbursementKKC.KBETR = Convert.ToString(RKKc); SalesOrderitemList.Add(subitemReimbursementKKC); //this Part is commented for removal of "Reimbursement Service Tax" for the Time Being... //Creating SOSubItems Maintenance Service tax /*EbuildService.SalesOrder.SalesOrderReqItemItem subitemMaintenanceServicetax = new EbuildService.SalesOrder.SalesOrderReqItemItem(); subitemMaintenanceServicetax.KPOSN = "10"; subitemMaintenanceServicetax.KSCHL = "ZMST"; subitemMaintenanceServicetax.KBETR = "0"; System.Diagnostics.Trace.WriteLine(String.Format("subitemMaintenanceServicetax:ZMST: {0}",subitemMaintenanceServicetax.KBETR)); SalesOrderitemList.Add(subitemMaintenanceServicetax);*/ //Creating SOSubItems Home improvement EbuildService.SalesOrder.SalesOrderReqItemItem subitemHomeimprovement = new EbuildService.SalesOrder.SalesOrderReqItemItem(); subitemHomeimprovement.KPOSN = "10"; subitemHomeimprovement.KSCHL = "ZHIM"; subitemHomeimprovement.KBETR = Convert.ToString(HomeIP); SalesOrderitemList.Add(subitemHomeimprovement); //Creating SOSubItems Interest Payment EbuildService.SalesOrder.SalesOrderReqItemItem subitemInterestPayment = new EbuildService.SalesOrder.SalesOrderReqItemItem(); subitemInterestPayment.KPOSN = "10"; subitemInterestPayment.KSCHL = "ZINP"; subitemInterestPayment.KBETR = "0"; SalesOrderitemList.Add(subitemInterestPayment); //////Creating SOSubItems Delay compensation ////EbuildService.SalesOrder.SalesOrderReqItemItem subitemDelaycompensation = new EbuildService.SalesOrder.SalesOrderReqItemItem(); ////subitemDelaycompensation.KPOSN = "10"; ////subitemDelaycompensation.KSCHL = "ZDCP"; ////subitemDelaycompensation.KBETR = "0"; ////SalesOrderitemList.Add(subitemDelaycompensation); //////Creating SOSubItems Customization charge ////EbuildService.SalesOrder.SalesOrderReqItemItem subitemCustomizationcharge = new EbuildService.SalesOrder.SalesOrderReqItemItem(); ////subitemCustomizationcharge.KPOSN = "10"; ////subitemCustomizationcharge.KSCHL = "ZCUC"; ////subitemCustomizationcharge.KBETR = "0"; ////SalesOrderitemList.Add(subitemCustomizationcharge); } //Common Items For both Normal Unit and Jd Units... System.Diagnostics.Trace.WriteLine("Common Items For both Normal Unit and Jd Units"); //Creating SOSubItems Maintenance EbuildService.SalesOrder.SalesOrderReqItemItem subitemMaintenance = new EbuildService.SalesOrder.SalesOrderReqItemItem(); subitemMaintenance.KPOSN = "10"; subitemMaintenance.KSCHL = "ZMAN"; subitemMaintenance.KBETR = Convert.ToString(MFPrice); SalesOrderitemList.Add(subitemMaintenance); //Creating SOSubItems Reimbursment EbuildService.SalesOrder.SalesOrderReqItemItem subitemReimbursment = new EbuildService.SalesOrder.SalesOrderReqItemItem(); subitemReimbursment.KPOSN = "10"; subitemReimbursment.KSCHL = "ZREM"; subitemReimbursment.KBETR = "0"; SalesOrderitemList.Add(subitemReimbursment); //Creating SOSubItems Carpark Charges EbuildService.SalesOrder.SalesOrderReqItemItem subitemInterest = new EbuildService.SalesOrder.SalesOrderReqItemItem(); subitemInterest.KPOSN = "10"; subitemInterest.KSCHL = "ZCRP"; subitemInterest.KBETR = "0"; SalesOrderitemList.Add(subitemInterest); //Creating SOSubItems CostofSale EbuildService.SalesOrder.SalesOrderReqItemItem subitemCostofSale = new EbuildService.SalesOrder.SalesOrderReqItemItem(); subitemCostofSale.KPOSN = "10"; subitemCostofSale.KSCHL = "ZCOS"; subitemCostofSale.KBETR = "0"; SalesOrderitemList.Add(subitemCostofSale); //Creating SOSubItems total VAT EbuildService.SalesOrder.SalesOrderReqItemItem subitemTotalVAT = new EbuildService.SalesOrder.SalesOrderReqItemItem(); subitemTotalVAT.KPOSN = "10"; subitemTotalVAT.KSCHL = "ZVAT"; subitemTotalVAT.KBETR = "0"; SalesOrderitemList.Add(subitemTotalVAT); //Creating SOSubItems Total Service Tax EbuildService.SalesOrder.SalesOrderReqItemItem subitemTotalST = new EbuildService.SalesOrder.SalesOrderReqItemItem(); subitemTotalST.KPOSN = "10"; subitemTotalST.KSCHL = "ZSER"; subitemTotalST.KBETR = "0"; SalesOrderitemList.Add(subitemTotalST); //Creating SOSubItems Total SBC EbuildService.SalesOrder.SalesOrderReqItemItem subitemTotalSBC = new EbuildService.SalesOrder.SalesOrderReqItemItem(); subitemTotalSBC.KPOSN = "10"; subitemTotalSBC.KSCHL = "ZSBC"; subitemTotalSBC.KBETR = "0"; SalesOrderitemList.Add(subitemTotalSBC); //Creating SOSubItems Total KKC EbuildService.SalesOrder.SalesOrderReqItemItem subitemTotalKKC = new EbuildService.SalesOrder.SalesOrderReqItemItem(); subitemTotalKKC.KPOSN = "10"; subitemTotalKKC.KSCHL = "ZKKC"; subitemTotalKKC.KBETR = "0"; SalesOrderitemList.Add(subitemTotalKKC); //Creating SOSubItems Other charges EbuildService.SalesOrder.SalesOrderReqItemItem subitemOthers = new EbuildService.SalesOrder.SalesOrderReqItemItem(); subitemOthers.KPOSN = "10"; subitemOthers.KSCHL = "ZTHR"; //subitemOthers.KBETR = Convert.ToString(so["OthersPrice"]); subitemOthers.KBETR = "0";//Need to get this Other Charges time SalesOrderReq.item = SalesOrderitemList.ToArray(); IList<EbuildService.SalesOrder.SalesOrderResItem> ResponseSalesOrderList = new List<EbuildService.SalesOrder.SalesOrderResItem>(); SAPCallConnector sapCall = new SAPCallConnector(); ResponseSalesOrderList = sapCall.CreateSalesOrder(SalesOrderReq); foreach (EbuildService.SalesOrder.SalesOrderResItem item in ResponseSalesOrderList) { if (item.RET_CODE == "0") { SaleOrderID = Convert.ToString(item.SALES_DOC_NO); } else { SaleOrderID = string.Empty; if (log.IsDebugEnabled) log.Debug("Failed To Generate SAP OrderId:" + item.MESSAGE); } } } } return SaleOrderID; } //public string GenerateInvoicetoSAPandSave(int milestoneId, int LastModifiedById) public string GenerateInvoicetoTransferFee(decimal? transferFee, int? LastModifiedById, int? oldofferID, int? newofferId) { string SAPInvoiceID = string.Empty; try { string invPymntDueDays = ""; int paymentDueDays = 0; FailInfo finfo = new FailInfo(); SuccessInfo sinfo = new SuccessInfo(); var offer = (from ofr in context.TEOffers where ofr.OfferID == oldofferID && ofr.IsDeleted == false select ofr).FirstOrDefault(); if (offer == null) { sinfo.errorcode = 1; sinfo.errormessage = "Offer Details Not Found to Generate Invoice"; } var saleOrdDate = (from ofr in context.TEOffers where ofr.OfferID == oldofferID select ofr.CreatedDate).FirstOrDefault(); DateTime saleOrderDate = Convert.ToDateTime(saleOrdDate).Date; int? landCost = 0, constnCost = 0, maintnFund = 0, invoiceId = 0; landCost = offer.LandPrice; constnCost = offer.ConstructionPrice; maintnFund = offer.Consideration - (landCost + constnCost); decimal? totalTax = 0; string invApplicableEvent = string.Empty; invApplicableEvent = "ONINVOICE"; //decimal? transferFee = 0; //var tFee = (from fee in context.TETransferOrders // where fee.OldOfferID == offer.OfferID // select fee).FirstOrDefault(); //transferFee = tFee.TransferFee; List<TaxBreakUpDetails> mstnTaxBreakUpDtls = new List<TaxBreakUpDetails>(); mstnTaxBreakUpDtls = GetTaxBreakUpDetails(transferFee, "Other", offer.UnitID, saleOrderDate, invApplicableEvent); totalTax = mstnTaxBreakUpDtls.Select(t => t.TaxAmount ?? 0).Sum(); TEInvoice invoice = new TEInvoice(); invoice.ContextID = offer.OfferID; invoice.SAPCustomerID = offer.SAPCustomerID; invoice.SAPOrderID = offer.SAPOrderID; //invoice.InvoiceConsideration = transferFee; invoice.InvoiceType = "Other"; //Temporarily InVoiceStatus keeping as Invoiced invoice.InVoiceStatus = "InvoiceInProgress"; invoice.InVoicedOn = DateTime.Now; invoice.InVoicedBy = LastModifiedById; invoice.InVoiceDate = DateTime.Now; invoice.Notes = ""; invoice.TotalInvoiceAmount = transferFee + totalTax; invoice.IsPaid = false; invoice.PaidStatus = "Not Paid"; invoice.TowardsOthers = transferFee; invoice.PreparedBy = LastModifiedById; invoice.PreparedOn = DateTime.Now; invoice.LastModifiedBy_Id = LastModifiedById; invoice.LastModifiedOn = DateTime.Now; invoice.IsDeleted = false; invoiceId = new InvoiceDAL().SaveInvoice(invoice); List<TEInVoiceBreakUp> invBrkupLst = new List<TEInVoiceBreakUp>(); foreach (TaxBreakUpDetails brkp in mstnTaxBreakUpDtls) { TEInVoiceBreakUp invBrkup = new TEInVoiceBreakUp(); invBrkup.ConsiderationType = brkp.ConsiderationType; invBrkup.ConsiderationAmount = brkp.ConsiderationAmount; invBrkup.InVoiceID = invoiceId; invBrkup.TaxType = brkp.TaxType; invBrkup.TaxCode = brkp.TaxCode; invBrkup.TaxRate = brkp.TaxRate; invBrkup.SAPTaxCode = brkp.SAPTaxCode; invBrkup.TaxAmount = brkp.TaxAmount; invBrkup.IsDeleted = false; invBrkup.LastModifiedBy_Id = LastModifiedById; invBrkup.LastModifiedOn = DateTime.Now; totalTax += invBrkup.TaxAmount; invBrkupLst.Add(invBrkup); } SAPInvoiceID = PostTransferFeeInvoicetoSAP(offer, invoice, invBrkupLst); if (!string.IsNullOrEmpty(SAPInvoiceID)) { new InvoiceDAL().SaveAllInvoiceBreakup(invBrkupLst); TEInvoice invoic = new TEInvoice(); invoic = context.TEInvoices.Where(a => a.InVoiceID == invoiceId).FirstOrDefault(); invoic.TotalInvoiceAmount += totalTax; invoic.SAPInVoiceID = SAPInvoiceID; UpdateInvoice(invoic); } else { // delete the record from TEInvoice TEInvoice invoic = new TEInvoice(); invoic = context.TEInvoices.Where(a => a.InVoiceID == invoiceId).FirstOrDefault(); DeleteInvoice(invoic); sinfo.errorcode = 1; sinfo.errormessage = "Failed To Generate SAP InvoiceId"; } if (invoiceId > 0) { sinfo.errorcode = 0; sinfo.errormessage = "Invoice Saved Successfully"; } else { sinfo.errorcode = 1; sinfo.errormessage = "Failed to save Invoice"; } } catch (Exception) { throw; } return SAPInvoiceID; } public void UpdateInvoice(TEInvoice inv) { //context.TEInvoices.Add(inv); context.Entry(inv).CurrentValues.SetValues(inv); context.SaveChanges(); } public void DeleteInvoice(TEInvoice inv) { //context.TEInvoices.Add(inv); context.Entry(inv).CurrentValues.SetValues(inv); context.TEInvoices.Remove(inv); context.SaveChanges(); } public List<TaxBreakUpDetails> GetTaxBreakUpDetails(decimal? transferOrderFee, string considerationType, int? unitId, DateTime saleOderDate, string invApplicableEvent) { List<TaxBreakUpDetails> taxBreakupDtls = new List<TaxBreakUpDetails>(); List<TaxDetails> taxdetailsofr = new List<TaxDetails>(); taxdetailsofr = GetTaxDetails(unitId, saleOderDate); if (transferOrderFee > 0) { foreach (var tax in taxdetailsofr) { if (tax.ConsiderationType == "TransferOrder" && tax.TaxationInApplicable == invApplicableEvent) { TaxBreakUpDetails taxbreakup = new TaxBreakUpDetails(); taxbreakup.ConsiderationType = tax.ConsiderationType; taxbreakup.TaxType = tax.TaxType; taxbreakup.TaxCode = tax.TaxCode; taxbreakup.TaxRate = tax.TaxRate; taxbreakup.SAPTaxCode = tax.SAPTaxCode; taxbreakup.ConsiderationAmount = transferOrderFee; taxbreakup.TaxAmount = Math.Ceiling(Convert.ToDecimal((transferOrderFee * tax.TaxRate) / 100)); taxBreakupDtls.Add(taxbreakup); } } } return taxBreakupDtls; } public List<TaxDetails> GetTaxDetails(int? unitId, DateTime saleOrderDate) { List<TaxDetails> taxDtls = new List<TaxDetails>(); var unit = (from teUnit in context.TEUnits where (teUnit.UnitID == unitId && teUnit.ApprovedStatus == "Approved" && teUnit.IsDeleted == false) select teUnit).FirstOrDefault(); DateTime date = saleOrderDate; int projectId = (from towermster in context.TETowerMasters where (towermster.TowerID == unit.TowerID && towermster.IsDeleted == false) select towermster.ProjectID).FirstOrDefault(); var taxbkId = (from taxbk in context.TETaxBooks where (taxbk.TowerID == unit.TowerID && taxbk.ProjectID == projectId && taxbk.Status == "Approved" && taxbk.IsDeleted == false && taxbk.TaxationValidityFromDate <= date && taxbk.TaxationValidityToDate >= date && taxbk.SalesPeriodFromDate <= date && taxbk.SalesPeriodToDate >= date) select new { taxbk.TaxBookID, taxbk.RevisionNo }).OrderBy(a => a.RevisionNo).FirstOrDefault(); if (taxbkId != null) { taxDtls = (from te in context.TETaxElementDetails join pick1 in context.TEPickListItems on te.TaxConsiderationType equals pick1.Uniqueid join taxcode in context.TETaxCodeMasters on te.TaxType equals taxcode.TaxCodeID where (te.TaxBookID == taxbkId.TaxBookID && te.IsDeleted == false && taxcode.TaxType == "Output Tax") select new TaxDetails { TaxBookId = te.TaxBookID, ConsiderationType = pick1.Description, ConsiderationType_Id = te.TaxConsiderationType, TaxRate = taxcode.TaxRate, TaxType = taxcode.TaxType, TaxCode = taxcode.TaxCode, SAPTaxCode = taxcode.SAPTaxCode, TaxValueType = te.TaxValueType, TaxationInApplicable = te.TaxationInApplicabilityEvent, IsTaxInclusive = te.IsTaxInclusive }).ToList(); if (taxDtls.Count > 0) { for (int i = 0; i < taxDtls.Count; i++) { if (taxDtls[i].IsTaxInclusive == true) { taxDtls[i].TaxRate = 0; } } } return taxDtls; } else { return taxDtls; } } public string updateSaleOrderDetails(int? offerId) { string SaleOrderID = string.Empty; decimal? HomeIP = 0; decimal? RServiceTax = 0; decimal? RVat = 0; decimal? RSBc = 0; decimal? RKKc = 0; decimal? MFPrice = 0; var ofrdetails = context.TEOffers.Where(a => a.OfferID == offerId).FirstOrDefault(); var unitslist = (from unit in context.TEUnits join tower in context.TETowerMasters on unit.TowerID equals tower.TowerID join project in context.TEProjects on tower.ProjectID equals project.ProjectID join termsndcondition in context.TESaleTermsANDConditions on project.ProjectID equals termsndcondition.ProjectID where (unit.UnitID == ofrdetails.UnitID && unit.ApprovedStatus == "Approved" && unit.IsDeleted==false) select new { unit.TowerID, unit.OwnerShipType, unit.UnitNumber, unit.SoldDate, tower.LaunchStatus, termsndcondition.LaunchType }).FirstOrDefault(); //Getting the values for "LaunchStage","LaunchType", and "JDUnit"... string launchtype = unitslist.LaunchType; string launchstage = unitslist.LaunchStatus; string jdUnit = unitslist.OwnerShipType; /*Need to get value from SAP table*/ //string check1 = Convert.ToString(so.Evaluate("<SAP Value:CreateSaleOrderCheck>", null)); string check1 = "0"; if (check1 == "0") { //A saleorder can be created, if the unit belongs to "Post" launch stage if (launchstage == "PostLaunch") { //Creating instance of an object and associating values to fields EbuildService.SalesOrder.SalesOrderReqItem SalesOrderReq = new EbuildService.SalesOrder.SalesOrderReqItem(); /*Need to get value from SAP table*/ //string SalesDoctype = Convert.ToString(so.Evaluate("<SAP Value:AUART>", null)); string salesDoctype = "ZHOM"; //To get the Company code for a project.Company code is a mandadory part for creation of saleorder... var projectAndcompanyCode = (from prject in context.TEProjects join company in context.TECompanies on prject.CompanyID equals company.Uniqueid where (prject.ProjectID == ofrdetails.ProjectID && prject.IsDeleted == false) select new { company.CompanyCode, prject.ProjectCode, ProjectSAPCode = prject.SapCode }).FirstOrDefault(); string projCompanyCode = projectAndcompanyCode.CompanyCode.ToString(); /*Need to get value from SAP table*/ //string DistruChanel = Convert.ToString(so.Evaluate("<SAP Value:VTWEG>", null)); string DistruChanel = "10"; //Getting the Division of the SaleOrder... string Divsion; var offerObj = (from ofr in context.TEOffers join ofrpricebkup in context.TEOfferPriceBreakUpDetails on ofr.OfferID equals ofrpricebkup.OfferID where (ofr.OfferID == offerId && ofr.IsDeleted == false) select new { ofr.OfferID, ofr.SAPOrderID, ofr.BusinesSEGMENT, ofr.SAPCustomerID, //ofrpricebkup.PriceElementname, //ofrpricebkup.PriceElementPrice, ofr.LandPrice, ofr.ConstructionPrice }).FirstOrDefault(); if (jdUnit != "JD") { if (offerObj.BusinesSEGMENT == null || offerObj.BusinesSEGMENT == "") { Divsion = "HS"; } else { Divsion = "HS"; } } else { Divsion = "CT"; } //If the Saleorder Exists,Then this call will update the saleorder... if not then creates a new SaleOrder... string SalesandDistrdoc; if (offerObj.SAPOrderID == null || offerObj.SAPOrderID == "" || offerObj.SAPOrderID == "0") { SalesandDistrdoc = string.Empty; } else { SalesandDistrdoc = offerObj.SAPOrderID; } //Sending the FugueSaleorderId... //string FugueSaleOrderID = Convert.ToString(so["SaleOrderID"]); string FugueSaleOrderID = offerObj.OfferID.ToString(); /*Need to get value from SAP table*/ //string Temnumbersddoc = Convert.ToString(so.Evaluate("<SAP Value:POSNR>", null)); string Temnumbersddoc = "10"; //Sending the SAPCustomerID,whom the SaleOrder created for... string Customer_Number = offerObj.SAPCustomerID; /*Following code is not ncessary as of now, if ncessary need to pass as follows*/ //Transfer Logic for sending the Tarnsfer-From SaleOrderId in the Creation of Transfer-To SaleOrderId string transferredSoId = string.Empty; //string dateflag = string.Empty; //if (Convert.ToBoolean(so["IsTransferredOrder"])) //{ // transferredSoId = Convert.ToString(so["TransferredOrder.SAPSaleOrderID"]); // dateflag = "tranffered"; //} //Sending the TermsheetDate... string Customerpurchaseorderdate = string.Empty; DateTime? D_Date;//= DateTime.Now; var landagreement = (from doc in context.TEDMSDocuments where (doc.KeyID == offerId && doc.IsDeleted == false && doc.DocumentType == "LandAggrement") select new { doc.UniqueID, doc.UploadedOn }).FirstOrDefault(); var Doclist = (from doc in context.TEDMSDocuments where (doc.KeyID == offerId && doc.IsDeleted == false && doc.DocumentType == "SignedTermSheet") select new { doc.UploadedOn, doc.UniqueID }).FirstOrDefault(); //If the Termsheet date is available take it, otherwise get it from the Transffered SaleOrder... //if (dateflag == "tranffered") //{ // if (landagreement == null) // { // D_Date = Convert.ToDateTime(so["TransferredOrder.SaleOrderDocuments.TermsheetDate"]); // D_Date = Convert.ToDateTime(TranstionOrderId.CreatedDate); // } // else // { // D_Date = AgreementDate; // } // Customerpurchaseorderdate = string.Format("{0:dd.MM.yyyy}", D_Date); // System.Diagnostics.Trace.WriteLine(String.Format("Customerpurchaseorderdate {0}", Customerpurchaseorderdate)); // System.Diagnostics.Trace.WriteLine("Termsheet Date From Transfer-from saleOrder"); //} //else //{ if (landagreement == null) { D_Date = Doclist.UploadedOn; } else { D_Date = landagreement.UploadedOn; } Customerpurchaseorderdate = string.Format("{0:dd.MM.yyyy}", D_Date); //} /*Need to get value from SAP table*/ //string Materialnumber = Convert.ToString(so.Evaluate("<SAP Value:MATNR>", null)); string Materialnumber = "HOMESALES"; //Sending the Short Text Which is currently the "ProjectCode-UnitNumber"... string Shorttextforsalesorder = projectAndcompanyCode.ProjectSAPCode + "_" + unitslist.UnitNumber; //Sending the CumulativeOrderQuantitySalesUnits. Currently the value is "1"... string CumulativeOrderQuantitySalesUnits = "1"; //sending the Plant Value. it is same as Project Code. For "Windmills of Your Mind" the value is "1000"... string Plant; if (projectAndcompanyCode.ProjectSAPCode == "0043" || projectAndcompanyCode.ProjectSAPCode == "0053") { Plant = "1000"; } else { Plant = projectAndcompanyCode.ProjectSAPCode; } //sending WorkBreakdownStructure which is currently same as Project code... string WorkBreakdownStructure = projectAndcompanyCode.ProjectSAPCode; //saledate field to be added string Doc_Date = string.Format("{0:dd.MM.yyyy}", D_Date); SalesOrderReq.AUART = salesDoctype; /*Passing Testing Values*/ SalesOrderReq.VKORG = projCompanyCode; // SalesOrderReq.VKORG = "1000"; SalesOrderReq.VTWEG = DistruChanel; SalesOrderReq.SPART = Divsion; SalesOrderReq.VBELN = SalesandDistrdoc; SalesOrderReq.POSNR = Temnumbersddoc; SalesOrderReq.KUNNR = Customer_Number; SalesOrderReq.BSTKD = transferredSoId;//Transfered from SaleOrderId... //Customer_purchase_order; SalesOrderReq.BSTDK = Customerpurchaseorderdate; SalesOrderReq.MATNR = Materialnumber; /*Passing Testing Values*/ SalesOrderReq.ARKTX = Shorttextforsalesorder; //SalesOrderReq.ARKTX = "0072-B8-N"; SalesOrderReq.KWMENG = CumulativeOrderQuantitySalesUnits; /*Passing Testing Values*/ SalesOrderReq.WERKS = Plant; // SalesOrderReq.WERKS = "0072"; /*Passing Testing Values*/ SalesOrderReq.PS_PSP_PNR = WorkBreakdownStructure; // SalesOrderReq.PS_PSP_PNR = "0072"; //SalesOrderReq.SO_URL = Insertlink; /*Need to pass Term Sheet DMS url here*/ SalesOrderReq.SO_URL = string.Empty; SalesOrderReq.DOC_DATE = Doc_Date; SalesOrderReq.REASON = string.Empty; SalesOrderReq.IHREZ = FugueSaleOrderID; //SalesOrderReq.KPOSN = ConditionItemNumber; //Creating an instance of List IList<EbuildService.SalesOrder.SalesOrderReqItemItem> SalesOrderitemList = new List<EbuildService.SalesOrder.SalesOrderReqItemItem>(); //For Normal Unit SaleOrder creation... if (jdUnit != "JD") { //Creating SOSubItems Land EbuildService.SalesOrder.SalesOrderReqItemItem subitemLand = new EbuildService.SalesOrder.SalesOrderReqItemItem(); subitemLand.KPOSN = "10"; subitemLand.KSCHL = "ZLND"; subitemLand.KBETR = Convert.ToString(offerObj.LandPrice); SalesOrderitemList.Add(subitemLand); //Creating SOSubItems Construction EbuildService.SalesOrder.SalesOrderReqItemItem subitemConst = new EbuildService.SalesOrder.SalesOrderReqItemItem(); subitemConst.KPOSN = "10"; subitemConst.KSCHL = "ZOCN"; subitemConst.KBETR = Convert.ToString(offerObj.ConstructionPrice); SalesOrderitemList.Add(subitemConst); } //For JD Unit Saleorder Creation... else { List<TaxBreakUpDetail> JdRempricebrkuplist = new List<TaxBreakUpDetail>(); JdRempricebrkuplist = (from ofrprice in context.TEOfferPriceBreakUpDetails join ofr in context.TEOffers on ofrprice.OfferID equals ofr.OfferID where (ofrprice.OfferID == offerId && ofrprice.IsDeleted == false && ofrprice.IsPD == true) select new TaxBreakUpDetail { OfferBreakUpDetailsID = ofrprice.OfferBreakUpDetailsID, OfferID = ofrprice.OfferID, OfferTitleName = ofr.OfferTitleName, OfferCustomerName = ofr.OfferCustomerName, PriceElementname = ofrprice.PriceElementname, PriceElementPrice = ofrprice.PriceElementPrice, PriceElementQuantity = ofrprice.PriceElementQuantity, PriceElementRate = ofrprice.PriceElementRate, SaleableAreaBasis = ofrprice.SaleableAreaBasis, ElementType = ofrprice.ElementType }).ToList(); foreach (var p in JdRempricebrkuplist) { if (p.PriceElementname.Contains("Home Improvement charges")) { HomeIP = p.PriceElementPrice; } if (p.PriceElementname == ("Reimbursement for Service Tax on Owner/Promoter share")) { RServiceTax = p.PriceElementPrice; } if (p.PriceElementname.Contains("Reimbursement for VAT on Owner/Promoter share")) { RVat = p.PriceElementPrice; } if (p.PriceElementname == ("Reimbursement for Swachh Bharat Cess on Owner/Promoter share")) { RSBc = p.PriceElementPrice; } if (p.PriceElementname == ("Reimbursement for Krishi Kalyan Cess on Owner/Promoter share")) { RKKc = p.PriceElementPrice; } if (p.PriceElementname == "Maintenance Fund") { MFPrice = p.PriceElementPrice; } } //Creating SOSubItems Reimbursement Service Tax EbuildService.SalesOrder.SalesOrderReqItemItem subitemReimbursementServiceTax = new EbuildService.SalesOrder.SalesOrderReqItemItem(); subitemReimbursementServiceTax.KPOSN = "10"; subitemReimbursementServiceTax.KSCHL = "ZRST"; subitemReimbursementServiceTax.KBETR = Convert.ToString(RServiceTax); SalesOrderitemList.Add(subitemReimbursementServiceTax); //Creating SOSubItems Reimbursement VAT EbuildService.SalesOrder.SalesOrderReqItemItem subitemReimbursementVAT = new EbuildService.SalesOrder.SalesOrderReqItemItem(); subitemReimbursementVAT.KPOSN = "10"; subitemReimbursementVAT.KSCHL = "ZRVT"; subitemReimbursementVAT.KBETR = Convert.ToString(RVat); SalesOrderitemList.Add(subitemReimbursementVAT); /*RSBC*/ //Creating SOSubItems Reimbursement SBC EbuildService.SalesOrder.SalesOrderReqItemItem subitemReimbursementSBC = new EbuildService.SalesOrder.SalesOrderReqItemItem(); subitemReimbursementSBC.KPOSN = "10"; subitemReimbursementSBC.KSCHL = "RSBC"; subitemReimbursementSBC.KBETR = Convert.ToString(RSBc); SalesOrderitemList.Add(subitemReimbursementSBC); /*RKKC*/ //Creating SOSubItems Reimbursement KKC EbuildService.SalesOrder.SalesOrderReqItemItem subitemReimbursementKKC = new EbuildService.SalesOrder.SalesOrderReqItemItem(); subitemReimbursementKKC.KPOSN = "10"; subitemReimbursementKKC.KSCHL = "RKKC"; subitemReimbursementKKC.KBETR = Convert.ToString(RKKc); SalesOrderitemList.Add(subitemReimbursementKKC); //this Part is commented for removal of "Reimbursement Service Tax" for the Time Being... //Creating SOSubItems Maintenance Service tax /*EbuildService.SalesOrder.SalesOrderReqItemItem subitemMaintenanceServicetax = new EbuildService.SalesOrder.SalesOrderReqItemItem(); subitemMaintenanceServicetax.KPOSN = "10"; subitemMaintenanceServicetax.KSCHL = "ZMST"; subitemMaintenanceServicetax.KBETR = "0"; System.Diagnostics.Trace.WriteLine(String.Format("subitemMaintenanceServicetax:ZMST: {0}",subitemMaintenanceServicetax.KBETR)); SalesOrderitemList.Add(subitemMaintenanceServicetax);*/ //Creating SOSubItems Home improvement EbuildService.SalesOrder.SalesOrderReqItemItem subitemHomeimprovement = new EbuildService.SalesOrder.SalesOrderReqItemItem(); subitemHomeimprovement.KPOSN = "10"; subitemHomeimprovement.KSCHL = "ZHIM"; subitemHomeimprovement.KBETR = Convert.ToString(HomeIP); SalesOrderitemList.Add(subitemHomeimprovement); //Creating SOSubItems Interest Payment EbuildService.SalesOrder.SalesOrderReqItemItem subitemInterestPayment = new EbuildService.SalesOrder.SalesOrderReqItemItem(); subitemInterestPayment.KPOSN = "10"; subitemInterestPayment.KSCHL = "ZINP"; subitemInterestPayment.KBETR = "0"; SalesOrderitemList.Add(subitemInterestPayment); //Creating SOSubItems Delay compensation EbuildService.SalesOrder.SalesOrderReqItemItem subitemDelaycompensation = new EbuildService.SalesOrder.SalesOrderReqItemItem(); subitemDelaycompensation.KPOSN = "10"; subitemDelaycompensation.KSCHL = "ZDCP"; subitemDelaycompensation.KBETR = "0"; SalesOrderitemList.Add(subitemDelaycompensation); //Creating SOSubItems Customization charge EbuildService.SalesOrder.SalesOrderReqItemItem subitemCustomizationcharge = new EbuildService.SalesOrder.SalesOrderReqItemItem(); subitemCustomizationcharge.KPOSN = "10"; subitemCustomizationcharge.KSCHL = "ZCUC"; subitemCustomizationcharge.KBETR = "0"; SalesOrderitemList.Add(subitemCustomizationcharge); } //Common Items For both Normal Unit and Jd Units... System.Diagnostics.Trace.WriteLine("Common Items For both Normal Unit and Jd Units"); //Creating SOSubItems Maintenance EbuildService.SalesOrder.SalesOrderReqItemItem subitemMaintenance = new EbuildService.SalesOrder.SalesOrderReqItemItem(); subitemMaintenance.KPOSN = "10"; subitemMaintenance.KSCHL = "ZMAN"; subitemMaintenance.KBETR = Convert.ToString(MFPrice); SalesOrderitemList.Add(subitemMaintenance); //Creating SOSubItems Reimbursment EbuildService.SalesOrder.SalesOrderReqItemItem subitemReimbursment = new EbuildService.SalesOrder.SalesOrderReqItemItem(); subitemReimbursment.KPOSN = "10"; subitemReimbursment.KSCHL = "ZREM"; subitemReimbursment.KBETR = "0"; SalesOrderitemList.Add(subitemReimbursment); //Creating SOSubItems Carpark Charges EbuildService.SalesOrder.SalesOrderReqItemItem subitemInterest = new EbuildService.SalesOrder.SalesOrderReqItemItem(); subitemInterest.KPOSN = "10"; subitemInterest.KSCHL = "ZCRP"; subitemInterest.KBETR = "0"; SalesOrderitemList.Add(subitemInterest); //Creating SOSubItems CostofSale EbuildService.SalesOrder.SalesOrderReqItemItem subitemCostofSale = new EbuildService.SalesOrder.SalesOrderReqItemItem(); subitemCostofSale.KPOSN = "10"; subitemCostofSale.KSCHL = "ZCOS"; subitemCostofSale.KBETR = "0"; SalesOrderitemList.Add(subitemCostofSale); //Creating SOSubItems total VAT EbuildService.SalesOrder.SalesOrderReqItemItem subitemTotalVAT = new EbuildService.SalesOrder.SalesOrderReqItemItem(); subitemTotalVAT.KPOSN = "10"; subitemTotalVAT.KSCHL = "ZVAT"; subitemTotalVAT.KBETR = "0"; SalesOrderitemList.Add(subitemTotalVAT); //Creating SOSubItems Total Service Tax EbuildService.SalesOrder.SalesOrderReqItemItem subitemTotalST = new EbuildService.SalesOrder.SalesOrderReqItemItem(); subitemTotalST.KPOSN = "10"; subitemTotalST.KSCHL = "ZSER"; subitemTotalST.KBETR = "0"; SalesOrderitemList.Add(subitemTotalST); //Creating SOSubItems Total SBC EbuildService.SalesOrder.SalesOrderReqItemItem subitemTotalSBC = new EbuildService.SalesOrder.SalesOrderReqItemItem(); subitemTotalSBC.KPOSN = "10"; subitemTotalSBC.KSCHL = "ZSBC"; subitemTotalSBC.KBETR = "0"; SalesOrderitemList.Add(subitemTotalSBC); //Creating SOSubItems Total KKC EbuildService.SalesOrder.SalesOrderReqItemItem subitemTotalKKC = new EbuildService.SalesOrder.SalesOrderReqItemItem(); subitemTotalKKC.KPOSN = "10"; subitemTotalKKC.KSCHL = "ZKKC"; subitemTotalKKC.KBETR = "0"; SalesOrderitemList.Add(subitemTotalKKC); //Creating SOSubItems Other charges EbuildService.SalesOrder.SalesOrderReqItemItem subitemOthers = new EbuildService.SalesOrder.SalesOrderReqItemItem(); subitemOthers.KPOSN = "10"; subitemOthers.KSCHL = "ZTHR"; //subitemOthers.KBETR = Convert.ToString(so["OthersPrice"]); subitemOthers.KBETR = "0";//Need to get this Other Charges time SalesOrderReq.item = SalesOrderitemList.ToArray(); IList<EbuildService.SalesOrder.SalesOrderResItem> ResponseSalesOrderList = new List<EbuildService.SalesOrder.SalesOrderResItem>(); SAPCallConnector sapCall = new SAPCallConnector(); ResponseSalesOrderList = sapCall.CreateSalesOrder(SalesOrderReq); foreach (EbuildService.SalesOrder.SalesOrderResItem item in ResponseSalesOrderList) { if (item.RET_CODE == "0") { SaleOrderID = Convert.ToString(item.SALES_DOC_NO); } else { SaleOrderID = string.Empty; if (log.IsDebugEnabled) log.Debug("Failed To Generate SAP OrderId:" + item.MESSAGE); } } } } return SaleOrderID; } } }
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; using ServiceQuotes.Domain.Entities; namespace ServiceQuotes.Infrastructure.Context.EntityConfigurations { public class QuoteEntityConfiguration : IEntityTypeConfiguration<Quote> { public void Configure(EntityTypeBuilder<Quote> builder) { builder.HasKey(quote => quote.Id); builder.Property(quote => quote.Id).ValueGeneratedOnAdd().IsRequired(); builder.Property(quote => quote.ReferenceNumber).ValueGeneratedOnAdd().IsRequired(); builder.Property(quote => quote.Total).HasPrecision(7, 2).IsRequired(); builder.Property(quote => quote.Created).HasDefaultValueSql("NOW()").IsRequired(); builder.HasOne(quote => quote.ServiceRequest).WithOne().HasForeignKey<Quote>("ServiceRequestId").IsRequired(); builder.HasIndex(quote => quote.ReferenceNumber).IsUnique(); } } }
using System; using KesselRun.SeleniumCore.Enums; using KesselRun.SeleniumCore.Exceptions; using KesselRun.SeleniumCore.Infrastructure; using KesselRun.SeleniumCore.TestDrivers.Contracts; using OpenQA.Selenium; using OpenQA.Selenium.Support.UI; using OpenQA.Selenium.Interactions; namespace KesselRun.SeleniumCore.TestDrivers { public abstract class BaseTestDriver : ITestDriver { public const int DefaultWebDriverWait = 15; public const string HttpPrefix = @"http://"; public const string HttpSslPrefix = @"https://"; public string DefaultUrl { get; set; } public IWebDriver WebDriver { get; protected set; } protected virtual IWebElement ClickWebElement( string domElement, int? seconds, IWebElement element, FinderStrategy finderStrategy) { if (!ReferenceEquals(null, element)) { element.Click(); return element; } throw new ElementWasNullException(finderStrategy, domElement, seconds); } public virtual string GetDocumentTitle() { return WebDriver.Title; } public virtual void GoToUrl(string url) { INavigation navigation = WebDriver.Navigate(); if (string.IsNullOrEmpty(url)) { url = DefaultUrl; } if (!url.StartsWith(HttpPrefix) && !url.StartsWith(HttpSslPrefix)) { // Assume not SSL if dev to lazy to type in "https://" url = string.Concat(HttpPrefix, url); } navigation.GoToUrl(url); } public virtual bool ElementContainsText(FinderStrategy findBy, string domElement, string text) { var element = GetWebElementByFinderStrategy(findBy, domElement); return !ReferenceEquals(null, element) && (element.Text.Contains(text)); } public virtual IWebElement FindByClassName( string className, ExpectedCondition expectedCondition = ExpectedCondition.ElementIsVisible, int? seconds = null) { Func<IWebDriver, IWebElement> webelementFunc = GetWebelementFunc(By.ClassName(className), expectedCondition); return FindWebElement(By.ClassName(className), seconds, webelementFunc); } public virtual IWebElement FindByClassNameClick( string className, ExpectedCondition expectedCondition = ExpectedCondition.ElementIsVisible, int? seconds = null) { IWebElement element = FindByClassName(className, expectedCondition, seconds); return ClickWebElement(className, seconds, element, FinderStrategy.ClassName); } public virtual IWebElement FindByClassNameFromWebElement(IWebElement webElement, string domElement, int? seconds = null) { Func<IWebDriver, IWebElement> webelementFromWebElementFunc = GetWebelementFromWebElementFunc(By.ClassName(domElement), webElement); return FindWebElementFromWebElement(By.ClassName(domElement), seconds, webElement, webelementFromWebElementFunc); } public virtual IWebElement FindByClassNameFromWebElementClick(IWebElement webElement, string domElement, int? seconds = null) { IWebElement element = FindByClassNameFromWebElement(webElement, domElement, seconds); return ClickWebElement(domElement, seconds, element, FinderStrategy.ClassName); } public virtual IWebElement FindByCssSelector( string cssSelector, ExpectedCondition expectedCondition = ExpectedCondition.ElementIsVisible, int? seconds = null) { Func<IWebDriver, IWebElement> getWebelementFunc = GetWebelementFunc(By.CssSelector(cssSelector), expectedCondition); return FindWebElement(By.CssSelector(cssSelector), seconds, getWebelementFunc); } public virtual IWebElement FindByCssSelectorClick( string cssSelector, ExpectedCondition expectedCondition = ExpectedCondition.ElementIsVisible, int? seconds = null) { IWebElement element = FindByCssSelector(cssSelector, expectedCondition, seconds); return ClickWebElement(cssSelector, seconds, element, FinderStrategy.Css); } public virtual IWebElement FindByCssSelectorFromWebElement(IWebElement webElement, string domElement, int? seconds = null) { Func<IWebDriver, IWebElement> webelementFromWebElementFunc = GetWebelementFromWebElementFunc(By.CssSelector(domElement), webElement); return FindWebElementFromWebElement(By.CssSelector(domElement), seconds, webElement, webelementFromWebElementFunc); } public virtual IWebElement FindByCssSelectorFromWebElementClick(IWebElement webElement, string domElement, int? seconds = null) { IWebElement element = FindByCssSelectorFromWebElement(webElement, domElement, seconds); return ClickWebElement(domElement, seconds, element, FinderStrategy.Css); } public virtual IWebElement FindById( string domElement, ExpectedCondition expectedCondition = ExpectedCondition.ElementIsVisible, int? seconds = null) { Func<IWebDriver, IWebElement> getWebelementFunc = GetWebelementFunc(By.Id(domElement), expectedCondition); return FindWebElement(By.Id(domElement), seconds, getWebelementFunc); } public virtual IWebElement FindByIdClick( string domElement, ExpectedCondition expectedCondition = ExpectedCondition.ElementIsVisible, int? seconds = null) { IWebElement element = FindById(domElement, expectedCondition, seconds); return ClickWebElement(domElement, seconds, element, FinderStrategy.Id); } public virtual IWebElement FindByIdFromWebElement(IWebElement webElement, string domElement, int? seconds = null) { Func<IWebDriver, IWebElement> webelementFromWebElementFunc = GetWebelementFromWebElementFunc(By.Id(domElement), webElement); return FindWebElementFromWebElement(By.Id(domElement), seconds, webElement, webelementFromWebElementFunc); } public virtual IWebElement FindByIdFromWebElementClick(IWebElement webElement, string domElement, int? seconds = null) { IWebElement element = FindByIdFromWebElement(webElement, domElement, seconds); return ClickWebElement(domElement, seconds, element, FinderStrategy.Id); } public virtual IWebElement FindByLink( string domElement, ExpectedCondition expectedCondition = ExpectedCondition.ElementIsVisible, int? seconds = null) { Func<IWebDriver, IWebElement> getWebelementFunc = GetWebelementFunc(By.LinkText(domElement), expectedCondition); return FindWebElement(By.LinkText(domElement), seconds, getWebelementFunc); } public virtual IWebElement FindByLinkClick( string domElement, ExpectedCondition expectedCondition = ExpectedCondition.ElementIsVisible, int? seconds = null) { IWebElement element = FindByLink(domElement, expectedCondition, seconds); return ClickWebElement(domElement, seconds, element, FinderStrategy.LinkText); } public virtual IWebElement FindByLinkFromWebElement(IWebElement webElement, string domElement, int? seconds = null) { Func<IWebDriver, IWebElement> webelementFromWebElementFunc = GetWebelementFromWebElementFunc(By.LinkText(domElement), webElement); return FindWebElementFromWebElement(By.LinkText(domElement), seconds, webElement, webelementFromWebElementFunc); } public virtual IWebElement FindByLinkFromWebElementClick(IWebElement webElement, string domElement, int? seconds = null) { IWebElement element = FindByLinkFromWebElement(webElement, domElement, seconds); return ClickWebElement(domElement, seconds, element, FinderStrategy.LinkText); } public virtual IWebElement FindByName( string domElement, ExpectedCondition expectedCondition = ExpectedCondition.ElementIsVisible, int? seconds = null) { Func<IWebDriver, IWebElement> getWebelementFunc = GetWebelementFunc(By.Name(domElement), expectedCondition); return FindWebElement(By.Name(domElement), seconds, getWebelementFunc); } public virtual IWebElement FindByNameClick( string domElement, ExpectedCondition expectedCondition = ExpectedCondition.ElementIsVisible, int? seconds = null) { IWebElement element = FindByName(domElement, expectedCondition, seconds); return ClickWebElement(domElement, seconds, element, FinderStrategy.Name); } public virtual IWebElement FindByNameFromWebElement(IWebElement webElement, string domElement, int? seconds = null) { Func<IWebDriver, IWebElement> webelementFromWebElementFunc = GetWebelementFromWebElementFunc(By.Name(domElement), webElement); return FindWebElementFromWebElement(By.Name(domElement), seconds, webElement, webelementFromWebElementFunc); } public virtual IWebElement FindByNameFromWebElementClick(IWebElement webElement, string domElement, int? seconds = null) { IWebElement element = FindByNameFromWebElement(webElement, domElement, seconds); return ClickWebElement(domElement, seconds, element, FinderStrategy.Name); } public virtual IWebElement FindByPartialLinkText( string domElement, ExpectedCondition expectedCondition = ExpectedCondition.ElementIsVisible, int? seconds = null) { Func<IWebDriver, IWebElement> getWebelementFunc = GetWebelementFunc(By.PartialLinkText(domElement), expectedCondition); return FindWebElement(By.PartialLinkText(domElement), seconds, getWebelementFunc); } public virtual IWebElement FindByPartialLinkTextClick( string domElement, ExpectedCondition expectedCondition = ExpectedCondition.ElementIsVisible, int? seconds = null) { IWebElement element = FindByPartialLinkText(domElement, expectedCondition, seconds); return ClickWebElement(domElement, seconds, element, FinderStrategy.PartialLinkText); } public virtual IWebElement FindByPartialLinkTextFromWebElement(IWebElement webElement, string domElement, int? seconds = null) { Func<IWebDriver, IWebElement> webelementFromWebElementFunc = GetWebelementFromWebElementFunc(By.PartialLinkText(domElement), webElement); return FindWebElementFromWebElement(By.PartialLinkText(domElement), seconds, webElement, webelementFromWebElementFunc); } public virtual IWebElement FindByPartialLinkTextFromWebElementClick(IWebElement webElement, string domElement, int? seconds = null) { IWebElement element = FindByPartialLinkTextFromWebElement(webElement, domElement, seconds); return ClickWebElement(domElement, seconds, element, FinderStrategy.PartialLinkText); } public virtual IWebElement FindByTagName( string domElement, ExpectedCondition expectedCondition = ExpectedCondition.ElementIsVisible, int? seconds = null) { Func<IWebDriver, IWebElement> getWebelementFunc = GetWebelementFunc(By.TagName(domElement), expectedCondition); return FindWebElement(By.TagName(domElement), seconds, getWebelementFunc); } public virtual IWebElement FindByTagNameClick( string domElement, ExpectedCondition expectedCondition = ExpectedCondition.ElementIsVisible, int? seconds = null) { IWebElement element = FindByTagName(domElement, expectedCondition, seconds); return ClickWebElement(domElement, seconds, element, FinderStrategy.TagName); } public virtual IWebElement FindByTagNameFromWebElement(IWebElement webElement, string domElement, int? seconds = null) { Func<IWebDriver, IWebElement> webelementFromWebElementFunc = GetWebelementFromWebElementFunc(By.TagName(domElement), webElement); return FindWebElementFromWebElement(By.TagName(domElement), seconds, webElement, webelementFromWebElementFunc); } public virtual IWebElement FindByTagNameFromWebElementClick(IWebElement webElement, string domElement, int? seconds = null) { IWebElement element = FindByTagNameFromWebElement(webElement, domElement, seconds); return ClickWebElement(domElement, seconds, element, FinderStrategy.TagName); } public virtual IWebElement FindByXPath( string domElement, ExpectedCondition expectedCondition = ExpectedCondition.ElementIsVisible, int? seconds = null) { Func<IWebDriver, IWebElement> getWebelementFunc = GetWebelementFunc(By.XPath(domElement), expectedCondition); return FindWebElement(By.XPath(domElement), seconds, getWebelementFunc); } public virtual IWebElement FindByXPathClick( string domElement, ExpectedCondition expectedCondition = ExpectedCondition.ElementIsVisible, int? seconds = null) { IWebElement element = FindByXPath(domElement, expectedCondition, seconds); return ClickWebElement(domElement, seconds, element, FinderStrategy.XPath); } public virtual IWebElement FindByXPathFromWebElement(IWebElement webElement, string domElement, int? seconds = null) { Func<IWebDriver, IWebElement> webelementFromWebElementFunc = GetWebelementFromWebElementFunc(By.XPath(domElement), webElement); return FindWebElementFromWebElement(By.XPath(domElement), seconds, webElement, webelementFromWebElementFunc); } public virtual IWebElement FindByXPathFromWebElementClick(IWebElement webElement, string domElement, int? seconds = null) { IWebElement element = FindByXPathFromWebElement(webElement, domElement, seconds); return ClickWebElement(domElement, seconds, element, FinderStrategy.XPath); } private IWebElement FindWebElement(By findBy, int? seconds, Func<IWebDriver, IWebElement> expectedFunc) { return seconds.HasValue ? FindWithWait(seconds.Value, expectedFunc) : WebDriver.FindElement(findBy); } private IWebElement FindWebElementFromWebElement(By findBy, int? seconds, IWebElement webElement, Func<IWebDriver, IWebElement> expectedFunc) { return seconds.HasValue ? FindWithWait(seconds.Value, expectedFunc) : webElement.FindElement(findBy); } public abstract void Initialize(DriverOptions driverOptions); public virtual void MouseOverElement(FinderStrategy findBy, string domElement, string script = null) { var element = GetWebElementByFinderStrategy(findBy, domElement); HoverOverElement(element); } public void Quit() { WebDriver.Quit(); } public virtual IWebElement TypeText(IWebElement webElement, string text) { if (ReferenceEquals(webElement ,null)) return null; webElement.Clear(); webElement.SendKeys(text); return webElement; } public virtual IWebElement TypeText(FinderStrategy findBy, string domElement, string text) { if (string.IsNullOrWhiteSpace(domElement)) throw new ArgumentNullException("domElement"); IWebElement element = GetWebElementByFinderStrategy(findBy, domElement); return TypeText(element, text); } public virtual IWebElement TypeText(FinderStrategy findBy, string domElement, string text, InputGesture inputGesture) { IWebElement element = TypeText(findBy, domElement, text); if (ReferenceEquals(element, null)) return element; if ((inputGesture & InputGesture.Enter) == InputGesture.Enter) element.SendKeys(Keys.Enter); if ((inputGesture & InputGesture.Tab) == InputGesture.Tab) element.SendKeys(Keys.Tab); return element; } protected virtual void TurnOnImplicitWait(int? wait = null) { WebDriver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(wait ?? DefaultWebDriverWait)); } protected virtual void TurnOnScriptWait(int? wait = null) { WebDriver.Manage().Timeouts().SetScriptTimeout(TimeSpan.FromSeconds(wait ?? DefaultWebDriverWait)); } private IWebElement FindWithWait(int seconds, Func<IWebDriver, IWebElement> expectedFunc) { var wait = new WebDriverWait(WebDriver, TimeSpan.FromSeconds(seconds)); return wait.Until(expectedFunc); } private static Func<IWebDriver, IWebElement> GetWebelementFunc(By locator, ExpectedCondition expectedCondition) { Func<IWebDriver, IWebElement> getWebelementFunc; switch (expectedCondition) { case ExpectedCondition.ElementExists: getWebelementFunc = ExpectedConditions.ElementExists(locator); break; case ExpectedCondition.ElementIsVisible: getWebelementFunc = ExpectedConditions.ElementIsVisible(locator); break; default: throw new NotSupportedException( string.Format( "This method {0} does not support the selected option of the enum {1}. Please select either {2} or {3}", "FindByClassName", expectedCondition, "ElementExists", "ElementIsVisible" )); } return getWebelementFunc; } private static Func<IWebDriver, IWebElement> GetWebelementFromWebElementFunc(By locator, IWebElement webElement) { return webdriver => webElement.FindElement(locator); } private IWebElement GetWebElementByFinderStrategy(FinderStrategy findBy, string domElement) { IWebElement element; switch (findBy) { case FinderStrategy.Id: element = FindById(domElement); break; case FinderStrategy.Name: element = FindByName(domElement); break; case FinderStrategy.Css: element = FindByCssSelector(domElement); break; case FinderStrategy.ClassName: element = FindByClassName(domElement); break; case FinderStrategy.LinkText: element = FindByLink(domElement); break; case FinderStrategy.PartialLinkText: element = FindByPartialLinkText(domElement); break; case FinderStrategy.TagName: element = FindByTagName(domElement); break; case FinderStrategy.XPath: element = FindByXPath(domElement); break; default: throw new NotSupportedException(string.Format("{0} is not a supported finder strategy.", findBy)); } return element; } private void HoverOverElement(IWebElement element) { var action = new Actions(WebDriver); // Move to the Main Menu Element and hover action.MoveToElement(element).Perform(); } } }
using System; using System.Net; using System.Text; namespace GitIoSharp { public class GitIoService { public Uri Execute(string url) { var request = WebRequest.Create("http://git.io"); request.ContentType = "application/x-www-form-urlencoded"; request.Method = "POST"; var bytes = Encoding.ASCII.GetBytes(url); request.ContentLength = bytes.Length; using (var os = request.GetRequestStream()) { os.Write(bytes, 0, bytes.Length); } try { var response = (HttpWebResponse)request.GetResponse(); if (response.StatusCode != HttpStatusCode.Created) throw new GitIoException(response.StatusDescription); return new Uri(response.Headers[HttpResponseHeader.Location]); } catch (WebException e) { throw new GitIoException(e.Message); } } } }
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; public class GroundEnemyBehavior : MonoBehaviour { //The target player public Transform player; //At what distance will the enemy walk towards the player? public float walkingDistance = 10.0f; //In what time will the enemy complete the journey between its position and the players position public float smoothTime = 10.0f; //Vector3 used to store the velocity of the enemy private Vector3 smoothVelocity = Vector3.zero; private float m_originalScale; private Animator m_animator; private HealthManager m_healthManager; void Start() { player = GameObject.FindGameObjectWithTag("Player").GetComponent<Transform>(); m_originalScale = transform.localScale.x; m_animator = GetComponent<Animator>(); m_healthManager = GetComponent<HealthManager>(); } void Update() { if(m_healthManager.Hp <= 0) { Destroy(gameObject); } if((player.position.x - transform.position.x) > 0) { transform.localScale = new Vector3(-m_originalScale, transform.localScale.y, transform.localScale.z); } else { transform.localScale = new Vector3(m_originalScale, transform.localScale.y, transform.localScale.z); } float distance = Vector3.Distance(transform.position, player.position); if (distance < walkingDistance) { m_animator.Play("Running"); transform.position = Vector3.SmoothDamp(transform.position, player.position, ref smoothVelocity, smoothTime); } else { m_animator.Play("Idle"); } } }
using System; using System.Collections.Generic; namespace TablesReady.Data.Domain { public partial class Email { public int EmaiId { get; set; } public string EmailAddress { get; set; } public int RestaurantId { get; set; } public int? EmployeeId { get; set; } public virtual Employee Employee { get; set; } public virtual Restaurant Restaurant { get; set; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using GraphicalEditor.DTO; namespace GraphicalEditor.DTOForView { public class EquipmentTypeForViewDTO { public EquipmentTypeDTO EquipmentType { get; set; } public bool IsSelected { get; set; } public EquipmentTypeForViewDTO() { } public EquipmentTypeForViewDTO(EquipmentTypeDTO equipementType, bool isSelected) { EquipmentType = equipementType; IsSelected = isSelected; } } }
namespace Profiling2.Tests { using Castle.MicroKernel.Registration; using Castle.Windsor; using CommonServiceLocator.WindsorAdapter; using Microsoft.Practices.ServiceLocation; using SharpArch.Domain.PersistenceSupport; using SharpArch.NHibernate; public class ServiceLocatorInitializer { public static void Init() { IWindsorContainer container = new WindsorContainer(); container.Register( Component .For(typeof(IEntityDuplicateChecker)) .ImplementedBy(typeof(EntityDuplicateChecker)) .Named("entityDuplicateChecker")); ServiceLocator.SetLocatorProvider(() => new WindsorServiceLocator(container)); } } }
using System; using System.Collections.Generic; using System.Text; using System.Reflection; [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyFileVersion("1.0.*")]
using System; using System.Collections.Generic; using System.Threading.Tasks; using Communicator.Core.Domain; namespace Communicator.Infrastructure.IRepositories { public interface IUserRepository { Task Add(User user); Task<User> Get(Guid id); Task<User> Get(string login); Task<IEnumerable<User>> Get(); Task Delete(Guid id); Task Update(User user); } }
using SMG.Common.Code; using SMG.Common.Conditions; using SMG.Common.Effects; using SMG.Common.Gates; using SMG.Common.Transitions; using SMG.Common.Types; using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SMG.Common.Code { /// <summary> /// Generates target language code from a state machine. /// </summary> /// <remarks> /// <para>Derive from this class to create specific target language generators.</para></remarks> public abstract class CodeGenerator : ICodeLabelEvaluator, ICodeGateEvaluator { #region Private private GateConverter _gc; private GuardCollection _guards; private CodeWriter _writer; private TransitionSet _tset; private List<int> _modified; private EffectsCollection _effectsbefore; private EffectsCollection _effectsafter; private StateMachine _sm; #endregion #region Properties protected StateMachine SM { get { return _sm; } } protected CodeWriter Writer { get { return _writer; } } public CodeParameters Parameters { get; set; } #endregion #region Construction protected CodeGenerator(CodeWriter writer) { this._writer = writer; _gc = null; Parameters = new CodeParameters(); } #endregion #region Diagnostics private void Trace(string format, params object[] args) { Debug.WriteLine(format, args); } #endregion #region Public Methods /// <summary> /// Emits code for a state machine. /// </summary> /// <param name="sm">The state machine to generate.</param> public void Emit(StateMachine sm) { if(string.IsNullOrEmpty(sm.Name)) { throw new ArgumentException("state machine name required."); } try { _sm = sm; EmitCore(); } finally { _sm = null; } } #endregion #region Overrideable protected virtual void EmitCore() { EmitPreamble(); EmitEventTypeDeclaration(); EmitClassHeader(); Writer.EnterBlock(); // class EmitTypeDeclarations(); EmitVariableInitialization(); EmitConstructor(); // EmitStateString(sb); Writer.AppendLine(); EmitMethodDeclarations(); EmitProcessEventMethod(); foreach (var e in SM.Events) { EmitEventHandler(e); } EmitClassFooter(); Writer.LeaveBlock(); // class EmitFooter(); } protected virtual void EmitPreamble() { } protected virtual void EmitFooter() { } protected virtual void EmitEventTypeDeclaration() {} protected virtual void EmitTypeDeclaration(string typename, IEnumerable<string> values) { } protected abstract void EmitVariableDeclaration(Variable v); protected abstract void EmitVariableAccessor(Variable v); protected abstract void EmitVariableAssignment(Variable v, int stateindex); protected virtual void EmitMethodDeclaration(string method) { } protected virtual void EmitMethodDeclarations() { foreach (var m in SM.Methods) { EmitMethodDeclaration(m); } } protected abstract void EmitProcessEventMethodHeader(); protected virtual void EmitEnterBlock() { Writer.EnterBlock(); } protected virtual void EmitLeaveBlock() { Writer.LeaveBlock(); } protected virtual void EmitSwitchBlockHeader() { Writer.AppendLine("switch(e)"); EmitEnterBlock(); } protected virtual void EmitSwitchBlockFooter() { EmitLeaveBlock(); } protected abstract void EmitSwitchCaseLabel(Event e); protected abstract void EmitHandlerInvocation(Event e); protected virtual void EmitProcessEventMethod() { EmitProcessEventMethodHeader(); EmitEnterBlock(); EmitSwitchBlockHeader(); foreach (var e in SM.Events) { EmitSwitchCaseLabel(e); Writer.Indent(); EmitHandlerInvocation(e); Writer.Unindent(); } EmitSwitchBlockFooter(); EmitLeaveBlock(); } protected abstract void EmitClassHeader(); protected virtual void EmitConstructor() { } protected virtual void EmitClassFooter() { } protected virtual void EmitHandlerHeader(string name) { } protected virtual void EmitGate(IGate gate) { gate = _gc.ReplaceWithLabelIf(gate); gate.Emit(this); } protected virtual void EmitIfHeader(IGate gate) { Writer.Append("if("); EmitGate(gate); Writer.AppendLine(")"); } protected virtual void EmitEffect(Effect effect) { } public abstract void EmitCodeLabelAssignment(string label, IGate gate); #endregion #region ICodeGateEvaluator void ICodeGateEvaluator.Append(string text) { Writer.Append(text); } public abstract void EmitVariable(Variable v); public abstract void EmitBinaryOperator(GateType type); public abstract void EmitVariableStateCondition(Variable v, int stateindex); #endregion #region Private Methods private void EmitTypeDeclarations() { var types = SM.Variables.Select(e => e.Type).Distinct(); foreach (var type in types.OfType<SimpleStateType>()) { EmitTypeDeclaration(type.Name, type.GetAllStateNames()); } } private void EmitVariableInitialization() { foreach (var v in SM.Variables) { EmitVariableDeclaration(v); } Writer.AppendComment(); foreach (var v in SM.Variables) { EmitVariableAccessor(v); } } /// <summary> /// Emits code for a single event handler. /// </summary> /// <param name="e"></param> private void EmitEventHandler(Event e) { BeginHandler(e); PrepareTransitionSet(e); // use gate converter to schedule condition evaluation ConvertConditions(e); // stage 0: preconditions and LEAVE handlers _guards.AddLeaveEffects(_effectsbefore); _guards.AddEnterEffects(_effectsafter); AddTriggerEffects(e.Triggers); foreach(var t in e.Triggers) { var c = _gc.ConvertToGate(0, t.PreCondition); _gc.Schedule(c); } _effectsbefore.Schedule(_gc); _effectsafter.Schedule(_gc); // code output: precondition labels EmitCodeLabels(0); // pre-effects if (!_effectsbefore.IsEmpty) { Writer.AppendComment(); Writer.AppendComment("state exit handler effects"); EmitEffects(_effectsbefore.GetEffectConditions()); } // emit state transition code EmitTriggerStateChange(_writer, e.Triggers); // stage 1: postconditions and other handlers. _gc.SetNextStage(); // code output: postcondition labels EmitCodeLabels(1); // post-effects if (!_effectsafter.IsEmpty) { Writer.AppendComment(); Writer.AppendComment("state entry handler effects"); EmitEffects(_effectsafter.GetEffectConditions()); } EndHandler(); } private void EmitEffects(IEnumerable<EffectCondition> list) { foreach(var ec in list) { Writer.AppendComment(); foreach (var source in ec.Sources) { Writer.AppendComment(source.ToString()); } var conditional = !(ec.ConditionLabel is TrueGate); if (conditional) { EmitIfHeader(ec.ConditionLabel); EmitEnterBlock(); } EmitEffect(ec.Effect); if (conditional) { EmitLeaveBlock(); } } } private void PrepareTransitionSet(Event e) { // next state inference ... _tset = new TransitionSet(); _tset.AddRange(e.Triggers .SelectMany(t => t.Transitions) ); // set of modified variable indexes _modified = e.Triggers .SelectMany(t => t.ModifiedVariables) .Distinct() .Select(z => z.Index).ToList(); } private void AddTriggerEffects(IEnumerable<ProductTrigger> triggers) { foreach (var t in triggers) { foreach (var effect in t.Effects) { _effectsafter.AddEffect(t, effect); } } } private void EmitTriggerStateChange(CodeWriter writer, IEnumerable<Trigger> triggers) { writer.AppendComment(); writer.AppendComment("state transition"); foreach (var t in triggers) { if(t.PreCondition.Type == GateType.Fixed) { continue; } var c = _gc.ConvertToGate(0, t.PreCondition); EmitIfHeader(c); EmitEnterBlock(); writer.AppendComment("transition " + t); foreach (var x in t.Transitions) { EmitVariableAssignment(x.Variable, x.SinglePostStateIndex); } EmitLeaveBlock(); } } private void EmitCodeLabels(int stage) { _writer.AppendComment(); _writer.AppendComment("stage " + stage + " conditions"); _gc.Emit(this, stage); } private void BeginHandler(Event e) { // code generation start here EmitHandlerHeader(e.Name); EmitEnterBlock(); _gc = new GateConverter(); // process labels before they are added ... _gc.OnBeforeAddLabel = EvaluateCodeLabelBefore; _guards = new GuardCollection(); _effectsbefore = new EffectsCollection(); _effectsafter = new EffectsCollection(); } private void EndHandler() { if(TraceFlags.ShowLabel) { Trace("labels:\n{0}", _gc.ToDebugString()); } _guards = null; _effectsbefore = null; _effectsafter = null; _gc.Dispose(); _gc = null; EmitLeaveBlock(); Writer.AppendComment(); } private void ConvertConditions(Event e) { var c = new TriggerTermCollection<bool>(true); foreach (var t in e.Triggers) { c.Add(t); } foreach (var t in e.Triggers) { foreach (var g in t.Guards) { _guards.AddGuard(t, g); } } } /// <summary> /// Expresses a variable post-condition with preconditions. /// </summary> /// <param name="stage"></param> /// <param name="gate"></param> /// <returns></returns> private IGate EvaluateCodeLabelBefore(int stage, IGate gate) { return gate; } #endregion } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Simple_Cash_Register_Project { class Order { private Products _currentItem; private int _units; public Order() { _currentItem = new Products(); _units = 0; } public Order(Products currentItem, int units) { _currentItem = currentItem; _units = units; } public Products CurrentProduct { set { _currentItem = value; } get { return _currentItem; } } public int Units { set { _units = value; } get { return _units; } } public Decimal Subtotal { get { if (_currentItem is null || _currentItem.ID == 0) ; return _currentItem.Rate * _units; } } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; using System.Net; using System.Net.Sockets; using System.IO; namespace DSG东莞路测客户端.Helper { public class GateWayStatusHelper { public int localPort, remotePort; public string remoteIp; private IPEndPoint remoteIpEndPoint, localIpEndPoint; private Socket socket; private Thread udpServerThread; private Thread udpClientThread; private int sleepTimes; private UdpClient udpClient; private readonly TssMsgHelper tmg = new TssMsgHelper(); public delegate void DlgOnGateWayStatusInfo(GateWayStatusInfo gateWayStatusInfo); public event DlgOnGateWayStatusInfo OnGateWayStatusInfo; public class GateWayStatusInfo { public string net; public string power; public double lon; public double lat; public double voltage; } public GateWayStatusHelper(string remoteIp, int remotePort, int localPort = 4516) { this.localPort = localPort; this.remoteIp = remoteIp; this.remotePort = remotePort; remoteIpEndPoint = new IPEndPoint(IPAddress.Parse(remoteIp), remotePort); localIpEndPoint = new IPEndPoint(IPAddress.Any, localPort); } public void StartWork(int sleepSecond = 5) { StopWork(); sleepTimes = sleepSecond * 1000; udpClient = new UdpClient(localPort); udpServerThread = new Thread(StartUdpServer); udpServerThread.IsBackground = true; udpServerThread.Start(); udpClientThread = new Thread(StartUdpRecive); udpClientThread.IsBackground = true; udpClientThread.Start(); //Task.Run(async()=> //{ // double lon = 113.456789; // double lat = 23.456789; // while (true) // { // GateWayStatusInfo info = new GateWayStatusInfo(); // lon += 0.0001; // lat += 0.0001; // info.lon = lon; // info.lat = lat; // OnGateWayStatusInfo(info); // await Task.Delay(1000); // } //}); } public void StopWork() { if (udpClient != null) udpClient.Close(); try { if (udpClientThread != null) { udpClientThread.Abort(); } } catch (Exception e) { } try { if (udpServerThread != null) { udpServerThread.Abort(); } } catch (Exception e) { } } private void StartUdpServer() { while (true) { try { if (udpClient == null) { Thread.Sleep(sleepTimes); udpClient = new UdpClient(localPort); continue; } TssMsg tm = tmg.Msg2TssMsg(0, "task", "getheartbeat", "", null); byte[] buffer = tmg.Tssmsg2byte(tm); if (buffer == null) { // Module.Log("<Send> buffer is null"); } udpClient.Send(buffer, buffer.Length, remoteIpEndPoint); // File.WriteAllBytes("test.bin", buffer); // Log("<Send>" + buffer.Length + " bytes"); } catch (Exception e) { // Log("<Send Err>" + e.ToString()); } Thread.Sleep(sleepTimes); } } private void StartUdpRecive() { while (true) { try { if (udpClient == null) { Thread.Sleep(sleepTimes); continue; } IPEndPoint rp = new IPEndPoint(IPAddress.Any, 0); byte[] buffer = null; buffer = udpClient.Receive(ref rp); // Module.Log($"<Rev> buffer.length={buffer.Length}"); string thisRemoteIp = rp.Address.ToString(); if (thisRemoteIp == remoteIp) { TssMsg tm = tmg.Byte2tssmsg(buffer); //Module.Log(tm.datatype + "," + tm.functype + "," + tm.canshuqu); if (tm.datatype == "Data" && tm.functype == "heartbeat") { string msg = tm.canshuqu; string str = msg.Replace("<", "").Replace(">", ""); string headFunc = str.Split(':')[0]; if (headFunc == "heartbeat") { // OnUdpHeartBeat(tm.canshuqu); string[] paras = str.Split(';'); GateWayStatusInfo gateWayStatusInfo = new GateWayStatusInfo(); foreach (string kv in paras) { if (kv.Contains("=")) { string key = kv.Split('=')[0]; string value = kv.Split('=')[1]; if (key == "swnet") gateWayStatusInfo.net = value; if (key == "swpow") gateWayStatusInfo.power = value; if (key == "longitude") gateWayStatusInfo.lon = double.Parse(value); if (key == "latitude") gateWayStatusInfo.lat = double.Parse(value); if (key == "voltage") { // OnUdpVoltageInfo(value); gateWayStatusInfo.voltage = double.Parse(value); } } } OnGateWayStatusInfo(gateWayStatusInfo); } } } } catch (Exception e) { } } } } }
using System.Collections; using System.Collections.Generic; using UnityEngine; public class Adap_WaveMover : MonoBehaviour { GameObject wave; public float WaveSpeed = 0.3f; public float WaveDuration = 12f; float killCounter; // Use this for initialization void Start () { } // Update is called once per frame void FixedUpdate () { transform.Translate(new Vector3(1,0,0) * Time.deltaTime * WaveSpeed); Destroy(gameObject, WaveDuration); } }
using ApiCatalogo.InputModel; using ApiCatalogo.ViewModel; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace ApiCatalogo.Services { public interface ILivroService : IDisposable { Task<List<LivroViewModel>> Obter(int pagina, int quantidade); Task<LivroViewModel> Obter(Guid id); Task<LivroViewModel> Inserir(LivroInputModel livro); Task Atualizar(Guid id, LivroInputModel livro); Task Atualizar(Guid id, double preco); Task AtualizarNome(Guid id, string nome); Task AtualizarAutor(Guid id, string autor); Task AtualizarEditora(Guid id, string editora); Task AtualizarEdicao(Guid id, int edicao); Task AtualizarPaginas(Guid id, int paginas); Task Remover(Guid id); } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DelegatesAndEvents { class Program { static void Main(string[] args) { //DelegateDemo.Listing01.Main01(); //MulticastDemo.Listing02.Main02(); //DelegateAsFieldDemo.Listing03.Main03(); //DelegateAsArgDemo.Listing04.Main04(); //DelegateAsResDemo.Listing05.Main05(); //MethAndObjRefsDemo.Listing06.Main06(); //AnonymousMethDemo.Listing07.Main07(); //AnonymMethAsArgDemo.Listing08.Main08(); //AnonymAsResultDemo.Listing09.Main09(); //MoreAnonymAsResultDemo.Listing10.Main10(); //LambdaDemo.Listing11.Main11(); //LambdaAsArgDemo.Listing12.Main12(); //LambdaAsResultDemo.Listing13.Main13(); //MoreLambdaAsResultDemo.Listing14.Main14(); //MoreLambdaDemo.Listing15.Main15(); //Listing16.Main16(); //EventDemo.Listing17.Main17(); //Exc01.MainExc01(); //Exc02.MainExc02(); //Exc03.MainExc03(); //Exc04.MainExc04(); //Exc05.MainExc05(); //Exc06.MainExc06(); //Exc07.MainExc07(); //Exc08.MainExc08(); //Exc09.MainExc09(); //Exc10.MainExc10(); } } }
 /* ****************************************************************************** * @file : Program.cs * @Copyright: ViewTool * @Revision : ver 1.0 * @Date : 2015/02/13 11:26 * @brief : Program demo ****************************************************************************** * @attention * * Copyright 2009-2015, ViewTool * http://www.viewtool.com/ * All Rights Reserved * ****************************************************************************** */ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.InteropServices; using Ginkgo; namespace ControlSPI_Test { class Program { static void Main(string[] args) { int ret; ControlSPI.VSI_INIT_CONFIG pSPI_Config = new ControlSPI.VSI_INIT_CONFIG(); //Scan connected device ret = ControlSPI.VSI_ScanDevice(1); if (ret <= 0) { Console.WriteLine("No device connect!"); return; } // Open device ret = ControlSPI.VSI_OpenDevice(ControlSPI.VSI_USBSPI, 0, 0); if (ret != ControlSPI.ERROR.SUCCESS) { Console.WriteLine("Open device error!"); return; } // Initialize device(Master Mode, Hardware SPI, Half-Duplex) // Function VSI_WriteBytes,VSI_ReadBytes,VSI_WriteReadBytes, // VSI_BlockWriteBytes,VSI_BlockReadBytes,VSI_BlockWriteReadBytes can be support in this mode pSPI_Config.ControlMode = 1; pSPI_Config.MasterMode = 1; pSPI_Config.ClockSpeed = 36000000; pSPI_Config.CPHA = 0; pSPI_Config.CPOL = 0; pSPI_Config.LSBFirst = 0; pSPI_Config.TranBits = 8; ret = ControlSPI.VSI_InitSPI(ControlSPI.VSI_USBSPI, 0, ref pSPI_Config); if (ret != ControlSPI.ERROR.SUCCESS) { Console.WriteLine("Initialize device error!"); return; } Byte[] write_buffer = new Byte[10240]; Byte[] read_buffer = new Byte[10240]; // Write data to SPI bus for (int i = 0; i < 512; i++) { write_buffer[i] = (Byte)i; } ret = ControlSPI.VSI_WriteBytes(ControlSPI.VSI_USBSPI, 0, 0, write_buffer, 512); if (ret != ControlSPI.ERROR.SUCCESS) { Console.WriteLine("Write data error!"); return; } // Read data from SPI bus ret = ControlSPI.VSI_ReadBytes(ControlSPI.VSI_USBSPI, 0, 0, read_buffer, 512); if (ret != ControlSPI.ERROR.SUCCESS) { Console.WriteLine("Read data error!"); return; } Console.WriteLine("Read Data:"); for (int i = 0; i < 512; i++) { Console.Write(read_buffer[i].ToString("X2")+" "); } // Write data and then read data(clock separated ), CS is still enable ret = ControlSPI.VSI_WriteReadBytes(ControlSPI.VSI_USBSPI, 0, 0, write_buffer,256,read_buffer, 512); if (ret != ControlSPI.ERROR.SUCCESS) { Console.WriteLine("Write&Read data error!"); return; } Console.WriteLine("Write&Read Data:"); for (int i = 0; i < 512; i++) { Console.Write(read_buffer[i].ToString("X2") + " "); } //SPI master, Half-Duplex, Block mode, Write data UInt16 BlockSize = 4; UInt16 BlockNum = 5; UInt32 IntervalTime = 10;//in us Byte data = 0; for (int blockNumIndex = 0; blockNumIndex < BlockNum; blockNumIndex++) { for (int blockSizeIndex = 0; blockSizeIndex < BlockSize; blockSizeIndex++) { write_buffer[blockNumIndex * BlockSize + blockSizeIndex] = data; data++; } } // CS will be enable BlockNum times and write BlockSize bits data after call VSI_BlockWriteBytes(), // CS signal interval is IntervalTime(in us) ret = ControlSPI.VSI_BlockWriteBytes(ControlSPI.VSI_USBSPI, 0, 0, write_buffer, BlockSize, BlockNum, IntervalTime); if (ret != ControlSPI.ERROR.SUCCESS) { Console.WriteLine("Block Write data error!"); return; } //SPI master, Half-Duplex, Block mode, Read data for (int blockNumIndex = 0; blockNumIndex < BlockNum; blockNumIndex++) { for (int blockSizeIndex = 0; blockSizeIndex < BlockSize; blockSizeIndex++) { write_buffer[blockNumIndex * BlockSize + blockSizeIndex] = data; data++; } } // CS will be enable BlockNum times and write BlockSize bits data after call VSI_BlockWriteBytes(), // CS signal interval is IntervalTime(in us) ret = ControlSPI.VSI_BlockReadBytes(ControlSPI.VSI_USBSPI, 0, 0, read_buffer, BlockSize, BlockNum, IntervalTime); if (ret != ControlSPI.ERROR.SUCCESS) { Console.WriteLine("Block Read data error!"); return; } //SPI master, Half-Duplex, Block mode, Write&Read data for (int blockNumIndex = 0; blockNumIndex < BlockNum; blockNumIndex++) { for (int blockSizeIndex = 0; blockSizeIndex < BlockSize; blockSizeIndex++) { write_buffer[blockNumIndex * BlockSize + blockSizeIndex] = data; data++; } } // CS will be enable BlockNum times and write BlockSize bits data after call VSI_BlockWriteBytes(), // CS signal interval is IntervalTime(in us) UInt16 WriteBlockSize = 2; UInt16 ReadBlockSize = 4; ret = ControlSPI.VSI_BlockWriteReadBytes(ControlSPI.VSI_USBSPI, 0, 0, write_buffer, WriteBlockSize, read_buffer, ReadBlockSize, BlockNum, IntervalTime); if (ret != ControlSPI.ERROR.SUCCESS) { Console.WriteLine("Block Write&Read data error!"); return; } // Initialize device(Master Mode, Software SPI, Half-Duplex) // function VSI_WriteBytes,VSI_ReadBytes,VSI_WriteReadBytes can be support in software SPI mode // Hardware SPI cannot support function VSI_WriteBits,VSI_ReadBits,VSI_WriteReadBits, but can be used in 1-wired mode pSPI_Config.ControlMode = 2; pSPI_Config.MasterMode = 1; pSPI_Config.ClockSpeed = 100000; pSPI_Config.CPHA = 0; pSPI_Config.CPOL = 0; pSPI_Config.LSBFirst = 0; pSPI_Config.TranBits = 8; ret = ControlSPI.VSI_InitSPI(ControlSPI.VSI_USBSPI, 0, ref pSPI_Config); if (ret != ControlSPI.ERROR.SUCCESS) { Console.WriteLine("Initialize device error!"); return; } // Write data with binary, up to 10240 bits StringBuilder write_buffer_bin; StringBuilder read_buffer_bin; write_buffer_bin = new StringBuilder("10110100100101"); ret = ControlSPI.VSI_WriteBits(ControlSPI.VSI_USBSPI, 0, 0, write_buffer_bin);//send 14bit data if (ret != ControlSPI.ERROR.SUCCESS) { Console.WriteLine("Write bit error!"); return; } // Read data with binary, up to 10240 bits read_buffer_bin = new StringBuilder(10240); ret = ControlSPI.VSI_ReadBits(ControlSPI.VSI_USBSPI, 0, 0, read_buffer_bin,19);//read 19bit data if (ret != ControlSPI.ERROR.SUCCESS) { Console.WriteLine("Read bit error!"); return; } else { Console.WriteLine("Read bits:"); Console.WriteLine(read_buffer_bin); } // Read and write data with binary write_buffer_bin = new StringBuilder("000011110101001"); ret = ControlSPI.VSI_WriteReadBits(ControlSPI.VSI_USBSPI, 0, 0, write_buffer_bin,read_buffer_bin, 25);//read 19bit data if (ret != ControlSPI.ERROR.SUCCESS) { Console.WriteLine("Write bit error!"); return; } else { Console.WriteLine("Read bits:"); Console.WriteLine(read_buffer_bin); } // Initialize device(Slave Mode, Hardware SPI, Full-Duplex) pSPI_Config.ControlMode = 0; // Hardware SPI, Full-Duplex pSPI_Config.MasterMode = 0; // Slave Mode pSPI_Config.CPHA = 0; // Clock Polarity and Phase must be same to master pSPI_Config.CPOL = 0; pSPI_Config.LSBFirst = 0; pSPI_Config.TranBits = 8; // Support 8bit mode only ret = ControlSPI.VSI_InitSPI(ControlSPI.VSI_USBSPI, 0, ref pSPI_Config); if (ret != ControlSPI.ERROR.SUCCESS) { Console.WriteLine("Initialize device error!"); return; } // Write data in slave mode(call function VSI_SlaveWriteBytes), data will not send out via MISO pin immediately until chip select by master, // function VSI_SlaveWriteBytes return immediately after called, the data stored in adapter memory buffer for (int i = 0; i < 8; i++) { write_buffer[i] = (Byte)i; } ret = ControlSPI.VSI_SlaveWriteBytes(ControlSPI.VSI_USBSPI, 0, write_buffer, 8); if (ret != ControlSPI.ERROR.SUCCESS) { Console.WriteLine("Write data error!"); return; } // Write data in slave mode: last parameter(100) is waiting time(in us), // function will return immediately if time-out(no matter whether read the data or not) // Function judge received number of data via parameter read_data_num // ATTENTION: After call function VSI_SlaveWriteBytes, // slave will receive the data when master read data(slave in full-duplex) // master can call function VSI_SlaveReadBytes to discard received data after read the data complete from slave Int32 read_data_num = 0; ret = ControlSPI.VSI_SlaveReadBytes(ControlSPI.VSI_USBSPI, 0, read_buffer, ref read_data_num,100); if (ret != ControlSPI.ERROR.SUCCESS) { Console.WriteLine("Read data error!"); return; } else { if (read_data_num > 0) { Console.WriteLine("Read data num:" + read_data_num); Console.WriteLine("Read data(Hex):"); for (int i = 0; i < read_data_num; i++) { Console.WriteLine(read_buffer[i].ToString("X2")); } } else { Console.WriteLine("No data!"); } } } } }
using System; namespace AcoesDotNet.Model { public partial class Acao : BaseModel { public string CodigoDaAcao { get; set; } public DateTime DataCotacao { get; set; } public decimal Valor { get; set; } } }
using System; namespace SFA.DAS.Tools.Support.Web.Models { public class SearchParameters { public string CourseName { get; set; } public string EmployerName { get; set; } public string ProviderName { get; set; } public long? Ukprn { get; set; } public string ApprenticeNameOrUln { get; set; } public DateTime? StartDate { get; set; } public DateTime? EndDate { get; set; } public string SelectedStatus { get; set; } } }
using Allyn.Application.Dto.Manage.Basic; using Allyn.Application.Dto.Manage.Front; using Allyn.Application.Front; using Allyn.Infrastructure; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web; using System.Web.Mvc; namespace Allyn.MvcApp.Controllers.Manage { //会员管理 public class MemberController : Controller { // // GET: /Manage/Member/ public ActionResult Index() { IMemberService service = ServiceLocator.Instance.GetService<IMemberService>(); var members = service.GetPrMembers(1, 20); ViewBag.Members = JsonConvert.SerializeObject(members); return View(); } public ActionResult Update(Guid id) { if (id == Guid.Empty) { throw new ArgumentException("参数无效", "id"); } IMemberService service = ServiceLocator.Instance.GetService<IMemberService>(); MemberEditDto model = service.GetMemberEditDto(id); ViewBag.Member = JsonConvert.SerializeObject(model); return View("Edit"); } public ActionResult Add() { MemberAddDto model = new MemberAddDto(); ViewBag.Member = JsonConvert.SerializeObject(model); IMemberService service = ServiceLocator.Instance.GetService<IMemberService>(); return View("Edit"); } [HttpPost, ValidateAntiForgeryToken] public JsonResult AddAjax(MemberAddDto model) { if (ModelState.IsValid) { IMemberService service = ServiceLocator.Instance.GetService<IMemberService>(); UserDto user = User.Identity.GetDetails<UserDto>(); model.Creater = user.Id; service.AddMember(model); return Json(new { status = true, urlReferrer = "/manage/member" }, "json", Encoding.UTF8, JsonRequestBehavior.DenyGet); } else { string msg = string.Empty; ModelState.Keys.ToList().ForEach(m => { ModelState[m].Errors.ToList().ForEach(s => { msg = s.ErrorMessage; return; }); if (msg.Length > 0) { return; } }); throw new Exception(msg); } } [HttpPost, ValidateAntiForgeryToken] public JsonResult UpdateAjax(MemberEditDto model) { if (ModelState.IsValid) { IMemberService service = ServiceLocator.Instance.GetService<IMemberService>(); UserDto user = User.Identity.GetDetails<UserDto>(); model.Modifier = user.Id; service.UpdateMember(model); return Json(new { status = true, urlReferrer = "/manage/member" }, "json", Encoding.UTF8, JsonRequestBehavior.DenyGet); } else { string msg = string.Empty; ModelState.Keys.ToList().ForEach(m => { ModelState[m].Errors.ToList().ForEach(s => { msg = s.ErrorMessage; return; }); if (msg.Length > 0) { return; } }); throw new Exception(msg); } } [HttpPost, ValidateAntiForgeryToken] public JsonResult DeleteAjax(List<Guid> keys) { if (keys != null && keys.Count > 0) { IMemberService service = ServiceLocator.Instance.GetService<IMemberService>(); service.DeleteMember(keys); return Json(new { status = true, urlReferrer = "/manage/member" }, "json", Encoding.UTF8, JsonRequestBehavior.DenyGet); } else { throw new ArgumentException("要删除的菜单标识不能为空!", "keys"); } } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace rockpaperscissorslizardspock { class ComputerPlayer : Player {using System; { public override void SetGestures() { Console.WriteLine("Enter your gesture: Rock, Paper, Scissors, Lizard, Spock"); if (gestures == "rock") { if (computerPlayer == "lizard" || playerHuman == "scissors"); { Console.WriteLine("You Win!"); } else if (computerPlayer == "paper") { Console.WriteLine("You Lose!"); lose++; } else if (computerPlayern == "spock") { Console.WriteLine("You Lose!"); lose++; } } else if (playerGesture == "paper") { if (computerPlayer == "spock") { Console.WriteLine("You Win!"); win++; } else if (computerPlayer == "rock") { Console.WriteLine("You Win!"); win++; } else if (computerPlayer == "lizard") { Console.WriteLine("You Lose!"); lose++; } else if (playerHuman == "scissors") { Console.WriteLine("You Lose!"); lose++; } } else if (playerGesture == "scissors") { if (playerHuman == "paper") { Console.WriteLine("You Win!"); win++; } else if (playerHuman == "lizard") { Console.WriteLine("You Win!"); win++; } else if (playerHuman == "rock") { Console.WriteLine("You Lose!"); lose++; } else if (playerHuman == "spock") { Console.WriteLine("You Lose!); lose++; } } else if (playerGesture == "lizard") { if (playerHuman == "paper") { Console.WriteLine("You Win!"); win++; } else if (playerHuman == "spock") { Console.WriteLine("You Win!"); win++; } else if (playerHuman == "scissors") { Console.WriteLine("You Lose!"); lose++; } else if (playerHuman == "rock") { Console.WriteLine("You Lose!"); lose++; } } else if (playerGesture == "spock") { if (playerHuman == "rock") { Console.WriteLine("You Win!"); win++; } else if (playerHuman == "scissors") { Console.WriteLine("You Win!"); win++; } else if (playerHuman == "paper") { Console.WriteLine("You Lose!"); lose++; } else if (playerHuman == "lizard") { Console.WriteLine("You Lose!"); lose++; } } } } } }
using System.Drawing; using System.Drawing.Imaging; using System.IO; using System.Windows.Media; using System.Windows.Media.Imaging; namespace CODE.Framework.Wpf.Utilities { /// <summary> /// This class provides various useful utility functions related to images and bitmaps /// </summary> /// <remarks> /// This image helper is specific to WPF image features. For GDI+ image features see the /// ImageHelper class in the CODE.Framework.Core.Utilities namespace /// </remarks> public static class ImageHelper { /// <summary> /// Converts a GDI+ image/bitmap to a WPF Image Source /// </summary> /// <param name="bitmap">The bitmap.</param> /// <returns>ImageSource.</returns> public static ImageSource BitmapToImageSource(Image bitmap) { using (var memory = new MemoryStream()) { bitmap.Save(memory, ImageFormat.Png); memory.Position = 0; var bitmapImage = new BitmapImage(); bitmapImage.BeginInit(); bitmapImage.StreamSource = memory; bitmapImage.CacheOption = BitmapCacheOption.OnLoad; bitmapImage.EndInit(); return bitmapImage; } } } }
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Numerics; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Permut.Tests { [TestClass] public class UnitTests { private IEnumerable<int> CreateReversedArray(int n) { for (int i = n; i > 0; i--) { yield return i; } } [TestMethod] public void FindPermut_Should_WorkForBigN() { // Arrange BigInteger i = BigInteger.Parse("30414093201713378043612608166064768844377641568960511999999999999"); int n = 50; var expected = CreateReversedArray(n).ToArray(); // Act var result = Program.FindIthPermutation(n, i); // Assert CollectionAssert.AreEqual(expected, result); } } }
using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using WebAPI.Helpers; namespace WebAPI.Controllers { [Route("api/greetings")] [ApiController] public class GreetingsController : ControllerBase { [HttpGet("{name}")] public ActionResult<string> GetGreeting(string name) { return $"Hello, {name}"; } [HttpGet("async/{name}")] public async Task<ActionResult<string>> GetGreetingAsync(string name) { var waitingTime = RandomGen.NextDouble() * 10 + 1; await Task.Delay(TimeSpan.FromSeconds(waitingTime)); //MyAsyncVoidMethod(); AsyncTaskMethod(); return $"Hello, {name}"; } [HttpGet("goodbye/{name}")] public async Task<ActionResult<string>> GetGoodbye(string name) { var waitingTime = RandomGen.NextDouble() * 10 + 1; await Task.Delay(TimeSpan.FromSeconds(waitingTime)); return $"Good bye, {name}"; } [HttpGet("asit")] public ActionResult<string> GetGreetings() { return "Hello Asit"; } private async Task AsyncTaskMethod() { await Task.Delay(1); throw new ApplicationException(); } //Anti Pattern - Very dangerous, should be avoid at all cost private async void MyAsyncVoidMethod() { await Task.Delay(1); throw new ApplicationException(); } } }
using EmberKernel.Services.UI.Mvvm.Dependency; using System; using System.Collections.Generic; using System.ComponentModel; using System.Text; namespace EmberWpfCore.Components.Configuration.ViewModel { public class ConfigurationSingleValueViewModel : INotifyPropertyChanged { public object Value { get => DependencySet[Name]; set { DependencySet[Name] = value; PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(Name)); } } private string Name { get; } private DependencySet DependencySet { get; } public event PropertyChangedEventHandler PropertyChanged; public ConfigurationSingleValueViewModel(string name, DependencySet dependencySet) { this.Name = name; this.DependencySet = dependencySet; DependencySet.PropertyChanged += DependencySet_PropertyChanged; } private void DependencySet_PropertyChanged(object sender, PropertyChangedEventArgs e) { if (e.PropertyName == Name) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Value))); } } } }
using System; using System.Collections.Generic; using System.Diagnostics; using System.Text; using System.Threading; using System.Threading.Tasks; using Lux.Framework; using Lux.Input; using Lux.Physics; namespace Test { class Program { static Engine engine; static void Main(string[] args) { Engine.LoadDependencies(); engine = new Engine(); engine.Run(); Console.WriteLine("Loading model..."); Entity sponza = engine.CreateEntity(@"models\sponza.obj", "ent.phys"); Console.WriteLine("Done!"); engine.Input.CursorLocked = true; engine.Input.CursorHidden = true; engine.Camera = new Camera(0.0, 0.0, 0.0); engine.Camera.Position = new Vector3(500, 500, 0); engine.Input.BindKeyHold(Key.W, () => { engine.Camera.Position += engine.Camera.GetRotationMatrix * Vector3.Forwards * 10.0; }); engine.Input.BindKeyHold(Key.S, () => { engine.Camera.Position += engine.Camera.GetRotationMatrix * Vector3.Backwards * 10.0; }); engine.Input.BindKeyHold(Key.A, () => { engine.Camera.Position += engine.Camera.GetRotationMatrix * Vector3.Left * 10.0; }); engine.Input.BindKeyHold(Key.D, () => { engine.Camera.Position += engine.Camera.GetRotationMatrix * Vector3.Right * 10.0; }); engine.Input.BindKeyHold(Key.Space, () => { engine.Camera.Position += Vector3.Up * 10.0; }); engine.Input.BindKeyHold(Key.LeftShift, () => { engine.Camera.Position += Vector3.Down * 10.0; }); engine.Input.BindKeyHold(Key.Q, () => { engine.Camera.Yaw += 0.03; if (engine.Camera.Yaw < 0) engine.Camera.Yaw += Math.PI * 2; }); engine.Input.BindKeyHold(Key.E, () => { engine.Camera.Yaw -= 0.03; if (engine.Camera.Yaw >= Math.PI * 2) engine.Camera.Yaw -= Math.PI * 2; }); engine.Input.BindKeyHold(Key.R, () => { engine.Camera.Pitch += 0.03; if (engine.Camera.Pitch > Math.PI / 2) engine.Camera.Pitch = Math.PI / 2; }); engine.Input.BindKeyHold(Key.F, () => { engine.Camera.Pitch -= 0.03; if (engine.Camera.Pitch < -Math.PI / 2) engine.Camera.Pitch = -Math.PI / 2; }); engine.Input.BindKeyHold(Key.Escape, () => { engine.Stop(); }); engine.Input.BindMouseEvent(MouseEvent.Move, (MouseEventArguments e) => { engine.Camera.Yaw -= e.DeltaX * 0.005; if (engine.Camera.Yaw < 0) engine.Camera.Yaw += Math.PI * 2; if (engine.Camera.Yaw >= Math.PI * 2) engine.Camera.Yaw -= Math.PI * 2; engine.Camera.Pitch -= e.DeltaY * 0.005; if (engine.Camera.Pitch > Math.PI / 2) engine.Camera.Pitch = Math.PI / 2; if (engine.Camera.Pitch < -Math.PI / 2) engine.Camera.Pitch = -Math.PI / 2; }); engine.Input.BindMouseEvent(MouseEvent.WheelMove, (MouseEventArguments e) => { Console.WriteLine(e.WheelPosition); }); Stopwatch timer = new Stopwatch(); double d = 0; while (engine.IsRunning) { timer.Restart(); d += 0.00501; while (timer.Elapsed.TotalMilliseconds < 1) ; } } } }
using System.Collections; using System.Collections.Generic; using UnityEngine; public class RayGun : MonoBehaviour { public float shootRate; private float m_shootRateTimeStamp; //public Light lightLazer; public GameObject m_shotPrefab; RaycastHit hit; float range = 1000.0f; void Start() { // lightLazer.enabled = false; } void Update() { if (Input.GetKey("space")) { if (Time.time > m_shootRateTimeStamp) { shootRay(); m_shootRateTimeStamp = Time.time + shootRate; } } } void shootRay() { //var ray = Instantiate(m_shotPrefab, transform.position, transform.rotation); Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(this.transform.position, this.transform.forward, out hit)) { GameObject laser = GameObject.Instantiate(m_shotPrefab, this.transform.position, this.transform.rotation) as GameObject; laser.GetComponent<ShotBehavior>().setTarget(hit.point); GameObject.Destroy(laser, 2f); } } }
using System; using System.Collections.Generic; using System.Linq; using KartObjects; namespace KartSystem { public class DemandDocEditorPresenter : BaseDocEditorPresenter { private int DocType; protected IDemandDocumentEditView _view; /// <summary> /// /// </summary> /// <param name="view"></param> /// <param name="DocType">тип документа по отношению к складским остаткам -1,0,1</param> public DemandDocEditorPresenter(IDemandDocumentEditView view, int docType) : base(view, docType) { _view = view; this.IDSession = view.IdDemandSession; DocType = docType; } /// <summary> /// ОБновляем спецификацию по товару и по ассортименту /// </summary> public override void refresh() { if (DocType == 1) { var v = Loader.DbLoad<DemandGoodRecord>("1=1 order by numpos,namegood", _view.Document.Id, Convert.ToInt64(_view.PriceViewMode), _view.SelectedGroupId.Value, Convert.ToInt64(_view.ShowNullRest),_view.SelectedSupplierId, Convert.ToInt64(_view.IdDemandSession)); if (v != null) { _view.DemandGoodRecords = (v.Cast<DemandGoodRecord>().Select(q => q).ToList()) ?? new List<DemandGoodRecord>(); } else _view.DemandGoodRecords.Clear(); } else { _view.DemandGoodRecords = Loader.DbLoad<DemandGoodRecord>("", 0, _view.Document.Id, Convert.ToInt32(_view.PriceViewMode), _view.SelectedGroupId, Convert.ToInt32(_view.ShowNullRest), _view.SelectedSupplierId, Convert.ToInt64(_view.IdDemandSession)) ?? new List<DemandGoodRecord>(); } if (_view.DemandDocument != null) { _view.DemandDocument.DemandDocSpec = _view.DemandGoodRecords as List<DemandGoodRecord>; } } /// <summary> /// Сохраняем спецификацию /// </summary> public override void saveGoodRecord() { if (_view.DemandCurrGoodSpecRecord != null) { Saver.SaveToDb<DemandGoodRecord>(_view.DemandCurrGoodSpecRecord); Saver.DataContext.CommitRetaining(); } } /// <summary> /// Признак блокировки документа от редактирования /// </summary> public bool DocLocked { get; set; } public override void SaveDocument() { Saver.SaveToDb<DemandDocument>(_view.Document as DemandDocument); DocLocker.IdDocument = _view.Document.Id; DocLocker.BlockDocument(); } public void RecalcDemandDoc() { Loader.DataContext.ExecuteNonQuery("execute procedure sp_recalc_demand_document(" + _view.DemandDocument.Id + "," + _view.IdDemandSession + ")"); } } }
using System; using System.Collections.Generic; using Grasshopper.Kernel; using PterodactylEngine; namespace Pterodactyl { public class TaskListGH : GH_Component { public TaskListGH() : base("Task List", "Task List", "Add task list", "Pterodactyl", "Parts") { } public override bool IsBakeCapable => false; protected override void RegisterInputParams(GH_Component.GH_InputParamManager pManager) { pManager.AddTextParameter("Tasks", "Tasks", "Different tasks as text list", GH_ParamAccess.list, new List<string> { "Try Task List component", "Write your own task"}); pManager.AddBooleanParameter("Done", "Done", "Boolean list. True = done.", GH_ParamAccess.list, new List<bool> { true, false }); } protected override void RegisterOutputParams(GH_Component.GH_OutputParamManager pManager) { pManager.AddTextParameter("Report Part", "Report Part", "Created part of the report (Markdown text)", GH_ParamAccess.item); } protected override void SolveInstance(IGH_DataAccess DA) { List<string> text = new List<string>(); List<bool> done = new List<bool>(); DA.GetDataList(0, text); DA.GetDataList(1, done); string report; TaskList taskObject = new TaskList(text, done); report = taskObject.Create(); DA.SetData(0, report); } public override GH_Exposure Exposure { get { return GH_Exposure.secondary; } } protected override System.Drawing.Bitmap Icon { get { return Properties.Resources.PterodactylTaskList; } } public override Guid ComponentGuid { get { return new Guid("6d67b19c-bd15-44eb-9524-e0856ff55d1b"); } } } }
using System.Web.Mvc; namespace Web.Controllers { public class FacebookAngController : Controller { #region Index public ActionResult Index() { ViewBag.Message = "FacebookAng"; return View(); } #endregion } }
using System.Collections.Generic; namespace CyberSoldierServer.Dtos.EjectDtos { public class ServerTokenDto { public int ServerCurrentValue { get; set; } public int ServerCapacity { get; set; } public ICollection<CampPoolDto> Pools { get; set; } } }
using System.Collections.Generic; namespace Tests.Data.Van.Input { public class LiveCallsCampaign { #region Setup Tab Input public string CampaignName = ""; public string CallingScript = ""; public string CampaignBudget = ""; public string Description = ""; #endregion #region Schedule Tab Input public string CallingDatesFrom = ""; public string CallingDatesThrough = ""; #endregion #region Confirmation Tab Input public string ContactName = ""; public string PhoneNumber = ""; public string EmailAddress = ""; public string OrganizationName = ""; public Dictionary<string, bool> TermsandConditionDictionary = new Dictionary<string, bool> //not sure if this is the right one to use { {"Active", true}, {"Inactive", false} }; #endregion } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using QTouristik.Data; using IdomOffice.Interface.BackOffice.Booking.Entity; namespace IdomOffice.Interface.BackOffice.Booking { public class BookingProcess { public string Id { get; set; } public string docType { get; set; } = "BookingProcess"; public OfferInfo OfferInfo { get; set; } = new OfferInfo(); public int TravelApplicantId { get; set; } public TravelApplicant TravelApplicant { get; set; } = new TravelApplicant(); public DocumentProcessStatus Status { get; set; } public List<BookingProcessItem> BookingProcessItemList { get; set; } = new List<BookingProcessItem>(); public int SellingPartner { get; set; } public int AccProvider { get; set; } public string Season { get; set; } public List<TravelApplicantPayment> Payments { get; set; } = new List<TravelApplicantPayment>(); public List<ProviderPayment> PaymentsForProvider { get; set; } = new List<ProviderPayment>(); public string BookingNumber { get; set; } } }
using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using InventoryControl.Data; using System; using System.Linq; namespace InventoryControl.Models { public static class SeedData { public static void Initialize(IServiceProvider serviceProvider) { using (var context = new InventoryControlContext( serviceProvider.GetRequiredService< DbContextOptions<InventoryControlContext>>())) { return; //if (context.Clients.Any()) //{ // return; // DB has been seeded //} context.Clients.AddRange( new Client { Name = "橋本百貨店", ClientNum = 100, Address = "横浜1-1-1", ReleaseDate = DateTime.Parse("2019-12-12") }, new Client { Name = "山田商事", ClientNum = 101, Address = "浦賀1-1-1", ReleaseDate = DateTime.Parse("2019-12-12") }, new Client { Name = "田中デパート", ClientNum = 102, Address = "逗子1-1-1", ReleaseDate = DateTime.Parse("2019-12-12") }, new Client { Name = "佐藤商店", ClientNum = 103, Address = "三浦1-1-1", ReleaseDate = DateTime.Parse("2019-12-12") } ); context.SaveChanges(); // if (context.Store.Any()) // { // return; // DB has been seeded // } context.Stores.AddRange( new Store { Name = "渋谷店", ReleaseDate = DateTime.Parse("2019-12-12"), StoreNum = 1, Address = "渋谷2-2-2" }, new Store { Name = "恵比寿店", ReleaseDate = DateTime.Parse("2019-12-12"), StoreNum = 2, Address = "恵比寿2-2-2" }, new Store { Name = "品川店", ReleaseDate = DateTime.Parse("2019-12-12"), StoreNum = 3, Address = "品川2-2-2" }, new Store { Name = "五反田店", ReleaseDate = DateTime.Parse("2019-12-12"), StoreNum = 4, Address = "五反田2-2-2" } ); context.SaveChanges(); // if (context.Supplier.Any()) // { // return; // DB has been seeded // } context.Suppliers.AddRange( new Supplier { Name = "高橋商店", SupplierNum = 200, Address = "国立市1-1-1", ReleaseDate = DateTime.Parse("2019-12-12") }, new Supplier { Name = "北島商事", SupplierNum = 201, Address = "立川市1-1-1", ReleaseDate = DateTime.Parse("2019-12-12") }, new Supplier { Name = "川田商事", SupplierNum = 202, Address = "国分寺市1-1-1", ReleaseDate = DateTime.Parse("2019-12-12") }, new Supplier { Name = "後藤商事", SupplierNum = 203, Address = "武蔵野市1-1-1", ReleaseDate = DateTime.Parse("2019-12-12") } ); context.SaveChanges(); //if (context.Warehouses.Any()) //{ // return; // DB has been seeded //} context.Warehouses.AddRange( new Warehouse { Name = "渋谷倉庫", ReleaseDate = DateTime.Parse("2019-12-12"), WarehouseNum = 1, Address = "渋谷2-2-2", StoreId = 1 }, new Warehouse { Name = "恵比寿倉庫", ReleaseDate = DateTime.Parse("2019-12-12"), WarehouseNum = 2, Address = "恵比寿2-2-2", StoreId = 2 }, new Warehouse { Name = "品川倉庫", ReleaseDate = DateTime.Parse("2019-12-12"), WarehouseNum = 3, Address = "品川2-2-2", StoreId = 3 }, new Warehouse { Name = "五反田倉庫", ReleaseDate = DateTime.Parse("2019-12-12"), WarehouseNum = 4, Address = "五反田2-2-2", StoreId = 4 } ); context.SaveChanges(); //if (context.Item.Any()) //{ // return; // DB has been seeded //} context.Items.AddRange( new Item { Name = "椅子", Lot = 10001, ReleaseDate = DateTime.Parse("2019-12-12"), Genre = "椅子", PurchasePrice = 2000M, SupplierId = 1 }, new Item { Name = "机", Lot = 10002, ReleaseDate = DateTime.Parse("2019-12-12"), Genre = "机", PurchasePrice = 10000, SupplierId = 1 }, new Item { Name = "キッチン棚", Lot = 10003, ReleaseDate = DateTime.Parse("2019-12-12"), Genre = "棚", PurchasePrice = 15000, SupplierId = 1 }, new Item { Name = "ソファ", Lot = 10004, ReleaseDate = DateTime.Parse("2019-12-12"), Genre = "ソファ", PurchasePrice = 100000, SupplierId = 1 } ); context.SaveChanges(); } } } }
using Focuswin.SP.Base.Utility; using System; using System.Collections.Generic; using System.Linq; using System.ServiceModel; using System.ServiceModel.Web; using System.Text; using System.Threading.Tasks; using YFVIC.DMS.Model.Models.FileInfo; using YFVIC.DMS.Model.Models.WorkFlow; using YFVIC.DMS.Model.Models.Common; using YFVIC.DMS.Model.Models.Permission; using YFVIC.DMS.Model.Models.Process; using YFVIC.DMS.Model.Models.Project; using YFVIC.DMS.Model.Models.Document; using YFVIC.DMS.Model.Models.ExtenalCompany; using YFVIC.DMS.Model.Models.DataDictionary; using YFVIC.DMS.Model.Models.HR; using YFVIC.DMS.Model.Models.Nav; using YFVIC.DMS.Model.Models.OrgChart; using YFVIC.DMS.Model.Models.Distribute; using YFVIC.DMS.Model.Models.BasicData; using YFVIC.DMS.Model.Models.SOA; namespace YFVIC.DMS.Service.Services { // 注意: 使用“重构”菜单上的“重命名”命令,可以同时更改代码和配置文件中的接口名“IGlobalService”。 [ServiceContract] [ServiceKnownType(typeof(PagingEntity))] [ServiceKnownType(typeof(Permission))] [ServiceKnownType(typeof(WorkflowEntity))] [ServiceKnownType(typeof(List<WorkflowEntity>))] [ServiceKnownType(typeof(List<WFNodeEntity>))] [ServiceKnownType(typeof(List<WFCompanyEntity>))] [ServiceKnownType(typeof(List<WFTaskEntity>))] [ServiceKnownType(typeof(List<WFInstsEntity>))] [ServiceKnownType(typeof(List<WFEntrustEntity>))] [ServiceKnownType(typeof(List<WFCommEntity>))] [ServiceKnownType(typeof(PagesEntity))] [ServiceKnownType(typeof(FileInfoEntity))] [ServiceKnownType(typeof(List<FileInfoEntity>))] [ServiceKnownType(typeof(FileFormEntity))] [ServiceKnownType(typeof(List<FileReportEntity>))] [ServiceKnownType(typeof(List<FileFormEntity>))] [ServiceKnownType(typeof(FileTEntity))] [ServiceKnownType(typeof(List<FileTEntity>))] [ServiceKnownType(typeof(ProcessEntity))] [ServiceKnownType(typeof(DocumentEntity))] [ServiceKnownType(typeof(List<DocumentEntity>))] [ServiceKnownType(typeof(List<ProjectEntity>))] [ServiceKnownType(typeof(List<ProjectUserEntity>))] [ServiceKnownType(typeof(List<ProcessEntity>))] [ServiceKnownType(typeof(List<EXCompanyEntity>))] [ServiceKnownType(typeof(List<EXUserEntity>))] [ServiceKnownType(typeof(EXCompanyEntity))] [ServiceKnownType(typeof(EXUserEntity))] [ServiceKnownType(typeof(List<DataDicEntity>))] [ServiceKnownType(typeof(List<SysCompanyEntity>))] [ServiceKnownType(typeof(List<SysOrgEntity>))] [ServiceKnownType(typeof(List<SysPosEntity>))] [ServiceKnownType(typeof(List<SysUserEntity>))] [ServiceKnownType(typeof(List<FileHistoryEntity>))] [ServiceKnownType(typeof(OrgChartEntity))] [ServiceKnownType(typeof(List<NavEntity>))] [ServiceKnownType(typeof(List<OrgChartEntity>))] [ServiceKnownType(typeof(List<DistributeEntity>))] [ServiceKnownType(typeof(List<BorrowFileEntity>))] [ServiceKnownType(typeof(List<BorrowEntity>))] [ServiceKnownType(typeof(List<RoleEntity>))] [ServiceKnownType(typeof(List<OrgRoleEntity>))] [ServiceKnownType(typeof(List<DepartRoleEntity >))] [ServiceKnownType(typeof(List<ActionEntity>))] [ServiceKnownType(typeof(List<ReadEntity>))] [ServiceKnownType(typeof(List<ShareEntity>))] [ServiceKnownType(typeof(List<Permission>))] [ServiceKnownType(typeof(List<FileReferEntity>))] [ServiceKnownType(typeof(List<string>))] [ServiceKnownType(typeof(List<BasicEntity>))] [ServiceKnownType(typeof(List<DisTaskEntity>))] [ServiceKnownType(typeof(List<PFPermission>))] [ServiceKnownType(typeof(List<FormHistoryEntity>))] [ServiceKnownType(typeof(List<DisFileEntity>))] [ServiceKnownType(typeof(List<SOAEntity>))] [ServiceKnownType(typeof(SOAEntity))] [ServiceKnownType(typeof(NumberEntity))] [ServiceKnownType(typeof(List<SOAFilePermission>))] [ServiceKnownType(typeof(List<SOAReportEntity>))] [ServiceKnownType(typeof(List<FolderEntity>))] [ServiceKnownType(typeof(List<ShipToCodeEntity>))] [ServiceKnownType(typeof(List<RFSReport>))] [ServiceKnownType(typeof(List<RFSNumber>))] interface IGlobalService { [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/CreateFile", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult CreateFile(FileInfoEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/UpdataFile", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult UpdataFile(FileInfoEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/UpdataFileAndMove", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult UpdataFileAndMove(FileInfoEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/DelFile", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult DelFile(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/CheckeOutFile", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult CheckeOutFile(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/UndoCheckOutFile", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult UndoCheckOutFile(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/CheckInFile", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult CheckInFile(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/AddRefer", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult AddRefer(FileInfoEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/RemoveRefer", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult RemoveRefer(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/GetRefers", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetRefers(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/GetFileTemp", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetFileTemp(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/CopyFile", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult CopyFile(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/GetFileinfo", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetFileinfo(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/SearchFile", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult SearchFile(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/GetActiveFileinfo", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetActiveFileinfo(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/GetFileinfos", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetFileinfos(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/GetFileinfoCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetFileinfoCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/GetFilesByPermission", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetFilesByPermission(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/GetFilesByScope", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetFilesByScope(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/GetFilesByCreaterPermission", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetFilesByCreaterPermission(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/GetFilesByPerCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetFilesByPerCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/GetMyPermissionFiles", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetMyPermissionFiles(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/GetMyPermissionFileCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetMyPermissionFileCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/GlobalSearchFile", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GlobalSearchFile(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/SearchFileCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult SearchFileCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/GetFileCode", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetFileCode(FileInfoEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/CheckFileName", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult CheckFileName(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/GetFileByids", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetFileByIds(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/GetNUCode", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetNUCode(); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/IsActiveFile", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult IsActiveFile(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/UpdataFileWF", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult UpdatAFileWF(FileInfoEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/GetDeletedFile", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetDeletedFile(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/GetDeletedFileCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetDeletedFileCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/GetNactiveFile", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetNactiveFile(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/GetNactiveFileCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetNactiveFileCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/GetFileHistory", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetFileHistory(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/GetFileFormsByVersion", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetFileFormsByVersion(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/ChageCreater", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult ChageCreater(FileInfoEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/GetFileBySProcess", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetFileBySProcess(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/GetCTCFile", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetCTCFile(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/CanAddFile", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult CanAddFile(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/GetTCFilesByPermission", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetTCFilesByPermission(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/GetTCFilesByPermissionCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetTCFilesByPermissionCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/GetDrafts", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetDrafts(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/GetDraftsCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetDraftsCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/GetAllDrafts", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetAllDrafts(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/GetAllDraftsCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetAllDraftsCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/UpdateDraftCreater", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult UpdateDraftCreater(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/DelDraft", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult DelDrafts(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/GetFileReport", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetFileReport(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/GetFileReportCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetFileReportCount(PagingEntity obj); [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/InsertProcessFile", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult InsertProcessFile(ProcessFileEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileInfo/DelProcessFile", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult DelProcessFile(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileForm/CreateFileForm", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult CreateFileForm(FileFormEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileForm/UpdataFileForm", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult UpdataFileForm(FileFormEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileForm/UpdataActiveFileFormAfter", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult UpdataActiveFileFormAfter(FileFormEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileForm/DelFileForm", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult DelFileForm(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileForm/RestoreDelForms", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult RestoreDelForms(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileForm/RestoreAddForms", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult RestoreAddForms(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileForm/RealDelFileForm", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult RealDelFileForm(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileForm/RealDelFileForms", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult RealDelFileForms(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileForm/GetFileForm", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetFileForm(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileForm/GetFileForms", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetFileForms(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileForm/GetPublishFileForms", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetPublishFileForms(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileForm/GetFileFormsByName", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetFileFormsByName(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileForm/CheckFileForm", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult CheckFileForm(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileForm/GetFormHistorys", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetFormHistorys(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileForm/GetHistoryFileForms", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetHistoryFileForms(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/WorkFlow/AddWorkFlow", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult InsertWorkFlow(WorkflowEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/WorkFlow/UpdataWorkFlow", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult UpdataWorkFlow(WorkflowEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/WorkFlow/DelWorkFlow", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult DelWorkFlow(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/WorkFlow/GetWorkFlows", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetWorkFlows(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/WorkFlow/GetWorkFlowCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetWorkFlowCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/WorkFlow/CheckWorkFlowName", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult CheckWorkFlowName(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/WorkFlow/GetWorkFlow", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetWorkflowById(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/WorkFlow/AddWFNode", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult InsertWFNode(WFNodeEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/WorkFlow/UpdataWFNode", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult UpdataWFNode(WFNodeEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/WorkFlow/DelWFNode", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult DelWFNode(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/WorkFlow/GetWFNodes", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetWFNodesById(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/WorkFlow/GetWFNodeCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetWFNodeCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/WFInsts/AddWFInsts", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult InsertWFInsts(WFInstsEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/WFInsts/UpdataWFInsts", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult UpdataWFInsts(WFInstsEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/WFInsts/DelWFInsts", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult DelWFInsts(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/WFInsts/GetWFInstss", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetWFInsts(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/WFInsts/GetWFInstsCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetWFInstsCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/WFTask/AddWFTask", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult InsertWFTask(WFTaskEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/WFTask/UpdataWFTask", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult UpdataWFTask(WFTaskEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/WFTask/DelWFTask", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult DelWFTask(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/WFTask/GetWFTasksByStatue", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetWFTasksById(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/WFTask/GetAllWFTasks", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetAllWFTasks(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/WFTask/GetAllWFTaskCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetAllWFTaskCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/WFTask/GetWFTasks", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetWFTasks(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/WFTask/GetWFTaskCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetWFTaskCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/WFTask/GetWFtaskRecord", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetWFtaskRecord(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/WFTask/GetWFtaskRecordCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetWFtaskRecordCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/WFTask/GetWFTaskHistory", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetWFTaskHistory(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/WFTask/GetWFTaskHistoryCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetWFTaskHistoryCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/WFTask/WFTaskCanTransfer", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult WFTaskCanTransfer(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/WFEntrust/AddWFEntrust", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult InsertWFEntrust(WFEntrustEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/WFEntrust/UpdataWFEntrust", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult UpdataWFEntrust(WFEntrustEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/WFEntrust/DelWFEntrust", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult DelWFEntrust(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/WFEntrust/GetWFEntrusts", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetWFEntrusts(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/WFEntrust/GetWFEntrustCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetWFEntrustCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/WFEntrust/HasWFEntrust", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult HasWFEntrust(WFEntrustEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Workflow/GetApproverByStep", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetApproverByStep(WFCommEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Workflow/GetAllApprover", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetAllApprover(WFCommEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Workflow/PublishFile", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult PublishFile(FileInfoEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Workflow/ApproverTCWorkflow", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult ApproveTCWorkFlow(WFTaskEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Workflow/ApproveDisWorkFlow", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult ApproveDisWorkFlow(WFTaskEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Workflow/ApproveBorrowWorkFlow", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult ApproveBorrowWorkFlow(WFTaskEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Workflow/ApproveDepartWorkFlow", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult ApproveDepartWorkFlow(WFTaskEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Workflow/CanStartWorkflow", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult CanStartWorkflow(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Workflow/HastenWork", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult HastenWork(WFTaskEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Workflow/RollBackTask", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult RollBackTask(WFTaskEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Workflow/GetRollBacks", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetRollBacks(WFTaskEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Workflow/ApproverWorkflow", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult ApproveWorkFlow(WFTaskEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Workflow/ApproverDistributeWorkFlow", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult ApproverDistributeWorkFlow(WFTaskEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/FileActive/SendEmail", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult SendEmail(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/TCWFNode/AddTCWFNode", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult InsertTCWFNode(TCWFNodeEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/TCWFNode/UpdataTCWFNode", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult UpdataTCWFNode(TCWFNodeEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/TCWFNode/DelTCWFNode", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult DelTCWFNode(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/TCWFNode/GetTCWFNodes", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetTCWFNodes(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/TCWFNode/GetTCWFNodeCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetTCWFNodeCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/TCWFNode/GetTCWFNode", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetTCWFNode(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Permission/AddPermission", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult InsertPermission(PermissionEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Permission/UpdataPermission", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult UpdataPermission(PermissionEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Permission/DelPermission", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult DelPermission(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Permission/GetPermissionInfo", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetPermissionInfo(PermissionEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Permission/GetPermissionInfos", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetPermissionInfos(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Permission/GetPermissionInfoCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetPermissionInfoCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SOA/InsertSOAPermission", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult InsertSOAPermission(PermissionEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SOA/UpdateSOAPermission", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult UpdateSOAPermission(PermissionEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SOA/DelSOAPermission", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult DelSOAPermission(PermissionEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SOA/GetSOAPermission", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetSOAPermission(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SOA/GetSOAPermissionsCountByFileId", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetSOAPermissionsCountByFileId(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Process/AddProcess", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult InsertProcess(ProcessEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Process/UpdataProcess", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult UpdataProcess(ProcessEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Process/DelProcess", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult DelProcess(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Process/GetProcesss", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetProcesssById(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Process/GetProcesssCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetProcessCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Process/GetProcessById", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetProcessById(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Process/IsOnlyOne", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult IsOnlyOneProcess(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Project/AddProject", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult InsertProject(ProjectEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Project/UpdataProject", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult UpdataProject(ProjectEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Project/DelProject", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult DelProject(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Project/GetProjects", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetProjects(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Project/GetProjectCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetProjectCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Project/CheckProjectName", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult CheckProjectName(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Project/GetProject", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetProjectById(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Project/GetProjectByEPNum", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetProjectByEPNum(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Project/AddProjectUser", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult InsertProjectUser(ProjectUserEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Project/UpdataProjectUser", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult UpdataProjectUser(ProjectUserEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Project/DelProjectUser", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult DelProjectUser(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Project/GetProjectUsers", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetProjectUsers(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Project/GetProjectUserCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetProjectUserCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Project/GetProjectUser", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetProjectUserById(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Project/GetProjectUsersByEPNum", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetProjectUsersByEPNum(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Project/GetProjectByUser", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetProjectByUser(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Project/GetProjectByCreater", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetProjectByCreater(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Project/GetProjectCountByCreater", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetProjectCountByCreater(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Project/UpdataProjectCreater", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult UpdataProjectCreater(ProjectEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Project/GetProjectUsersByRoles", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetProjectUsersByRoles(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Project/IsProjectRole", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult IsProjectRole(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Project/GetAssWF", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetAssWF(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Project/CheckProjectUser", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult CheckProjectUser(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Project/GetProjectCountByUser", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetProjectCountByUser(); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/WorkFlow/GetCompanys", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetWFCompanys(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Document/AddDocument", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult InsertDocument(DocumentEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Document/UpdataDocument", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult UpdataDocument(DocumentEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Document/DelDocument", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult DelDocument(DocumentEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Document/GetDocuments", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetDocumentsById(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Document/GetDocumentsCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetDocumentCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Document/GetDocumentsByPermission", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetDocumentsByPermission(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Document/GetDocumentsCountByPermission", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetDocumentCountByPermission(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Document/IsExitFile", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult IsExistFile(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Document/GetRootDocument", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetRootDocument(); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Document/SetRoorAdmin", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult SetRootAdmin(DocumentEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Document/GetRoorAdmin", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetRootAdmin(DocumentEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Document/IsOnlyOne", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult IsOnlyOne(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/EXCompany/AddEXCompany", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult InsertEXCompany(EXCompanyEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/EXCompany/UpdataEXCompany", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult UpdataEXCompany(EXCompanyEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/EXCompany/DelEXCompany", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult DelEXCompany(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/EXCompany/GetEXCompanys", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetEXCompanys(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/EXCompany/GetEXCompanyCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetEXCompanyCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/EXCompany/CheckEXCompanyName", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult CheckEXCompanyName(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/EXCompany/GetEXCompany", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetEXCompanyById(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/EXUser/AddEXUser", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult InsertEXUser(EXUserEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/EXUser/UpdataEXUser", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult UpdataEXUser(EXUserEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/EXUser/DelEXUser", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult DelEXUser(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/EXUser/GetEXUsers", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetEXUsers(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/EXUser/GetEXUsersByName", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetEXUsersByName(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/EXUser/GetEXUserCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetEXUserCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/EXUser/CheckEXUserName", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult CheckEXUserName(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/EXUser/GetEXUser", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetEXUserById(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/EXUser/GetEXUserByIds", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetEXUserByIds(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Data/GetDataDic", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetDataDic(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Data/GetDataDics", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetDataDics(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SysCompany/AddSysCompany", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult InsertSysCompany(SysCompanyEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SysCompany/UpdataSysCompany", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult UpdataSysCompany(SysCompanyEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SysCompany/DelSysCompany", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult DelSysCompany(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SysCompany/GetSysCompanys", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetSysCompanys(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SysCompany/GetSysCompanyCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetSysCompanyCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SysCompany/GetSysCompany", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetSysCompanyById(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SysPos/AddSysPos", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult InsertSysPos(SysPosEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SysPos/UpdataSysPos", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult UpdataSysPos(SysPosEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SysPos/DelSysPos", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult DelSysPos(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SysPos/GetSysPoss", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetSysPoss(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SysPos/GetSysPosCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetSysPosCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SysPos/GetSysPos", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetSysPosById(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SysOrg/AddSysOrg", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult InsertSysOrg(SysOrgEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SysOrg/UpdataSysOrg", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult UpdataSysOrg(SysOrgEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SysOrg/DelSysOrg", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult DelSysOrg(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SysOrg/GetSysOrgs", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetSysOrgs(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SysOrg/GetSysOrgCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetSysOrgCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SysOrg/GetReFunctionInfo", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetReFunctionInfo(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SysOrg/GetSysOrg", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetSysOrgById(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SysOrg/GetSysOrgByChild", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetSysOrgByChild(string id); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SysOrg/GetOrgByName", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetOrgByName(PagingEntity id); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SysOrg/RemoveNoExistOrgs", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult RemoveNoExistOrgs(PagingEntity id); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SysOrg/GetSysOrgByCompany", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetSysOrgByCompany(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SysUser/AddSysUser", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult InsertSysUser(SysUserEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SysUser/UpdataSysUser", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult UpdataSysUser(SysUserEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SysUser/DelSysUser", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult DelSysUser(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SysUser/GetSysUsers", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetSysUsers(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SysUser/GetSysUsersByName", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetSysUsersByName(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SysUser/GetNavPsermissionUsers", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetNavPsermissionUsers(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SysUser/GetSysUserCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetSysUserCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SysUser/GetSysUser", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetSysUserById(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SysUser/GetSysUserBySids", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetSysUserBySids(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SysUser/GetSysUserOrgInfos", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetSysUserOrgInfos(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SysUser/GetUserByOrg", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetUsersByOrg(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SysUser/GetSysUserCountByOrg", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetSysUserCountByOrg(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SysUser/CDSIDISExit", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult CDSIDISExit(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SysUser/GetUserOrgCompany", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetUserOrgCompany(string sid); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Nav/AddNav", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult InsertNav(NavEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Nav/UpdataNav", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult UpdataNav(NavEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Nav/DelNav", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult DelNav(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Nav/GetNavs", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetNavs(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Nav/GetNavCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetNavCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Nav/GetNav", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetNavById(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/OrgChart/GetOrgChart", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetOrgChart(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/OrgChart/GetFilesByProcess", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetFilesByProcess(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/OrgChart/GetFilesByProcessCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetFilesByProcessCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/OrgChart/GetNFilesByProcess", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetNFilesByProcess(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/OrgChart/GetNFilesByProcessCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetNFilesByProcessCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/OrgChart/IsAdmin", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult IsAdmin(); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/OrgRole/AddOrgRole", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult InsertOrgRole(OrgRoleEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/OrgRole/UpdataOrgRole", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult UpdataOrgRole(OrgRoleEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/OrgRole/DelOrgRole", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult DelOrgRole(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/OrgRole/GetOrgRoles", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetOrgRoles(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/OrgRole/GetOrgRoleByName", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetOrgRoleByName(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/OrgRole/GetOrgRoleCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetOrgRoleCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/OrgRole/GetOrgRole", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetOrgRoleById(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/OrgRole/GetRoleByOrg", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetRoleByOrg(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/OrgRole/GetFileController", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetFileController(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Role/AddRole", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult InsertRole(RoleEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Role/UpdataRole", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult UpdataRole(RoleEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Role/DelRole", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult DelRole(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Role/GetRoles", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetRoles(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Role/GetRoleCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetRoleCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Role/GetRole", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetRoleById(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Role/GetTCRole", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetTCRole(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Distribute/AddDistribute", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult InsertDistribute(DistributeEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Distribute/UpdataDistribute", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult UpdataDistribute(DistributeEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Distribute/DelDistribute", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult DelDistribute(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Distribute/GetDistributes", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetDistributes(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Distribute/GetDistributeCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetDistributeCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Distribute/GetDisHistories", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetDisHistories(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Distribute/GetDisHistoryCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetDisHistoryCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Distribute/GetDeptFiles", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetDeptFiles(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Distribute/GetDeptFileCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetDeptFileCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Distribute/GetDistribute", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetDistributeById(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Distribute/GetDistributeById", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetDistribute(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Distribute/GetDistributesByEpNum", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetDistributesByEpNum(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Distribute/GetDistributesCountByEpNum", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetDistributesCountByEpNum(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Distribute/HasFileLable", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult HasFileLable(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Distribute/IsExistDisFile", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult IsExistDisFile(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Distribute/GetMyDisFiles", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetMyDisFiles(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Distribute/AddDisFile", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult InsertDisFile(DistributeEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Distribute/UpdataDisFile", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult UpdataDisFile(DistributeEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Distribute/GetDisFiles", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetDisFiles(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Distribute/GetDisFilesCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetDisFilesCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Distribute/GetDisFile", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetDisFileById(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Distribute/GetDisFileByName", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetDisFileByName(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/BorrowFile/AddBorrowFile", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult InsertBorrowFile(BorrowFileEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/BorrowFile/UpdataBorrowFile", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult UpdataBorrowFile(BorrowFileEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/BorrowFile/DelBorrowFile", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult DelBorrowFile(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/BorrowFile/GetBorrowFiles", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetBorrowFiles(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/BorrowFile/GetBorrowFileCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetBorrowFileCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/BorrowFile/GetBorrowFile", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetBorrowFileById(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/BorrowFile/GetBorrowFilesByIds", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetBorrowFilesByIds(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Borrow/AddBorrow", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult InsertBorrow(BorrowEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Borrow/AddDisBorrow", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult AddBorrow(BorrowEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Borrow/UpdataBorrow", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult UpdataBorrow(BorrowEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Borrow/DelBorrow", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult DelBorrow(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Borrow/GetBorrows", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetBorrows(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Borrow/GetBorrowCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetBorrowCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Borrow/GetBorrow", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetBorrowById(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Borrow/GetBorrrowByUser", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetBorrrowByUser(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Borrow/GetBorrrowByUserCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetBorrrowByUserCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Borrow/GetBorrowByDisId", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetBorrowByDisId(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Borrow/GetDistome", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetDistome(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Borrow/GetDistomeCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetDistomeCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Audit/InsertAction", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult InsertAction(ActionEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Audit/InsertShareHistory", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult InsertShareHistory(ShareEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Audit/InsertReadHistory", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult InsertReadHistory(ReadEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Audit/UpdateReadHistory", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult UpdateReadHistory(ReadEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Audit/GetAudit", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetAudit(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Audit/GetAuditCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetAuditCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Audit/GetFileAction", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetFileAction(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Audit/GetFileActionCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetFileActionCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Audit/GeFileRead", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GeFileRead(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Audit/GeFileReadCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GeFileReadCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Audit/GetFileShare", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetFileShare(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/Audit/GetFileShareCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetFileShareCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/DepartRole/AddDepartRole", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult InsertDepartRole(DepartRoleEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/DepartRole/UpdataDepartRole", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult UpdataDepartRole(DepartRoleEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/DepartRole/DelDepartRole", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult DelDepartRole(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/DepartRole/GetDepartRoles", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetDepartRoles(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/DepartRole/GetDepartRoleCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetDepartRoleCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/DepartRole/GetDepartRole", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetDepartRoleById(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/DepartRole/IsHasRole", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult IsHasRole(DepartRoleEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/DisTask/AddDisTask", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult InsertDisTask(DisTaskEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/DisTask/UpdataDisTask", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult UpdataDisTask(DisTaskEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/DisTask/DelDisTask", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult DelDisTask(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/DisTask/GetDisTasks", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetDisTasks(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/DisTask/GetDisTaskCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetDisTaskCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/DisTask/GetDisTaskById", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetDisTaskById(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/BasicData/GetBasicLists", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetBasicLists(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/BasicData/GetBasicListCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetBasicListCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SysUser/IsFirstLogion", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult IsFirstLogion(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SysUser/AddUserLogion", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult AddUserLogion(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SOA/AddSOA", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult InsertSOA(SOAEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SOA/UpdataSOA", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult UpdataSOA(SOAEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SOA/DelSOA", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult DelSOA(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SOA/GetSOAs", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetSOAs(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SOA/GetSOACount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetSOACount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SOA/CheckSOAName", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult CheckSOAName(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SOA/GetSOAId", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetSOAId(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SOA/CurrentFolderHasFile", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult CurrentFolderHasFile(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SOA/GetSOA", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetSOAById(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SOA/GetSOAByEPNum", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetSOAByEPNum(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SOA/UpdateShipCode", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult UpdateShipCode(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SOA/GetRootFolder", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetRootFolder(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SOA/GetSubFolders", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetSubFolders(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SOA/GetMyUploadFiles", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetMyUploadFiles(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SOA/GetMyUploadFilesCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetMyUploadFilesCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SOA/GetSOAByPermission", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetSOAByPermission(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SOA/GetAssociationFiles", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetAssociationFiles(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SOA/GetSOAFileCountByPermission", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetSOAFileCountByPermission(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SOA/GetSOARepart", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetSOARepart(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SOA/GetSOARepartCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetSOARepartCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SOA/GetShipToCodes", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetShipToCodes(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SOA/GetShipToCodesCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetShipToCodesCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SOA/UpdateShipToCode", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult UpdateShipToCode(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SOA/GetSerialNumber", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetSerialNumber(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SOA/GetSignForReports", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetSignForReports(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SOA/GetSingForReportCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetSingForReportCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SOA/GetResNumberList", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetRefNumberList(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SOA/GetResNumberReports", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetRefNumberReports(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SOA/GetResNumberReportCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetRefNumberReportCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SOA/GetRefCodeList", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetRefCodeList(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SOA/GetRefCodeListCount", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult GetRefCodeListCount(PagingEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SOA/InsertRef", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult InsertRef(NumberEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SOA/UpdateRef", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult UpdateRef(NumberEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SOA/DelRef", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult DelRef(NumberEntity obj); [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "/DMS/SOA/CanDel", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] JsonResult CanDel(NumberEntity obj); } }
/* https://stackoverflow.com/a/40765711 */ using Android.App; using Android.Graphics; using Android.OS; using Android.Util; using Android.Views; using Android.Widget; namespace NSchedule.Droid { public class AndroidBug5497WorkaroundForXamarinAndroid { private readonly View mChildOfContent; private int usableHeightPrevious; private FrameLayout.LayoutParams frameLayoutParams; public static void assistActivity(Activity activity, IWindowManager windowManager) { new AndroidBug5497WorkaroundForXamarinAndroid(activity, windowManager); } private AndroidBug5497WorkaroundForXamarinAndroid(Activity activity, IWindowManager windowManager) { var softButtonsHeight = getSoftbuttonsbarHeight(windowManager); var content = (FrameLayout)activity.FindViewById(Android.Resource.Id.Content); mChildOfContent = content.GetChildAt(0); var vto = mChildOfContent.ViewTreeObserver; vto.GlobalLayout += (sender, e) => possiblyResizeChildOfContent(softButtonsHeight); frameLayoutParams = (FrameLayout.LayoutParams)mChildOfContent.LayoutParameters; } private void possiblyResizeChildOfContent(int softButtonsHeight) { var usableHeightNow = computeUsableHeight(); if (usableHeightNow != usableHeightPrevious) { var usableHeightSansKeyboard = mChildOfContent.RootView.Height - softButtonsHeight; var heightDifference = usableHeightSansKeyboard - usableHeightNow; if (heightDifference > (usableHeightSansKeyboard / 4)) { // keyboard probably just became visible frameLayoutParams.Height = usableHeightSansKeyboard - heightDifference + (softButtonsHeight / 2); } else { // keyboard probably just became hidden frameLayoutParams.Height = usableHeightSansKeyboard; } mChildOfContent.RequestLayout(); usableHeightPrevious = usableHeightNow; } } private int computeUsableHeight() { var r = new Rect(); mChildOfContent.GetWindowVisibleDisplayFrame(r); return (r.Bottom - r.Top); } private int getSoftbuttonsbarHeight(IWindowManager windowManager) { if (Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop) { var metrics = new DisplayMetrics(); windowManager.DefaultDisplay.GetMetrics(metrics); int usableHeight = metrics.HeightPixels; windowManager.DefaultDisplay.GetRealMetrics(metrics); int realHeight = metrics.HeightPixels; if (realHeight > usableHeight) return realHeight - usableHeight; else return 0; } return 0; } } }
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.AI; public class GuardAI : MonoBehaviour { public List<Transform> wayPoints; private NavMeshAgent _agent; [SerializeField] private int _currentTarget; private bool _reverse; public bool _targetReached; private Animator _anim; public bool coinTossed; private Player _player; // Start is called before the first frame update void Start() { _player = GameObject.Find("Player").GetComponent<Player>(); _anim = GetComponent<Animator>(); if(_anim==null) { Debug.Log("anim is null"); } _agent = GetComponent<NavMeshAgent>(); if (_anim==null) { Debug.Log("anim is null"); } } // Update is called once per frame void Update() { if (coinTossed==false) { if (wayPoints.Count > 0 && wayPoints[_currentTarget] != null) { _agent.SetDestination(wayPoints[_currentTarget].position); float distance = Vector3.Distance(transform.position, wayPoints[_currentTarget].position); if (distance < 1.0f && _targetReached == false) { if (wayPoints.Count < 2) { return; } if (_currentTarget == 0 || _currentTarget == wayPoints.Count - 1 && wayPoints.Count > 1) { _targetReached = true; StartCoroutine("WaitBeforeMoving"); } else { if (_reverse == true) { _currentTarget--; if (_currentTarget <= 0) { _reverse = false; _currentTarget = 0; } } else { _currentTarget++; } } } } } else { float distance = Vector3.Distance(transform.position, _player.coinTarget); if (distance < 5 ) { _anim.SetBool("Walk", false); } } } IEnumerator WaitBeforeMoving() { if (_currentTarget == 0) { if (coinTossed==false) { _anim.SetBool("Walk", false); yield return new WaitForSeconds(Random.Range(2, 5)); _reverse = false; _currentTarget = 0; _anim.SetBool("Walk", true); } else { _anim.SetBool("Walk", true); _agent.SetDestination(_player.coinTarget); float distance = Vector3.Distance(transform.position, _player.coinTarget); if (distance < 1.7f && _targetReached == false) { _anim.SetBool("Walk", false); } } } else if (_currentTarget ==wayPoints.Count-1)//To solve the out of range exception { _anim.SetBool("Walk", false); yield return new WaitForSeconds(Random.Range(2, 5)); _anim.SetBool("Walk", true); _reverse = true; } if (_reverse==true) { _currentTarget--; } else if (_reverse==false) { _currentTarget++; if (_currentTarget == wayPoints.Count) { yield return new WaitForSeconds(Random.Range(2, 5)); _reverse = true; _currentTarget--; } } _targetReached = false; } public void StopPatrolling() { coinTossed = true; } }
using System.Collections; using System.Collections.Generic; using UnityEngine; namespace MS.LitCSV.Examples{ public class LitCSVExample : MonoBehaviour { public TextAsset file1; public TextAsset file2; void Start() { TestRead(file1); TestRead(file2); } private void TestRead(TextAsset file){ var csvFile = CSVReader.ReadText(file.text);//read file for(var i = 0;i<csvFile.lineCount;i++){ Debug.LogFormat("Line {0} ===========",i); var line = csvFile.GetLine(i);//get line for(var j = 0;j<line.cellCount;j++){ var str = line.GetCell(j); //get cell Debug.Log(str); } } } } }
using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerMovement : MonoBehaviour { /* Animation and movement components in this script learnt from: https://www.youtube.com/playlist?list=PLiyfvmtjWC_X6e0EYLPczO9tNCkm2dzkm */ // Character's move speed value public float moveSpeed; // Animation: Bool to transition from idle to moving private bool playerMoving; // Animation: Variable which dictates to animator what the idle state is private Vector2 lastMove; // Bool to only allow 4 directional movement bool moveX; bool moveY; // To allow player to move public static bool playerCanMove = true; // Declaring animator private Animator animator; // Use this for initialization void Start () { moveSpeed = 4; animator = GetComponent<Animator>(); } // Update is called once per frame void Update () { playerMoving = false; // Code that allows player to move character // Works by manipulating a virtual scale, which ranges from -1 to 1. // TO DO: Disallow diagonal movement if (playerCanMove == true) { if (Input.GetAxisRaw("Horizontal") > 0.2f || Input.GetAxisRaw("Horizontal") < -0.2f) { transform.Translate(new Vector3((Input.GetAxisRaw("Horizontal") * moveSpeed * Time.deltaTime), 0f, 0f)); playerMoving = true; lastMove = new Vector2(Input.GetAxisRaw("Horizontal"), 0f); } if (Input.GetAxisRaw("Vertical") > 0.2f || Input.GetAxisRaw("Vertical") < -0.2f) { transform.Translate(new Vector3(0f, (Input.GetAxisRaw("Vertical") * moveSpeed * Time.deltaTime), 0f)); playerMoving = true; lastMove = new Vector2(0f, Input.GetAxisRaw("Vertical")); } } // Values in animator set here animator.SetFloat("MoveX", Input.GetAxisRaw("Horizontal")); animator.SetFloat("MoveY", Input.GetAxisRaw("Vertical")); animator.SetBool("PlayerMoving", playerMoving); animator.SetFloat("LastMoveX", lastMove.x); animator.SetFloat("LastMoveY", lastMove.y); } }
using SimulationDemo.Enums; using SimulationDemo.Randomness; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace SimulationDemo.Elements { public class SelfCheckoutQueue : BaseQueue, IQueue { private int _numOfMachines; private Customer[] _currentInServiceCustomers; public SelfCheckoutQueue(int numOfMachines) : base() { _waitingqueue = new LinkedList<Customer>(); if (numOfMachines <= 0) { throw new Exception($"The number of self checkout machine should be greater than zero: numOfMachines = {numOfMachines}"); } _numOfMachines = numOfMachines; _currentInServiceCustomers = new Customer[_numOfMachines]; } public int NumOfMachines { get => _numOfMachines; } public IEnumerable<Customer> GetAllCustomers() { List<Customer> customers = new List<Customer>(); customers.AddRange(_currentInServiceCustomers); customers.AddRange(_waitingqueue); return customers.Where(c => c != null); } public bool IsCurrentCustomerFinished() { for(int i = 0; i < _numOfMachines; i++) { if (_currentInServiceCustomers[i] == null || _currentInServiceCustomers[i].IsCheckoutFinished()) //there is a self-checkout machine available { return true; } } return false; } public void StartCheckoutForNextCustomer() { if (this.IsCurrentCustomerFinished() == false) { throw new Exception($"No self checkout machine will be available, cannot start checking out for next one"); } for (int i = 0; i < _numOfMachines; i++) { if (_currentInServiceCustomers[i] == null || _currentInServiceCustomers[i].IsCheckoutFinished()) //there is a self-checkout machine available { _currentInServiceCustomers[i]?.DepartureAfterCheckout(); this.UpdateStatisticsOnDeparture(_currentInServiceCustomers[i]); _currentInServiceCustomers[i] = null; if (_waitingqueue.Count != 0) // if queue is empty, then _currentInServiceCustomer is null { _currentInServiceCustomers[i] = _waitingqueue.First.Value; _currentInServiceCustomers[i].StartCheckout(); if ((int)DistributionHelper.GetDistribution(EventEnum.MachineError).Sample() == 1) // machine error occurs { _currentInServiceCustomers[i].NeedHelpForSelfCheckout(); } _waitingqueue.RemoveFirst(); } } } } public void PrintOut() { StringBuilder builder = new StringBuilder(); foreach (var cur in _waitingqueue) { builder.Append($"[{cur.CustomerId}]"); } Console.WriteLine($"Self-Checkout[{_queueId}] [{(_waitingqueue.Count != 0 ? "busy" : "idle")}] [{(_isQueueOpened ? "opened" : "closed")}] " + $"- Avg. Waiting Time: {_avgWaitingTime:00} " + $"- Lastest 10 Cust Avg. Waiting Time: {(_last10waitingtime.Count == 0 ? 0 : _last10waitingtime.Sum() / _last10waitingtime.Count):00} " + $"||{builder.ToString()}"); for (int i = 0; i < _numOfMachines; i++) { Console.WriteLine($" - Machine {i+1}: [{(_currentInServiceCustomers[i] != null ? _currentInServiceCustomers[i].CustomerId : " ")}]"); } } public bool IsQueueIdle() { return _currentInServiceCustomers.Any(x => x == null) && _waitingqueue.Count == 0; } } }
using System; using System.Collections.Generic; using System.Linq; namespace _2._Oldest_Family_Member { class Program { static void Main(string[] args) { int n = int.Parse(Console.ReadLine()); Family family1 = new Family(); for (int i = 0; i < n; i++) { string[] personProps = Console.ReadLine().Split(); string name = personProps[0]; int age = int.Parse(personProps[1]); Person currentPerson = new Person(name,age); family1.AddMember(currentPerson); } Person oldestPerson = family1.GetOldestPerson(); Console.WriteLine(oldestPerson.Name + " " + oldestPerson.Age); } } }
using System.Web.Services; using com.Sconit.Service; using com.Sconit.Entity; using System.Collections.Generic; using com.Sconit.Service.SI.MES; using com.Sconit.Entity.SI.MES; namespace com.Sconit.WebService { [WebService(Namespace = "http://com.Sconit.WebService.MESService/")] public class MESService : BaseWebService { private IMESServicesMgr mesServicesMgr { get { return GetService<IMESServicesMgr>(); } } [WebMethod] public MESCreateResponse CreateHu(string CustomerCode, string CustomerName, string LotNo, string Item, string ItemDesc, string ManufactureDate, string Manufacturer, string OrderNo, string Uom, decimal UC, decimal Qty, string CreateUser, string CreateDate, string Printer, string HuId) { SecurityContextHolder.Set(securityMgr.GetUser("Monitor")); return mesServicesMgr.CreateHu(CustomerCode, CustomerName, LotNo, Item, ItemDesc, ManufactureDate, Manufacturer, OrderNo, Uom, UC, Qty, CreateUser, CreateDate, Printer, HuId); } [WebMethod] public MESCreateResponse CreatePallet(List<string> BoxNos, string BoxCount, string Printer, string CreateUser, string CreateDate, string PalletId) { SecurityContextHolder.Set(securityMgr.GetUser("Monitor")); return mesServicesMgr.CreatePallet(BoxNos, BoxCount, Printer, CreateUser, CreateDate, PalletId); } [WebMethod] public Entity.SI.MES.InventoryResponse GetInventory(Entity.SI.MES.InventoryRequest request) { SecurityContextHolder.Set(securityMgr.GetUser("Monitor")); return mesServicesMgr.GetInventory(request); } } }
namespace TPMDocs.Models { using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Data.Entity.Spatial; [Table("spravoh.Виды гофропродукции")] public partial class Виды_гофропродукции { [Key] public byte Код { get; set; } [StringLength(100)] public string Вид { get; set; } [Column("Родительный падеж")] [StringLength(100)] public string Родительный_падеж { get; set; } [Column("Доп продукция")] public bool? Доп_продукция { get; set; } [Column("Код соответствия")] public int? Код_соответствия { get; set; } [StringLength(100)] public string ВидРус { get; set; } [Column("Родительный падеж Рус")] [StringLength(100)] public string Родительный_падеж_Рус { get; set; } [Column(TypeName = "timestamp")] [MaxLength(8)] [Timestamp] public byte[] SSMA_TimeStamp { get; set; } } }
using System; using System.Collections.Generic; using Hayaa.BaseModel; /// <summary> ///代码效率工具生成,此文件不要修改 /// </summary> namespace Hayaa.Security.Service { public class AppInstanceToken : BaseData { public int AppInstanceTokenId { set; get; } public int AppInstanceId { set; get; } public String Token { set; get; } public String AppToken { set; get; } public bool Status { set; get; } } }
using System.Security.Claims; namespace CyberSoldierServer.Helpers.Extensions { public static class AuthExtensions { public static int GetUserId(this ClaimsPrincipal principal) { return int.Parse((principal.FindFirst("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier") ?? principal.FindFirst("sub")).Value); } } }
using AutoMapper; using FamilyAccounting.AutoMapper; using Microsoft.Extensions.DependencyInjection; namespace FamilyAccounting.Web.Services { public static class MapperServiceConfiguration { public static IServiceCollection AddViewModelMapping(this IServiceCollection services) { var mappingConfig = new MapperConfiguration(mc => { mc.AddProfile(new MapProfile()); mc.AddProfile(new MappingProfile()); }); IMapper mapper = mappingConfig.CreateMapper(); services.AddSingleton(mapper); return services; } } }
using System; using System.IO; using System.Security.Cryptography; using System.Text; using System.Text.RegularExpressions; using OrbisPkg.Security; using OrbisPkg.Classes; namespace OrbisPkg.CNT { /// <summary> /// A package file (PKG) is a file that contains the content that the user will download or install. /// </summary> public sealed class Package { #region Variables private EndianIO IO; private string _Passcode; public PackageFile Pkg = new PackageFile(); private const uint PKG_FLAG_FINALIZED = (1u << 31); private const uint PKG_FLAGS_VER_1 = 0x01000000; private const uint PKG_FLAGS_VER_2 = 0x02000000; private const uint PKG_FLAGS_INTERNAL = 0x40000000; private const uint PKG_FLAGS_FINALIZED = 0x80000000; private const uint PKG_CONTENT_ID_SIZE = 0x24; private const uint PKG_CONTENT_ID_BLOCK_SIZE = 0x30; private const uint PKG_HASH_SIZE = 0x20; private const uint PKG_PASSCODE_SIZE = 0x20; private const uint PKG_KEYSTONE_BLOCK_SIZE = 0x20; private const uint PKG_CONTENT_FLAGS_FIRST_PATCH = 0x00100000; private const uint PKG_CONTENT_FLAGS_PATCHGO = 0x00200000; private const uint PKG_CONTENT_FLAGS_REMASTER = 0x00400000; private const uint PKG_CONTENT_FLAGS_PS_CLOUD = 0x00800000; private const uint PKG_CONTENT_FLAGS_GD_AC = 0x02000000; private const uint PKG_CONTENT_FLAGS_NON_GAME = 0x04000000; private const uint PKG_CONTENT_FLAGS_0x8000000 = 0x08000000; // has data? private const uint PKG_CONTENT_FLAGS_SUBSEQUENT_PATCH = 0x40000000; private const uint PKG_CONTENT_FLAGS_DELTA_PATCH = 0x41000000; private const uint PKG_CONTENT_FLAGS_CUMULATIVE_PATCH = 0x60000000; private const ulong PKG_PFS_FLAG_NESTED_IMAGE = 0x8000000000000000; private const uint PKG_MAX_ENTRY_KEYS = 0x07; private const uint PKG_ENTRY_KEYSET_SIZE = 0x20; private const uint PKG_ENTRY_KEYSET_ENC_SIZE = 0x100; private enum AppType { APP_TYPE_PAID_STANDALONE_FULL = 1, APP_TYPE_UPGRADABLE = 2, APP_TYPE_DEMO = 3, APP_TYPE_FREEMIUM = 4, } public enum DrmType { DRM_TYPE_NONE = 0x0, DRM_TYPE_PS4 = 0xF, } public enum ContentType { CONTENT_TYPE_GD = 0x1A, /* pkg_ps4_app, pkg_ps4_patch, pkg_ps4_remaster */ CONTENT_TYPE_AC = 0x1B, /* pkg_ps4_ac_data, pkg_ps4_sf_theme, pkg_ps4_theme */ CONTENT_TYPE_AL = 0x1C, /* pkg_ps4_ac_nodata */ CONTENT_TYPE_DP = 0x1E, /* pkg_ps4_delta_patch */ } public enum IroTag { IRO_TAG_SF_THEME = 0x1, /* SHAREfactory theme */ IRO_TAG_SS_THEME = 0x2, /* System Software theme */ } #region Entry Ids public enum EntryId { PKG_ENTRY_ID__DIGESTS = 0x00000001, PKG_ENTRY_ID__ENTRY_KEYS = 0x00000010, PKG_ENTRY_ID__IMAGE_KEY = 0x00000020, PKG_ENTRY_ID__GENERAL_DIGESTS = 0x00000080, PKG_ENTRY_ID__METAS = 0x00000100, PKG_ENTRY_ID__ENTRY_NAMES = 0x00000200, PKG_ENTRY_ID__LICENSE_DAT = 0x00000400, PKG_ENTRY_ID__LICENSE_INFO = 0x00000401, PKG_ENTRY_ID__NPTITLE_DAT = 0x00000402, PKG_ENTRY_ID__NPBIND_DAT = 0x00000403, PKG_ENTRY_ID__SELFINFO_DAT = 0x00000404, PKG_ENTRY_ID__IMAGEINFO_DAT = 0x00000406, PKG_ENTRY_ID__TARGET_DELTAINFO_DAT = 0x00000407, PKG_ENTRY_ID__ORIGIN_DELTAINFO_DAT = 0x00000408, PKG_ENTRY_ID__PSRESERVED_DAT = 0x00000409, PKG_ENTRY_ID__PARAM_SFO = 0x00001000, PKG_ENTRY_ID__PLAYGO_CHUNK_DAT = 0x00001001, PKG_ENTRY_ID__PLAYGO_CHUNK_SHA = 0x00001002, PKG_ENTRY_ID__PLAYGO_MANIFEST_XML = 0x00001003, PKG_ENTRY_ID__PRONUNCIATION_XML = 0x00001004, PKG_ENTRY_ID__PRONUNCIATION_SIG = 0x00001005, PKG_ENTRY_ID__PIC1_PNG = 0x00001006, PKG_ENTRY_ID__PUBTOOLINFO_DAT = 0x00001007, PKG_ENTRY_ID__APP__PLAYGO_CHUNK_DAT = 0x00001008, PKG_ENTRY_ID__APP__PLAYGO_CHUNK_SHA = 0x00001009, PKG_ENTRY_ID__APP__PLAYGO_MANIFEST_XML = 0x0000100A, PKG_ENTRY_ID__SHAREPARAM_JSON = 0x0000100B, PKG_ENTRY_ID__SHAREOVERLAYIMAGE_PNG = 0x0000100C, PKG_ENTRY_ID__SAVE_DATA_PNG = 0x0000100D, PKG_ENTRY_ID__SHAREPRIVACYGUARDIMAGE_PNG = 0x0000100E, PKG_ENTRY_ID__ICON0_PNG = 0x00001200, PKG_ENTRY_ID__ICON0_00_PNG = 0x00001201, PKG_ENTRY_ID__ICON0_01_PNG = 0x00001202, PKG_ENTRY_ID__ICON0_02_PNG = 0x00001203, PKG_ENTRY_ID__ICON0_03_PNG = 0x00001204, PKG_ENTRY_ID__ICON0_04_PNG = 0x00001205, PKG_ENTRY_ID__ICON0_05_PNG = 0x00001206, PKG_ENTRY_ID__ICON0_06_PNG = 0x00001207, PKG_ENTRY_ID__ICON0_07_PNG = 0x00001208, PKG_ENTRY_ID__ICON0_08_PNG = 0x00001209, PKG_ENTRY_ID__ICON0_09_PNG = 0x0000120A, PKG_ENTRY_ID__ICON0_10_PNG = 0x0000120B, PKG_ENTRY_ID__ICON0_11_PNG = 0x0000120C, PKG_ENTRY_ID__ICON0_12_PNG = 0x0000120D, PKG_ENTRY_ID__ICON0_13_PNG = 0x0000120E, PKG_ENTRY_ID__ICON0_14_PNG = 0x0000120F, PKG_ENTRY_ID__ICON0_15_PNG = 0x00001210, PKG_ENTRY_ID__ICON0_16_PNG = 0x00001211, PKG_ENTRY_ID__ICON0_17_PNG = 0x00001212, PKG_ENTRY_ID__ICON0_18_PNG = 0x00001213, PKG_ENTRY_ID__ICON0_19_PNG = 0x00001214, PKG_ENTRY_ID__ICON0_20_PNG = 0x00001215, PKG_ENTRY_ID__ICON0_21_PNG = 0x00001216, PKG_ENTRY_ID__ICON0_22_PNG = 0x00001217, PKG_ENTRY_ID__ICON0_23_PNG = 0x00001218, PKG_ENTRY_ID__ICON0_24_PNG = 0x00001219, PKG_ENTRY_ID__ICON0_25_PNG = 0x0000121A, PKG_ENTRY_ID__ICON0_26_PNG = 0x0000121B, PKG_ENTRY_ID__ICON0_27_PNG = 0x0000121C, PKG_ENTRY_ID__ICON0_28_PNG = 0x0000121D, PKG_ENTRY_ID__ICON0_29_PNG = 0x0000121E, PKG_ENTRY_ID__ICON0_30_PNG = 0x0000121F, PKG_ENTRY_ID__PIC0_PNG = 0x00001220, PKG_ENTRY_ID__SND0_AT9 = 0x00001240, PKG_ENTRY_ID__PIC1_00_PNG = 0x00001241, PKG_ENTRY_ID__PIC1_01_PNG = 0x00001242, PKG_ENTRY_ID__PIC1_02_PNG = 0x00001243, PKG_ENTRY_ID__PIC1_03_PNG = 0x00001244, PKG_ENTRY_ID__PIC1_04_PNG = 0x00001245, PKG_ENTRY_ID__PIC1_05_PNG = 0x00001246, PKG_ENTRY_ID__PIC1_06_PNG = 0x00001247, PKG_ENTRY_ID__PIC1_07_PNG = 0x00001248, PKG_ENTRY_ID__PIC1_08_PNG = 0x00001249, PKG_ENTRY_ID__PIC1_09_PNG = 0x0000124A, PKG_ENTRY_ID__PIC1_10_PNG = 0x0000124B, PKG_ENTRY_ID__PIC1_11_PNG = 0x0000124C, PKG_ENTRY_ID__PIC1_12_PNG = 0x0000124D, PKG_ENTRY_ID__PIC1_13_PNG = 0x0000124E, PKG_ENTRY_ID__PIC1_14_PNG = 0x0000124F, PKG_ENTRY_ID__PIC1_15_PNG = 0x00001250, PKG_ENTRY_ID__PIC1_16_PNG = 0x00001251, PKG_ENTRY_ID__PIC1_17_PNG = 0x00001252, PKG_ENTRY_ID__PIC1_18_PNG = 0x00001253, PKG_ENTRY_ID__PIC1_19_PNG = 0x00001254, PKG_ENTRY_ID__PIC1_20_PNG = 0x00001255, PKG_ENTRY_ID__PIC1_21_PNG = 0x00001256, PKG_ENTRY_ID__PIC1_22_PNG = 0x00001257, PKG_ENTRY_ID__PIC1_23_PNG = 0x00001258, PKG_ENTRY_ID__PIC1_24_PNG = 0x00001259, PKG_ENTRY_ID__PIC1_25_PNG = 0x0000125A, PKG_ENTRY_ID__PIC1_26_PNG = 0x0000125B, PKG_ENTRY_ID__PIC1_27_PNG = 0x0000125C, PKG_ENTRY_ID__PIC1_28_PNG = 0x0000125D, PKG_ENTRY_ID__PIC1_29_PNG = 0x0000125E, PKG_ENTRY_ID__PIC1_30_PNG = 0x0000125F, PKG_ENTRY_ID__CHANGEINFO__CHANGEINFO_XML = 0x00001260, PKG_ENTRY_ID__CHANGEINFO__CHANGEINFO_00_XML = 0x00001261, PKG_ENTRY_ID__CHANGEINFO__CHANGEINFO_01_XML = 0x00001262, PKG_ENTRY_ID__CHANGEINFO__CHANGEINFO_02_XML = 0x00001263, PKG_ENTRY_ID__CHANGEINFO__CHANGEINFO_03_XML = 0x00001264, PKG_ENTRY_ID__CHANGEINFO__CHANGEINFO_04_XML = 0x00001265, PKG_ENTRY_ID__CHANGEINFO__CHANGEINFO_05_XML = 0x00001266, PKG_ENTRY_ID__CHANGEINFO__CHANGEINFO_06_XML = 0x00001267, PKG_ENTRY_ID__CHANGEINFO__CHANGEINFO_07_XML = 0x00001268, PKG_ENTRY_ID__CHANGEINFO__CHANGEINFO_08_XML = 0x00001269, PKG_ENTRY_ID__CHANGEINFO__CHANGEINFO_09_XML = 0x0000126A, PKG_ENTRY_ID__CHANGEINFO__CHANGEINFO_10_XML = 0x0000126B, PKG_ENTRY_ID__CHANGEINFO__CHANGEINFO_11_XML = 0x0000126C, PKG_ENTRY_ID__CHANGEINFO__CHANGEINFO_12_XML = 0x0000126D, PKG_ENTRY_ID__CHANGEINFO__CHANGEINFO_13_XML = 0x0000126E, PKG_ENTRY_ID__CHANGEINFO__CHANGEINFO_14_XML = 0x0000126F, PKG_ENTRY_ID__CHANGEINFO__CHANGEINFO_15_XML = 0x00001270, PKG_ENTRY_ID__CHANGEINFO__CHANGEINFO_16_XML = 0x00001271, PKG_ENTRY_ID__CHANGEINFO__CHANGEINFO_17_XML = 0x00001272, PKG_ENTRY_ID__CHANGEINFO__CHANGEINFO_18_XML = 0x00001273, PKG_ENTRY_ID__CHANGEINFO__CHANGEINFO_19_XML = 0x00001274, PKG_ENTRY_ID__CHANGEINFO__CHANGEINFO_20_XML = 0x00001275, PKG_ENTRY_ID__CHANGEINFO__CHANGEINFO_21_XML = 0x00001276, PKG_ENTRY_ID__CHANGEINFO__CHANGEINFO_22_XML = 0x00001277, PKG_ENTRY_ID__CHANGEINFO__CHANGEINFO_23_XML = 0x00001278, PKG_ENTRY_ID__CHANGEINFO__CHANGEINFO_24_XML = 0x00001279, PKG_ENTRY_ID__CHANGEINFO__CHANGEINFO_25_XML = 0x0000127A, PKG_ENTRY_ID__CHANGEINFO__CHANGEINFO_26_XML = 0x0000127B, PKG_ENTRY_ID__CHANGEINFO__CHANGEINFO_27_XML = 0x0000127C, PKG_ENTRY_ID__CHANGEINFO__CHANGEINFO_28_XML = 0x0000127D, PKG_ENTRY_ID__CHANGEINFO__CHANGEINFO_29_XML = 0x0000127E, PKG_ENTRY_ID__CHANGEINFO__CHANGEINFO_30_XML = 0x0000127F, PKG_ENTRY_ID__ICON0_DDS = 0x00001280, PKG_ENTRY_ID__ICON0_00_DDS = 0x00001281, PKG_ENTRY_ID__ICON0_01_DDS = 0x00001282, PKG_ENTRY_ID__ICON0_02_DDS = 0x00001283, PKG_ENTRY_ID__ICON0_03_DDS = 0x00001284, PKG_ENTRY_ID__ICON0_04_DDS = 0x00001285, PKG_ENTRY_ID__ICON0_05_DDS = 0x00001286, PKG_ENTRY_ID__ICON0_06_DDS = 0x00001287, PKG_ENTRY_ID__ICON0_07_DDS = 0x00001288, PKG_ENTRY_ID__ICON0_08_DDS = 0x00001289, PKG_ENTRY_ID__ICON0_09_DDS = 0x0000128A, PKG_ENTRY_ID__ICON0_10_DDS = 0x0000128B, PKG_ENTRY_ID__ICON0_11_DDS = 0x0000128C, PKG_ENTRY_ID__ICON0_12_DDS = 0x0000128D, PKG_ENTRY_ID__ICON0_13_DDS = 0x0000128E, PKG_ENTRY_ID__ICON0_14_DDS = 0x0000128F, PKG_ENTRY_ID__ICON0_15_DDS = 0x00001290, PKG_ENTRY_ID__ICON0_16_DDS = 0x00001291, PKG_ENTRY_ID__ICON0_17_DDS = 0x00001292, PKG_ENTRY_ID__ICON0_18_DDS = 0x00001293, PKG_ENTRY_ID__ICON0_19_DDS = 0x00001294, PKG_ENTRY_ID__ICON0_20_DDS = 0x00001295, PKG_ENTRY_ID__ICON0_21_DDS = 0x00001296, PKG_ENTRY_ID__ICON0_22_DDS = 0x00001297, PKG_ENTRY_ID__ICON0_23_DDS = 0x00001298, PKG_ENTRY_ID__ICON0_24_DDS = 0x00001299, PKG_ENTRY_ID__ICON0_25_DDS = 0x0000129A, PKG_ENTRY_ID__ICON0_26_DDS = 0x0000129B, PKG_ENTRY_ID__ICON0_27_DDS = 0x0000129C, PKG_ENTRY_ID__ICON0_28_DDS = 0x0000129D, PKG_ENTRY_ID__ICON0_29_DDS = 0x0000129E, PKG_ENTRY_ID__ICON0_30_DDS = 0x0000129F, PKG_ENTRY_ID__PIC0_DDS = 0x000012A0, PKG_ENTRY_ID__PIC1_DDS = 0x000012C0, PKG_ENTRY_ID__PIC1_00_DDS = 0x000012C1, PKG_ENTRY_ID__PIC1_01_DDS = 0x000012C2, PKG_ENTRY_ID__PIC1_02_DDS = 0x000012C3, PKG_ENTRY_ID__PIC1_03_DDS = 0x000012C4, PKG_ENTRY_ID__PIC1_04_DDS = 0x000012C5, PKG_ENTRY_ID__PIC1_05_DDS = 0x000012C6, PKG_ENTRY_ID__PIC1_06_DDS = 0x000012C7, PKG_ENTRY_ID__PIC1_07_DDS = 0x000012C8, PKG_ENTRY_ID__PIC1_08_DDS = 0x000012C9, PKG_ENTRY_ID__PIC1_09_DDS = 0x000012CA, PKG_ENTRY_ID__PIC1_10_DDS = 0x000012CB, PKG_ENTRY_ID__PIC1_11_DDS = 0x000012CC, PKG_ENTRY_ID__PIC1_12_DDS = 0x000012CD, PKG_ENTRY_ID__PIC1_13_DDS = 0x000012CE, PKG_ENTRY_ID__PIC1_14_DDS = 0x000012CF, PKG_ENTRY_ID__PIC1_15_DDS = 0x000012D0, PKG_ENTRY_ID__PIC1_16_DDS = 0x000012D1, PKG_ENTRY_ID__PIC1_17_DDS = 0x000012D2, PKG_ENTRY_ID__PIC1_18_DDS = 0x000012D3, PKG_ENTRY_ID__PIC1_19_DDS = 0x000012D4, PKG_ENTRY_ID__PIC1_20_DDS = 0x000012D5, PKG_ENTRY_ID__PIC1_21_DDS = 0x000012D6, PKG_ENTRY_ID__PIC1_22_DDS = 0x000012D7, PKG_ENTRY_ID__PIC1_23_DDS = 0x000012D8, PKG_ENTRY_ID__PIC1_24_DDS = 0x000012D9, PKG_ENTRY_ID__PIC1_25_DDS = 0x000012DA, PKG_ENTRY_ID__PIC1_26_DDS = 0x000012DB, PKG_ENTRY_ID__PIC1_27_DDS = 0x000012DC, PKG_ENTRY_ID__PIC1_28_DDS = 0x000012DD, PKG_ENTRY_ID__PIC1_29_DDS = 0x000012DE, PKG_ENTRY_ID__PIC1_30_DDS = 0x000012DF, PKG_ENTRY_ID__TROPHY__TROPHY00_TRP = 0x00001400, PKG_ENTRY_ID__TROPHY__TROPHY01_TRP = 0x00001401, PKG_ENTRY_ID__TROPHY__TROPHY02_TRP = 0x00001402, PKG_ENTRY_ID__TROPHY__TROPHY03_TRP = 0x00001403, PKG_ENTRY_ID__TROPHY__TROPHY04_TRP = 0x00001404, PKG_ENTRY_ID__TROPHY__TROPHY05_TRP = 0x00001405, PKG_ENTRY_ID__TROPHY__TROPHY06_TRP = 0x00001406, PKG_ENTRY_ID__TROPHY__TROPHY07_TRP = 0x00001407, PKG_ENTRY_ID__TROPHY__TROPHY08_TRP = 0x00001408, PKG_ENTRY_ID__TROPHY__TROPHY09_TRP = 0x00001409, PKG_ENTRY_ID__TROPHY__TROPHY10_TRP = 0x0000140A, PKG_ENTRY_ID__TROPHY__TROPHY11_TRP = 0x0000140B, PKG_ENTRY_ID__TROPHY__TROPHY12_TRP = 0x0000140C, PKG_ENTRY_ID__TROPHY__TROPHY13_TRP = 0x0000140D, PKG_ENTRY_ID__TROPHY__TROPHY14_TRP = 0x0000140E, PKG_ENTRY_ID__TROPHY__TROPHY15_TRP = 0x0000140F, PKG_ENTRY_ID__TROPHY__TROPHY16_TRP = 0x00001410, PKG_ENTRY_ID__TROPHY__TROPHY17_TRP = 0x00001411, PKG_ENTRY_ID__TROPHY__TROPHY18_TRP = 0x00001412, PKG_ENTRY_ID__TROPHY__TROPHY19_TRP = 0x00001413, PKG_ENTRY_ID__TROPHY__TROPHY20_TRP = 0x00001414, PKG_ENTRY_ID__TROPHY__TROPHY21_TRP = 0x00001415, PKG_ENTRY_ID__TROPHY__TROPHY22_TRP = 0x00001416, PKG_ENTRY_ID__TROPHY__TROPHY23_TRP = 0x00001417, PKG_ENTRY_ID__TROPHY__TROPHY24_TRP = 0x00001418, PKG_ENTRY_ID__TROPHY__TROPHY25_TRP = 0x00001419, PKG_ENTRY_ID__TROPHY__TROPHY26_TRP = 0x0000141A, PKG_ENTRY_ID__TROPHY__TROPHY27_TRP = 0x0000141B, PKG_ENTRY_ID__TROPHY__TROPHY28_TRP = 0x0000141C, PKG_ENTRY_ID__TROPHY__TROPHY29_TRP = 0x0000141D, PKG_ENTRY_ID__TROPHY__TROPHY30_TRP = 0x0000141E, PKG_ENTRY_ID__TROPHY__TROPHY31_TRP = 0x0000141F, PKG_ENTRY_ID__TROPHY__TROPHY32_TRP = 0x00001420, PKG_ENTRY_ID__TROPHY__TROPHY33_TRP = 0x00001421, PKG_ENTRY_ID__TROPHY__TROPHY34_TRP = 0x00001422, PKG_ENTRY_ID__TROPHY__TROPHY35_TRP = 0x00001423, PKG_ENTRY_ID__TROPHY__TROPHY36_TRP = 0x00001424, PKG_ENTRY_ID__TROPHY__TROPHY37_TRP = 0x00001425, PKG_ENTRY_ID__TROPHY__TROPHY38_TRP = 0x00001426, PKG_ENTRY_ID__TROPHY__TROPHY39_TRP = 0x00001427, PKG_ENTRY_ID__TROPHY__TROPHY40_TRP = 0x00001428, PKG_ENTRY_ID__TROPHY__TROPHY41_TRP = 0x00001429, PKG_ENTRY_ID__TROPHY__TROPHY42_TRP = 0x0000142A, PKG_ENTRY_ID__TROPHY__TROPHY43_TRP = 0x0000142B, PKG_ENTRY_ID__TROPHY__TROPHY44_TRP = 0x0000142C, PKG_ENTRY_ID__TROPHY__TROPHY45_TRP = 0x0000142D, PKG_ENTRY_ID__TROPHY__TROPHY46_TRP = 0x0000142E, PKG_ENTRY_ID__TROPHY__TROPHY47_TRP = 0x0000142F, PKG_ENTRY_ID__TROPHY__TROPHY48_TRP = 0x00001430, PKG_ENTRY_ID__TROPHY__TROPHY49_TRP = 0x00001431, PKG_ENTRY_ID__TROPHY__TROPHY50_TRP = 0x00001432, PKG_ENTRY_ID__TROPHY__TROPHY51_TRP = 0x00001433, PKG_ENTRY_ID__TROPHY__TROPHY52_TRP = 0x00001434, PKG_ENTRY_ID__TROPHY__TROPHY53_TRP = 0x00001435, PKG_ENTRY_ID__TROPHY__TROPHY54_TRP = 0x00001436, PKG_ENTRY_ID__TROPHY__TROPHY55_TRP = 0x00001437, PKG_ENTRY_ID__TROPHY__TROPHY56_TRP = 0x00001438, PKG_ENTRY_ID__TROPHY__TROPHY57_TRP = 0x00001439, PKG_ENTRY_ID__TROPHY__TROPHY58_TRP = 0x0000143A, PKG_ENTRY_ID__TROPHY__TROPHY59_TRP = 0x0000143B, PKG_ENTRY_ID__TROPHY__TROPHY60_TRP = 0x0000143C, PKG_ENTRY_ID__TROPHY__TROPHY61_TRP = 0x0000143D, PKG_ENTRY_ID__TROPHY__TROPHY62_TRP = 0x0000143E, PKG_ENTRY_ID__TROPHY__TROPHY63_TRP = 0x0000143F, PKG_ENTRY_ID__TROPHY__TROPHY64_TRP = 0x00001440, PKG_ENTRY_ID__TROPHY__TROPHY65_TRP = 0x00001441, PKG_ENTRY_ID__TROPHY__TROPHY66_TRP = 0x00001442, PKG_ENTRY_ID__TROPHY__TROPHY67_TRP = 0x00001443, PKG_ENTRY_ID__TROPHY__TROPHY68_TRP = 0x00001444, PKG_ENTRY_ID__TROPHY__TROPHY69_TRP = 0x00001445, PKG_ENTRY_ID__TROPHY__TROPHY70_TRP = 0x00001446, PKG_ENTRY_ID__TROPHY__TROPHY71_TRP = 0x00001447, PKG_ENTRY_ID__TROPHY__TROPHY72_TRP = 0x00001448, PKG_ENTRY_ID__TROPHY__TROPHY73_TRP = 0x00001449, PKG_ENTRY_ID__TROPHY__TROPHY74_TRP = 0x0000144A, PKG_ENTRY_ID__TROPHY__TROPHY75_TRP = 0x0000144B, PKG_ENTRY_ID__TROPHY__TROPHY76_TRP = 0x0000144C, PKG_ENTRY_ID__TROPHY__TROPHY77_TRP = 0x0000144D, PKG_ENTRY_ID__TROPHY__TROPHY78_TRP = 0x0000144E, PKG_ENTRY_ID__TROPHY__TROPHY79_TRP = 0x0000144F, PKG_ENTRY_ID__TROPHY__TROPHY80_TRP = 0x00001450, PKG_ENTRY_ID__TROPHY__TROPHY81_TRP = 0x00001451, PKG_ENTRY_ID__TROPHY__TROPHY82_TRP = 0x00001452, PKG_ENTRY_ID__TROPHY__TROPHY83_TRP = 0x00001453, PKG_ENTRY_ID__TROPHY__TROPHY84_TRP = 0x00001454, PKG_ENTRY_ID__TROPHY__TROPHY85_TRP = 0x00001455, PKG_ENTRY_ID__TROPHY__TROPHY86_TRP = 0x00001456, PKG_ENTRY_ID__TROPHY__TROPHY87_TRP = 0x00001457, PKG_ENTRY_ID__TROPHY__TROPHY88_TRP = 0x00001458, PKG_ENTRY_ID__TROPHY__TROPHY89_TRP = 0x00001459, PKG_ENTRY_ID__TROPHY__TROPHY90_TRP = 0x0000145A, PKG_ENTRY_ID__TROPHY__TROPHY91_TRP = 0x0000145B, PKG_ENTRY_ID__TROPHY__TROPHY92_TRP = 0x0000145C, PKG_ENTRY_ID__TROPHY__TROPHY93_TRP = 0x0000145D, PKG_ENTRY_ID__TROPHY__TROPHY94_TRP = 0x0000145E, PKG_ENTRY_ID__TROPHY__TROPHY95_TRP = 0x0000145F, PKG_ENTRY_ID__TROPHY__TROPHY96_TRP = 0x00001460, PKG_ENTRY_ID__TROPHY__TROPHY97_TRP = 0x00001461, PKG_ENTRY_ID__TROPHY__TROPHY98_TRP = 0x00001462, PKG_ENTRY_ID__TROPHY__TROPHY99_TRP = 0x00001463, PKG_ENTRY_ID__KEYMAP_RP__001_PNG = 0x00001600, PKG_ENTRY_ID__KEYMAP_RP__002_PNG = 0x00001601, PKG_ENTRY_ID__KEYMAP_RP__003_PNG = 0x00001602, PKG_ENTRY_ID__KEYMAP_RP__004_PNG = 0x00001603, PKG_ENTRY_ID__KEYMAP_RP__005_PNG = 0x00001604, PKG_ENTRY_ID__KEYMAP_RP__006_PNG = 0x00001605, PKG_ENTRY_ID__KEYMAP_RP__007_PNG = 0x00001606, PKG_ENTRY_ID__KEYMAP_RP__008_PNG = 0x00001607, PKG_ENTRY_ID__KEYMAP_RP__009_PNG = 0x00001608, PKG_ENTRY_ID__KEYMAP_RP__010_PNG = 0x00001609, PKG_ENTRY_ID__KEYMAP_RP__00__001_PNG = 0x00001610, PKG_ENTRY_ID__KEYMAP_RP__00__002_PNG = 0x00001611, PKG_ENTRY_ID__KEYMAP_RP__00__003_PNG = 0x00001612, PKG_ENTRY_ID__KEYMAP_RP__00__004_PNG = 0x00001613, PKG_ENTRY_ID__KEYMAP_RP__00__005_PNG = 0x00001614, PKG_ENTRY_ID__KEYMAP_RP__00__006_PNG = 0x00001615, PKG_ENTRY_ID__KEYMAP_RP__00__007_PNG = 0x00001616, PKG_ENTRY_ID__KEYMAP_RP__00__008_PNG = 0x00001617, PKG_ENTRY_ID__KEYMAP_RP__00__009_PNG = 0x00001618, PKG_ENTRY_ID__KEYMAP_RP__00__010_PNG = 0x00001619, PKG_ENTRY_ID__KEYMAP_RP__01__001_PNG = 0x00001620, PKG_ENTRY_ID__KEYMAP_RP__01__002_PNG = 0x00001621, PKG_ENTRY_ID__KEYMAP_RP__01__003_PNG = 0x00001622, PKG_ENTRY_ID__KEYMAP_RP__01__004_PNG = 0x00001623, PKG_ENTRY_ID__KEYMAP_RP__01__005_PNG = 0x00001624, PKG_ENTRY_ID__KEYMAP_RP__01__006_PNG = 0x00001625, PKG_ENTRY_ID__KEYMAP_RP__01__007_PNG = 0x00001626, PKG_ENTRY_ID__KEYMAP_RP__01__008_PNG = 0x00001627, PKG_ENTRY_ID__KEYMAP_RP__01__009_PNG = 0x00001628, PKG_ENTRY_ID__KEYMAP_RP__01__010_PNG = 0x00001629, PKG_ENTRY_ID__KEYMAP_RP__02__001_PNG = 0x00001630, PKG_ENTRY_ID__KEYMAP_RP__02__002_PNG = 0x00001631, PKG_ENTRY_ID__KEYMAP_RP__02__003_PNG = 0x00001632, PKG_ENTRY_ID__KEYMAP_RP__02__004_PNG = 0x00001633, PKG_ENTRY_ID__KEYMAP_RP__02__005_PNG = 0x00001634, PKG_ENTRY_ID__KEYMAP_RP__02__006_PNG = 0x00001635, PKG_ENTRY_ID__KEYMAP_RP__02__007_PNG = 0x00001636, PKG_ENTRY_ID__KEYMAP_RP__02__008_PNG = 0x00001637, PKG_ENTRY_ID__KEYMAP_RP__02__009_PNG = 0x00001638, PKG_ENTRY_ID__KEYMAP_RP__02__010_PNG = 0x00001639, PKG_ENTRY_ID__KEYMAP_RP__03__001_PNG = 0x00001640, PKG_ENTRY_ID__KEYMAP_RP__03__002_PNG = 0x00001641, PKG_ENTRY_ID__KEYMAP_RP__03__003_PNG = 0x00001642, PKG_ENTRY_ID__KEYMAP_RP__03__004_PNG = 0x00001643, PKG_ENTRY_ID__KEYMAP_RP__03__005_PNG = 0x00001644, PKG_ENTRY_ID__KEYMAP_RP__03__006_PNG = 0x00001645, PKG_ENTRY_ID__KEYMAP_RP__03__007_PNG = 0x00001646, PKG_ENTRY_ID__KEYMAP_RP__03__008_PNG = 0x00001647, PKG_ENTRY_ID__KEYMAP_RP__03__009_PNG = 0x00001648, PKG_ENTRY_ID__KEYMAP_RP__03__010_PNG = 0x00001649, PKG_ENTRY_ID__KEYMAP_RP__04__001_PNG = 0x00001650, PKG_ENTRY_ID__KEYMAP_RP__04__002_PNG = 0x00001651, PKG_ENTRY_ID__KEYMAP_RP__04__003_PNG = 0x00001652, PKG_ENTRY_ID__KEYMAP_RP__04__004_PNG = 0x00001653, PKG_ENTRY_ID__KEYMAP_RP__04__005_PNG = 0x00001654, PKG_ENTRY_ID__KEYMAP_RP__04__006_PNG = 0x00001655, PKG_ENTRY_ID__KEYMAP_RP__04__007_PNG = 0x00001656, PKG_ENTRY_ID__KEYMAP_RP__04__008_PNG = 0x00001657, PKG_ENTRY_ID__KEYMAP_RP__04__009_PNG = 0x00001658, PKG_ENTRY_ID__KEYMAP_RP__04__010_PNG = 0x00001659, PKG_ENTRY_ID__KEYMAP_RP__05__001_PNG = 0x00001660, PKG_ENTRY_ID__KEYMAP_RP__05__002_PNG = 0x00001661, PKG_ENTRY_ID__KEYMAP_RP__05__003_PNG = 0x00001662, PKG_ENTRY_ID__KEYMAP_RP__05__004_PNG = 0x00001663, PKG_ENTRY_ID__KEYMAP_RP__05__005_PNG = 0x00001664, PKG_ENTRY_ID__KEYMAP_RP__05__006_PNG = 0x00001665, PKG_ENTRY_ID__KEYMAP_RP__05__007_PNG = 0x00001666, PKG_ENTRY_ID__KEYMAP_RP__05__008_PNG = 0x00001667, PKG_ENTRY_ID__KEYMAP_RP__05__009_PNG = 0x00001668, PKG_ENTRY_ID__KEYMAP_RP__05__010_PNG = 0x00001669, PKG_ENTRY_ID__KEYMAP_RP__06__001_PNG = 0x00001670, PKG_ENTRY_ID__KEYMAP_RP__06__002_PNG = 0x00001671, PKG_ENTRY_ID__KEYMAP_RP__06__003_PNG = 0x00001672, PKG_ENTRY_ID__KEYMAP_RP__06__004_PNG = 0x00001673, PKG_ENTRY_ID__KEYMAP_RP__06__005_PNG = 0x00001674, PKG_ENTRY_ID__KEYMAP_RP__06__006_PNG = 0x00001675, PKG_ENTRY_ID__KEYMAP_RP__06__007_PNG = 0x00001676, PKG_ENTRY_ID__KEYMAP_RP__06__008_PNG = 0x00001677, PKG_ENTRY_ID__KEYMAP_RP__06__009_PNG = 0x00001678, PKG_ENTRY_ID__KEYMAP_RP__06__010_PNG = 0x00001679, PKG_ENTRY_ID__KEYMAP_RP__07__001_PNG = 0x00001680, PKG_ENTRY_ID__KEYMAP_RP__07__002_PNG = 0x00001681, PKG_ENTRY_ID__KEYMAP_RP__07__003_PNG = 0x00001682, PKG_ENTRY_ID__KEYMAP_RP__07__004_PNG = 0x00001683, PKG_ENTRY_ID__KEYMAP_RP__07__005_PNG = 0x00001684, PKG_ENTRY_ID__KEYMAP_RP__07__006_PNG = 0x00001685, PKG_ENTRY_ID__KEYMAP_RP__07__007_PNG = 0x00001686, PKG_ENTRY_ID__KEYMAP_RP__07__008_PNG = 0x00001687, PKG_ENTRY_ID__KEYMAP_RP__07__009_PNG = 0x00001688, PKG_ENTRY_ID__KEYMAP_RP__07__010_PNG = 0x00001689, PKG_ENTRY_ID__KEYMAP_RP__08__001_PNG = 0x00001690, PKG_ENTRY_ID__KEYMAP_RP__08__002_PNG = 0x00001691, PKG_ENTRY_ID__KEYMAP_RP__08__003_PNG = 0x00001692, PKG_ENTRY_ID__KEYMAP_RP__08__004_PNG = 0x00001693, PKG_ENTRY_ID__KEYMAP_RP__08__005_PNG = 0x00001694, PKG_ENTRY_ID__KEYMAP_RP__08__006_PNG = 0x00001695, PKG_ENTRY_ID__KEYMAP_RP__08__007_PNG = 0x00001696, PKG_ENTRY_ID__KEYMAP_RP__08__008_PNG = 0x00001697, PKG_ENTRY_ID__KEYMAP_RP__08__009_PNG = 0x00001698, PKG_ENTRY_ID__KEYMAP_RP__08__010_PNG = 0x00001699, PKG_ENTRY_ID__KEYMAP_RP__09__001_PNG = 0x000016A0, PKG_ENTRY_ID__KEYMAP_RP__09__002_PNG = 0x000016A1, PKG_ENTRY_ID__KEYMAP_RP__09__003_PNG = 0x000016A2, PKG_ENTRY_ID__KEYMAP_RP__09__004_PNG = 0x000016A3, PKG_ENTRY_ID__KEYMAP_RP__09__005_PNG = 0x000016A4, PKG_ENTRY_ID__KEYMAP_RP__09__006_PNG = 0x000016A5, PKG_ENTRY_ID__KEYMAP_RP__09__007_PNG = 0x000016A6, PKG_ENTRY_ID__KEYMAP_RP__09__008_PNG = 0x000016A7, PKG_ENTRY_ID__KEYMAP_RP__09__009_PNG = 0x000016A8, PKG_ENTRY_ID__KEYMAP_RP__09__010_PNG = 0x000016A9, PKG_ENTRY_ID__KEYMAP_RP__10__001_PNG = 0x000016B0, PKG_ENTRY_ID__KEYMAP_RP__10__002_PNG = 0x000016B1, PKG_ENTRY_ID__KEYMAP_RP__10__003_PNG = 0x000016B2, PKG_ENTRY_ID__KEYMAP_RP__10__004_PNG = 0x000016B3, PKG_ENTRY_ID__KEYMAP_RP__10__005_PNG = 0x000016B4, PKG_ENTRY_ID__KEYMAP_RP__10__006_PNG = 0x000016B5, PKG_ENTRY_ID__KEYMAP_RP__10__007_PNG = 0x000016B6, PKG_ENTRY_ID__KEYMAP_RP__10__008_PNG = 0x000016B7, PKG_ENTRY_ID__KEYMAP_RP__10__009_PNG = 0x000016B8, PKG_ENTRY_ID__KEYMAP_RP__10__010_PNG = 0x000016B9, PKG_ENTRY_ID__KEYMAP_RP__11__001_PNG = 0x000016C0, PKG_ENTRY_ID__KEYMAP_RP__11__002_PNG = 0x000016C1, PKG_ENTRY_ID__KEYMAP_RP__11__003_PNG = 0x000016C2, PKG_ENTRY_ID__KEYMAP_RP__11__004_PNG = 0x000016C3, PKG_ENTRY_ID__KEYMAP_RP__11__005_PNG = 0x000016C4, PKG_ENTRY_ID__KEYMAP_RP__11__006_PNG = 0x000016C5, PKG_ENTRY_ID__KEYMAP_RP__11__007_PNG = 0x000016C6, PKG_ENTRY_ID__KEYMAP_RP__11__008_PNG = 0x000016C7, PKG_ENTRY_ID__KEYMAP_RP__11__009_PNG = 0x000016C8, PKG_ENTRY_ID__KEYMAP_RP__11__010_PNG = 0x000016C9, PKG_ENTRY_ID__KEYMAP_RP__12__001_PNG = 0x000016D0, PKG_ENTRY_ID__KEYMAP_RP__12__002_PNG = 0x000016D1, PKG_ENTRY_ID__KEYMAP_RP__12__003_PNG = 0x000016D2, PKG_ENTRY_ID__KEYMAP_RP__12__004_PNG = 0x000016D3, PKG_ENTRY_ID__KEYMAP_RP__12__005_PNG = 0x000016D4, PKG_ENTRY_ID__KEYMAP_RP__12__006_PNG = 0x000016D5, PKG_ENTRY_ID__KEYMAP_RP__12__007_PNG = 0x000016D6, PKG_ENTRY_ID__KEYMAP_RP__12__008_PNG = 0x000016D7, PKG_ENTRY_ID__KEYMAP_RP__12__009_PNG = 0x000016D8, PKG_ENTRY_ID__KEYMAP_RP__12__010_PNG = 0x000016D9, PKG_ENTRY_ID__KEYMAP_RP__13__001_PNG = 0x000016E0, PKG_ENTRY_ID__KEYMAP_RP__13__002_PNG = 0x000016E1, PKG_ENTRY_ID__KEYMAP_RP__13__003_PNG = 0x000016E2, PKG_ENTRY_ID__KEYMAP_RP__13__004_PNG = 0x000016E3, PKG_ENTRY_ID__KEYMAP_RP__13__005_PNG = 0x000016E4, PKG_ENTRY_ID__KEYMAP_RP__13__006_PNG = 0x000016E5, PKG_ENTRY_ID__KEYMAP_RP__13__007_PNG = 0x000016E6, PKG_ENTRY_ID__KEYMAP_RP__13__008_PNG = 0x000016E7, PKG_ENTRY_ID__KEYMAP_RP__13__009_PNG = 0x000016E8, PKG_ENTRY_ID__KEYMAP_RP__13__010_PNG = 0x000016E9, PKG_ENTRY_ID__KEYMAP_RP__14__001_PNG = 0x000016F0, PKG_ENTRY_ID__KEYMAP_RP__14__002_PNG = 0x000016F1, PKG_ENTRY_ID__KEYMAP_RP__14__003_PNG = 0x000016F2, PKG_ENTRY_ID__KEYMAP_RP__14__004_PNG = 0x000016F3, PKG_ENTRY_ID__KEYMAP_RP__14__005_PNG = 0x000016F4, PKG_ENTRY_ID__KEYMAP_RP__14__006_PNG = 0x000016F5, PKG_ENTRY_ID__KEYMAP_RP__14__007_PNG = 0x000016F6, PKG_ENTRY_ID__KEYMAP_RP__14__008_PNG = 0x000016F7, PKG_ENTRY_ID__KEYMAP_RP__14__009_PNG = 0x000016F8, PKG_ENTRY_ID__KEYMAP_RP__14__010_PNG = 0x000016F9, PKG_ENTRY_ID__KEYMAP_RP__15__001_PNG = 0x00001700, PKG_ENTRY_ID__KEYMAP_RP__15__002_PNG = 0x00001701, PKG_ENTRY_ID__KEYMAP_RP__15__003_PNG = 0x00001702, PKG_ENTRY_ID__KEYMAP_RP__15__004_PNG = 0x00001703, PKG_ENTRY_ID__KEYMAP_RP__15__005_PNG = 0x00001704, PKG_ENTRY_ID__KEYMAP_RP__15__006_PNG = 0x00001705, PKG_ENTRY_ID__KEYMAP_RP__15__007_PNG = 0x00001706, PKG_ENTRY_ID__KEYMAP_RP__15__008_PNG = 0x00001707, PKG_ENTRY_ID__KEYMAP_RP__15__009_PNG = 0x00001708, PKG_ENTRY_ID__KEYMAP_RP__15__010_PNG = 0x00001709, PKG_ENTRY_ID__KEYMAP_RP__16__001_PNG = 0x00001710, PKG_ENTRY_ID__KEYMAP_RP__16__002_PNG = 0x00001711, PKG_ENTRY_ID__KEYMAP_RP__16__003_PNG = 0x00001712, PKG_ENTRY_ID__KEYMAP_RP__16__004_PNG = 0x00001713, PKG_ENTRY_ID__KEYMAP_RP__16__005_PNG = 0x00001714, PKG_ENTRY_ID__KEYMAP_RP__16__006_PNG = 0x00001715, PKG_ENTRY_ID__KEYMAP_RP__16__007_PNG = 0x00001716, PKG_ENTRY_ID__KEYMAP_RP__16__008_PNG = 0x00001717, PKG_ENTRY_ID__KEYMAP_RP__16__009_PNG = 0x00001718, PKG_ENTRY_ID__KEYMAP_RP__16__010_PNG = 0x00001719, PKG_ENTRY_ID__KEYMAP_RP__17__001_PNG = 0x00001720, PKG_ENTRY_ID__KEYMAP_RP__17__002_PNG = 0x00001721, PKG_ENTRY_ID__KEYMAP_RP__17__003_PNG = 0x00001722, PKG_ENTRY_ID__KEYMAP_RP__17__004_PNG = 0x00001723, PKG_ENTRY_ID__KEYMAP_RP__17__005_PNG = 0x00001724, PKG_ENTRY_ID__KEYMAP_RP__17__006_PNG = 0x00001725, PKG_ENTRY_ID__KEYMAP_RP__17__007_PNG = 0x00001726, PKG_ENTRY_ID__KEYMAP_RP__17__008_PNG = 0x00001727, PKG_ENTRY_ID__KEYMAP_RP__17__009_PNG = 0x00001728, PKG_ENTRY_ID__KEYMAP_RP__17__010_PNG = 0x00001729, PKG_ENTRY_ID__KEYMAP_RP__18__001_PNG = 0x00001730, PKG_ENTRY_ID__KEYMAP_RP__18__002_PNG = 0x00001731, PKG_ENTRY_ID__KEYMAP_RP__18__003_PNG = 0x00001732, PKG_ENTRY_ID__KEYMAP_RP__18__004_PNG = 0x00001733, PKG_ENTRY_ID__KEYMAP_RP__18__005_PNG = 0x00001734, PKG_ENTRY_ID__KEYMAP_RP__18__006_PNG = 0x00001735, PKG_ENTRY_ID__KEYMAP_RP__18__007_PNG = 0x00001736, PKG_ENTRY_ID__KEYMAP_RP__18__008_PNG = 0x00001737, PKG_ENTRY_ID__KEYMAP_RP__18__009_PNG = 0x00001738, PKG_ENTRY_ID__KEYMAP_RP__18__010_PNG = 0x00001739, PKG_ENTRY_ID__KEYMAP_RP__19__001_PNG = 0x00001740, PKG_ENTRY_ID__KEYMAP_RP__19__002_PNG = 0x00001741, PKG_ENTRY_ID__KEYMAP_RP__19__003_PNG = 0x00001742, PKG_ENTRY_ID__KEYMAP_RP__19__004_PNG = 0x00001743, PKG_ENTRY_ID__KEYMAP_RP__19__005_PNG = 0x00001744, PKG_ENTRY_ID__KEYMAP_RP__19__006_PNG = 0x00001745, PKG_ENTRY_ID__KEYMAP_RP__19__007_PNG = 0x00001746, PKG_ENTRY_ID__KEYMAP_RP__19__008_PNG = 0x00001747, PKG_ENTRY_ID__KEYMAP_RP__19__009_PNG = 0x00001748, PKG_ENTRY_ID__KEYMAP_RP__19__010_PNG = 0x00001749, PKG_ENTRY_ID__KEYMAP_RP__20__001_PNG = 0x00001750, PKG_ENTRY_ID__KEYMAP_RP__20__002_PNG = 0x00001751, PKG_ENTRY_ID__KEYMAP_RP__20__003_PNG = 0x00001752, PKG_ENTRY_ID__KEYMAP_RP__20__004_PNG = 0x00001753, PKG_ENTRY_ID__KEYMAP_RP__20__005_PNG = 0x00001754, PKG_ENTRY_ID__KEYMAP_RP__20__006_PNG = 0x00001755, PKG_ENTRY_ID__KEYMAP_RP__20__007_PNG = 0x00001756, PKG_ENTRY_ID__KEYMAP_RP__20__008_PNG = 0x00001757, PKG_ENTRY_ID__KEYMAP_RP__20__009_PNG = 0x00001758, PKG_ENTRY_ID__KEYMAP_RP__20__010_PNG = 0x00001759, PKG_ENTRY_ID__KEYMAP_RP__21__001_PNG = 0x00001760, PKG_ENTRY_ID__KEYMAP_RP__21__002_PNG = 0x00001761, PKG_ENTRY_ID__KEYMAP_RP__21__003_PNG = 0x00001762, PKG_ENTRY_ID__KEYMAP_RP__21__004_PNG = 0x00001763, PKG_ENTRY_ID__KEYMAP_RP__21__005_PNG = 0x00001764, PKG_ENTRY_ID__KEYMAP_RP__21__006_PNG = 0x00001765, PKG_ENTRY_ID__KEYMAP_RP__21__007_PNG = 0x00001766, PKG_ENTRY_ID__KEYMAP_RP__21__008_PNG = 0x00001767, PKG_ENTRY_ID__KEYMAP_RP__21__009_PNG = 0x00001768, PKG_ENTRY_ID__KEYMAP_RP__21__010_PNG = 0x00001769, PKG_ENTRY_ID__KEYMAP_RP__22__001_PNG = 0x00001770, PKG_ENTRY_ID__KEYMAP_RP__22__002_PNG = 0x00001771, PKG_ENTRY_ID__KEYMAP_RP__22__003_PNG = 0x00001772, PKG_ENTRY_ID__KEYMAP_RP__22__004_PNG = 0x00001773, PKG_ENTRY_ID__KEYMAP_RP__22__005_PNG = 0x00001774, PKG_ENTRY_ID__KEYMAP_RP__22__006_PNG = 0x00001775, PKG_ENTRY_ID__KEYMAP_RP__22__007_PNG = 0x00001776, PKG_ENTRY_ID__KEYMAP_RP__22__008_PNG = 0x00001777, PKG_ENTRY_ID__KEYMAP_RP__22__009_PNG = 0x00001778, PKG_ENTRY_ID__KEYMAP_RP__22__010_PNG = 0x00001779, PKG_ENTRY_ID__KEYMAP_RP__23__001_PNG = 0x00001780, PKG_ENTRY_ID__KEYMAP_RP__23__002_PNG = 0x00001781, PKG_ENTRY_ID__KEYMAP_RP__23__003_PNG = 0x00001782, PKG_ENTRY_ID__KEYMAP_RP__23__004_PNG = 0x00001783, PKG_ENTRY_ID__KEYMAP_RP__23__005_PNG = 0x00001784, PKG_ENTRY_ID__KEYMAP_RP__23__006_PNG = 0x00001785, PKG_ENTRY_ID__KEYMAP_RP__23__007_PNG = 0x00001786, PKG_ENTRY_ID__KEYMAP_RP__23__008_PNG = 0x00001787, PKG_ENTRY_ID__KEYMAP_RP__23__009_PNG = 0x00001788, PKG_ENTRY_ID__KEYMAP_RP__23__010_PNG = 0x00001789, PKG_ENTRY_ID__KEYMAP_RP__24__001_PNG = 0x00001790, PKG_ENTRY_ID__KEYMAP_RP__24__002_PNG = 0x00001791, PKG_ENTRY_ID__KEYMAP_RP__24__003_PNG = 0x00001792, PKG_ENTRY_ID__KEYMAP_RP__24__004_PNG = 0x00001793, PKG_ENTRY_ID__KEYMAP_RP__24__005_PNG = 0x00001794, PKG_ENTRY_ID__KEYMAP_RP__24__006_PNG = 0x00001795, PKG_ENTRY_ID__KEYMAP_RP__24__007_PNG = 0x00001796, PKG_ENTRY_ID__KEYMAP_RP__24__008_PNG = 0x00001797, PKG_ENTRY_ID__KEYMAP_RP__24__009_PNG = 0x00001798, PKG_ENTRY_ID__KEYMAP_RP__24__010_PNG = 0x00001799, PKG_ENTRY_ID__KEYMAP_RP__25__001_PNG = 0x000017A0, PKG_ENTRY_ID__KEYMAP_RP__25__002_PNG = 0x000017A1, PKG_ENTRY_ID__KEYMAP_RP__25__003_PNG = 0x000017A2, PKG_ENTRY_ID__KEYMAP_RP__25__004_PNG = 0x000017A3, PKG_ENTRY_ID__KEYMAP_RP__25__005_PNG = 0x000017A4, PKG_ENTRY_ID__KEYMAP_RP__25__006_PNG = 0x000017A5, PKG_ENTRY_ID__KEYMAP_RP__25__007_PNG = 0x000017A6, PKG_ENTRY_ID__KEYMAP_RP__25__008_PNG = 0x000017A7, PKG_ENTRY_ID__KEYMAP_RP__25__009_PNG = 0x000017A8, PKG_ENTRY_ID__KEYMAP_RP__25__010_PNG = 0x000017A9, PKG_ENTRY_ID__KEYMAP_RP__26__001_PNG = 0x000017B0, PKG_ENTRY_ID__KEYMAP_RP__26__002_PNG = 0x000017B1, PKG_ENTRY_ID__KEYMAP_RP__26__003_PNG = 0x000017B2, PKG_ENTRY_ID__KEYMAP_RP__26__004_PNG = 0x000017B3, PKG_ENTRY_ID__KEYMAP_RP__26__005_PNG = 0x000017B4, PKG_ENTRY_ID__KEYMAP_RP__26__006_PNG = 0x000017B5, PKG_ENTRY_ID__KEYMAP_RP__26__007_PNG = 0x000017B6, PKG_ENTRY_ID__KEYMAP_RP__26__008_PNG = 0x000017B7, PKG_ENTRY_ID__KEYMAP_RP__26__009_PNG = 0x000017B8, PKG_ENTRY_ID__KEYMAP_RP__26__010_PNG = 0x000017B9, PKG_ENTRY_ID__KEYMAP_RP__27__001_PNG = 0x000017C0, PKG_ENTRY_ID__KEYMAP_RP__27__002_PNG = 0x000017C1, PKG_ENTRY_ID__KEYMAP_RP__27__003_PNG = 0x000017C2, PKG_ENTRY_ID__KEYMAP_RP__27__004_PNG = 0x000017C3, PKG_ENTRY_ID__KEYMAP_RP__27__005_PNG = 0x000017C4, PKG_ENTRY_ID__KEYMAP_RP__27__006_PNG = 0x000017C5, PKG_ENTRY_ID__KEYMAP_RP__27__007_PNG = 0x000017C6, PKG_ENTRY_ID__KEYMAP_RP__27__008_PNG = 0x000017C7, PKG_ENTRY_ID__KEYMAP_RP__27__009_PNG = 0x000017C8, PKG_ENTRY_ID__KEYMAP_RP__27__010_PNG = 0x000017C9, PKG_ENTRY_ID__KEYMAP_RP__28__001_PNG = 0x000017D0, PKG_ENTRY_ID__KEYMAP_RP__28__002_PNG = 0x000017D1, PKG_ENTRY_ID__KEYMAP_RP__28__003_PNG = 0x000017D2, PKG_ENTRY_ID__KEYMAP_RP__28__004_PNG = 0x000017D3, PKG_ENTRY_ID__KEYMAP_RP__28__005_PNG = 0x000017D4, PKG_ENTRY_ID__KEYMAP_RP__28__006_PNG = 0x000017D5, PKG_ENTRY_ID__KEYMAP_RP__28__007_PNG = 0x000017D6, PKG_ENTRY_ID__KEYMAP_RP__28__008_PNG = 0x000017D7, PKG_ENTRY_ID__KEYMAP_RP__28__009_PNG = 0x000017D8, PKG_ENTRY_ID__KEYMAP_RP__28__010_PNG = 0x000017D9, PKG_ENTRY_ID__KEYMAP_RP__29__001_PNG = 0x000017E0, PKG_ENTRY_ID__KEYMAP_RP__29__002_PNG = 0x000017E1, PKG_ENTRY_ID__KEYMAP_RP__29__003_PNG = 0x000017E2, PKG_ENTRY_ID__KEYMAP_RP__29__004_PNG = 0x000017E3, PKG_ENTRY_ID__KEYMAP_RP__29__005_PNG = 0x000017E4, PKG_ENTRY_ID__KEYMAP_RP__29__006_PNG = 0x000017E5, PKG_ENTRY_ID__KEYMAP_RP__29__007_PNG = 0x000017E6, PKG_ENTRY_ID__KEYMAP_RP__29__008_PNG = 0x000017E7, PKG_ENTRY_ID__KEYMAP_RP__29__009_PNG = 0x000017E8, PKG_ENTRY_ID__KEYMAP_RP__29__010_PNG = 0x000017E9, PKG_ENTRY_ID__KEYMAP_RP__30__001_PNG = 0x000017F0, PKG_ENTRY_ID__KEYMAP_RP__30__002_PNG = 0x000017F1, PKG_ENTRY_ID__KEYMAP_RP__30__003_PNG = 0x000017F2, PKG_ENTRY_ID__KEYMAP_RP__30__004_PNG = 0x000017F3, PKG_ENTRY_ID__KEYMAP_RP__30__005_PNG = 0x000017F4, PKG_ENTRY_ID__KEYMAP_RP__30__006_PNG = 0x000017F5, PKG_ENTRY_ID__KEYMAP_RP__30__007_PNG = 0x000017F6, PKG_ENTRY_ID__KEYMAP_RP__30__008_PNG = 0x000017F7, PKG_ENTRY_ID__KEYMAP_RP__30__009_PNG = 0x000017F8, PKG_ENTRY_ID__KEYMAP_RP__30__010_PNG = 0x000017F9, } #endregion #region RSA Signature Keys private static RSAParameters RSA_TOP_SIGNATURE = new RSAParameters() { // TOP_SIGNATURE_PRIVATE_EXPONENT D = new byte[256] { 0x32, 0xD9, 0x03, 0x90, 0x8F, 0xBD, 0xB0, 0x8F, 0x57, 0x2B, 0x28, 0x5E, 0x0B, 0x8D, 0xB3, 0xEA, 0x5C, 0xD1, 0x7E, 0xA8, 0x90, 0x88, 0x8C, 0xDD, 0x6A, 0x80, 0xBB, 0xB1, 0xDF, 0xC1, 0xF7, 0x0D, 0xAA, 0x32, 0xF0, 0xB7, 0x7C, 0xCB, 0x88, 0x80, 0x0E, 0x8B, 0x64, 0xB0, 0xBE, 0x4C, 0xD6, 0x0E, 0x9B, 0x8C, 0x1E, 0x2A, 0x64, 0xE1, 0xF3, 0x5C, 0xD7, 0x76, 0x01, 0x41, 0x5E, 0x93, 0x5C, 0x94, 0xFE, 0xDD, 0x46, 0x62, 0xC3, 0x1B, 0x5A, 0xE2, 0xA0, 0xBC, 0x2D, 0xEB, 0xC3, 0x98, 0x0A, 0xA7, 0xB7, 0x85, 0x69, 0x70, 0x68, 0x2B, 0x64, 0x4A, 0xB3, 0x1F, 0xCC, 0x7D, 0xDC, 0x7C, 0x26, 0xF4, 0x77, 0xF6, 0x5C, 0xF2, 0xAE, 0x5A, 0x44, 0x2D, 0xD3, 0xAB, 0x16, 0x62, 0x04, 0x19, 0xBA, 0xFB, 0x90, 0xFF, 0xE2, 0x30, 0x50, 0x89, 0x6E, 0xCB, 0x56, 0xB2, 0xEB, 0xC0, 0x91, 0x16, 0x92, 0x5E, 0x30, 0x8E, 0xAE, 0xC7, 0x94, 0x5D, 0xFD, 0x35, 0xE1, 0x20, 0xF8, 0xAD, 0x3E, 0xBC, 0x08, 0xBF, 0xC0, 0x36, 0x74, 0x9F, 0xD5, 0xBB, 0x52, 0x08, 0xFD, 0x06, 0x66, 0xF3, 0x7A, 0xB3, 0x04, 0xF4, 0x75, 0x29, 0x5D, 0xE9, 0x5F, 0xAA, 0x10, 0x30, 0xB2, 0x0F, 0x5A, 0x1A, 0xC1, 0x2A, 0xB3, 0xFE, 0xCB, 0x21, 0xAD, 0x80, 0xEC, 0x8F, 0x20, 0x09, 0x1C, 0xDB, 0xC5, 0x58, 0x94, 0xC2, 0x9C, 0xC6, 0xCE, 0x82, 0x65, 0x3E, 0x57, 0x90, 0xBC, 0xA9, 0x8B, 0x06, 0xB4, 0xF0, 0x72, 0xF6, 0x77, 0xDF, 0x98, 0x64, 0xF1, 0xEC, 0xFE, 0x37, 0x2D, 0xBC, 0xAE, 0x8C, 0x08, 0x81, 0x1F, 0xC3, 0xC9, 0x89, 0x1A, 0xC7, 0x42, 0x82, 0x4B, 0x2E, 0xDC, 0x8E, 0x8D, 0x73, 0xCE, 0xB1, 0xCC, 0x01, 0xD9, 0x08, 0x70, 0x87, 0x3C, 0x44, 0x08, 0xEC, 0x49, 0x8F, 0x81, 0x5A, 0xE2, 0x40, 0xFF, 0x77, 0xFC, 0x0D }, // TOP_SIGNATURE_DMP1 DP = new byte[128] { 0x52, 0xCC, 0x2D, 0xA0, 0x9C, 0x9E, 0x75, 0xE7, 0x28, 0xEE, 0x3D, 0xDE, 0xE3, 0x45, 0xD1, 0x4F, 0x94, 0x1C, 0xCC, 0xC8, 0x87, 0x29, 0x45, 0x3B, 0x8D, 0x6E, 0xAB, 0x6E, 0x2A, 0xA7, 0xC7, 0x15, 0x43, 0xA3, 0x04, 0x8F, 0x90, 0x5F, 0xEB, 0xF3, 0x38, 0x4A, 0x77, 0xFA, 0x36, 0xB7, 0x15, 0x76, 0xB6, 0x01, 0x1A, 0x8E, 0x25, 0x87, 0x82, 0xF1, 0x55, 0xD8, 0xC6, 0x43, 0x2A, 0xC0, 0xE5, 0x98, 0xC9, 0x32, 0xD1, 0x94, 0x6F, 0xD9, 0x01, 0xBA, 0x06, 0x81, 0xE0, 0x6D, 0x88, 0xF2, 0x24, 0x2A, 0x25, 0x01, 0x64, 0x5C, 0xBF, 0xF2, 0xD9, 0x99, 0x67, 0x3E, 0xF6, 0x72, 0xEE, 0xE4, 0xE2, 0x33, 0x5C, 0xF8, 0x00, 0x40, 0xE3, 0x2A, 0x9A, 0xF4, 0x3D, 0x22, 0x86, 0x44, 0x3C, 0xFB, 0x0A, 0xA5, 0x7C, 0x3F, 0xCC, 0xF5, 0xF1, 0x16, 0xC4, 0xAC, 0x88, 0xB4, 0xDE, 0x62, 0x94, 0x92, 0x6A, 0x13 }, // TOP_SIGNATURE_DMQ1 DQ = new byte[128] { 0x7C, 0x9D, 0xAD, 0x39, 0xE0, 0xD5, 0x60, 0x14, 0x94, 0x48, 0x19, 0x7F, 0x88, 0x95, 0xD5, 0x8B, 0x80, 0xAD, 0x85, 0x8A, 0x4B, 0x77, 0x37, 0x85, 0xD0, 0x77, 0xBB, 0xBF, 0x89, 0x71, 0x4A, 0x72, 0xCB, 0x72, 0x68, 0x38, 0xEC, 0x02, 0xC6, 0x7D, 0xC6, 0x44, 0x06, 0x33, 0x51, 0x1C, 0xC0, 0xFF, 0x95, 0x8F, 0x0D, 0x75, 0xDC, 0x25, 0xBB, 0x0B, 0x73, 0x91, 0xA9, 0x6D, 0x42, 0xD8, 0x03, 0xB7, 0x68, 0xD4, 0x1E, 0x75, 0x62, 0xA3, 0x70, 0x35, 0x79, 0x78, 0x00, 0xC8, 0xF5, 0xEF, 0x15, 0xB9, 0xFC, 0x4E, 0x47, 0x5A, 0xC8, 0x70, 0x70, 0x5B, 0x52, 0x98, 0xC0, 0xC2, 0x58, 0x4A, 0x70, 0x96, 0xCC, 0xB8, 0x10, 0xE1, 0x2F, 0x78, 0x8B, 0x2B, 0xA1, 0x7F, 0xF9, 0xAC, 0xDE, 0xF0, 0xBB, 0x2B, 0xE2, 0x66, 0xE3, 0x22, 0x92, 0x31, 0x21, 0x57, 0x92, 0xC4, 0xB8, 0xF2, 0x3E, 0x76, 0x20, 0x37 }, // TOP_SIGNATURE_PUBLIC_EXPONENT Exponent = new byte[4] { 0x00, 0x01, 0x00, 0x01 }, // TOP_SIGNATURE_INVERSEQ - 0000000000640D10 - 0000000000640D8F InverseQ = new byte[128] { 0x45, 0x97, 0x55, 0xD4, 0x22, 0x08, 0x5E, 0xF3, 0x5C, 0xB4, 0x05, 0x7A, 0xFD, 0xAA, 0x42, 0x42, 0xAD, 0x9A, 0x8C, 0xA0, 0x6C, 0xBB, 0x1D, 0x68, 0x54, 0x54, 0x6E, 0x3E, 0x32, 0xE3, 0x53, 0x73, 0x76, 0xF1, 0x3E, 0x01, 0xEA, 0xD3, 0xCF, 0xEB, 0xEB, 0x23, 0x3E, 0xC0, 0xBE, 0xCE, 0xEC, 0x2C, 0x89, 0x5F, 0xA8, 0x27, 0x3A, 0x4C, 0xB7, 0xE6, 0x74, 0xBC, 0x45, 0x4C, 0x26, 0xC8, 0x25, 0xFF, 0x34, 0x63, 0x25, 0x37, 0xE1, 0x48, 0x10, 0xC1, 0x93, 0xA6, 0xAF, 0xEB, 0xBA, 0xE3, 0xA2, 0xF1, 0x3D, 0xEF, 0x63, 0xD8, 0xF4, 0xFD, 0xD3, 0xEE, 0xE2, 0x5D, 0xE9, 0x33, 0xCC, 0xAD, 0xBA, 0x75, 0x5C, 0x85, 0xAF, 0xCE, 0xA9, 0x3D, 0xD1, 0xA2, 0x17, 0xF3, 0xF6, 0x98, 0xB3, 0x50, 0x8E, 0x5E, 0xF6, 0xEB, 0x02, 0x8E, 0xA1, 0x62, 0xA7, 0xD6, 0x2C, 0xEC, 0x91, 0xFF, 0x15, 0x40, 0xD2, 0xE3 }, // TOP_SIGNATURE_MODULUS Modulus = new byte[256] { 0xD2, 0x12, 0xFC, 0x33, 0x5F, 0x6D, 0xDB, 0x83, 0x16, 0x09, 0x62, 0x8B, 0x03, 0x56, 0x27, 0x37, 0x82, 0xD4, 0x77, 0x85, 0x35, 0x29, 0x39, 0x2D, 0x52, 0x6B, 0x8C, 0x4C, 0x8C, 0xFB, 0x06, 0xC1, 0x84, 0x5B, 0xE7, 0xD4, 0xF7, 0xBC, 0xD2, 0x4E, 0x62, 0x45, 0xCD, 0x2A, 0xBB, 0xD7, 0x77, 0x76, 0x45, 0x36, 0x55, 0x27, 0x3F, 0xB3, 0xF5, 0xF9, 0x8E, 0xDA, 0x4B, 0xEF, 0xAA, 0x59, 0xAE, 0xB3, 0x9B, 0xEA, 0x54, 0x98, 0xD2, 0x06, 0x32, 0x6A, 0x58, 0x31, 0x2A, 0xE0, 0xD4, 0x4F, 0x90, 0xB5, 0x0A, 0x7D, 0xEC, 0xF4, 0x3A, 0x9C, 0x52, 0x67, 0x2D, 0x99, 0x31, 0x8E, 0x0C, 0x43, 0xE6, 0x82, 0xFE, 0x07, 0x46, 0xE1, 0x2E, 0x50, 0xD4, 0x1F, 0x2D, 0x2F, 0x7E, 0xD9, 0x08, 0xBA, 0x06, 0xB3, 0xBF, 0x2E, 0x20, 0x3F, 0x4E, 0x3F, 0xFE, 0x44, 0xFF, 0xAA, 0x50, 0x43, 0x57, 0x91, 0x69, 0x94, 0x49, 0x15, 0x82, 0x82, 0xE4, 0x0F, 0x4C, 0x8D, 0x9D, 0x2C, 0xC9, 0x5B, 0x1D, 0x64, 0xBF, 0x88, 0x8B, 0xD4, 0xC5, 0x94, 0xE7, 0x65, 0x47, 0x84, 0x1E, 0xE5, 0x79, 0x10, 0xFB, 0x98, 0x93, 0x47, 0xB9, 0x7D, 0x85, 0x12, 0xA6, 0x40, 0x98, 0x2C, 0xF7, 0x92, 0xBC, 0x95, 0x19, 0x32, 0xED, 0xE8, 0x90, 0x56, 0x0D, 0x65, 0xC1, 0xAA, 0x78, 0xC6, 0x2E, 0x54, 0xFD, 0x5F, 0x54, 0xA1, 0xF6, 0x7E, 0xE5, 0xE0, 0x5F, 0x61, 0xC1, 0x20, 0xB4, 0xB9, 0xB4, 0x33, 0x08, 0x70, 0xE4, 0xDF, 0x89, 0x56, 0xED, 0x01, 0x29, 0x46, 0x77, 0x5F, 0x8C, 0xB8, 0xA9, 0xF5, 0x1E, 0x2E, 0xB3, 0xB9, 0xBF, 0xE0, 0x09, 0xB7, 0x8D, 0x28, 0xD4, 0xA6, 0xC3, 0xB8, 0x1E, 0x1F, 0x07, 0xEB, 0xB4, 0x12, 0x0B, 0x95, 0xB8, 0x85, 0x30, 0xFD, 0xDC, 0x39, 0x13, 0xD0, 0x7C, 0xDC, 0x8F, 0xED, 0xF9, 0xC9, 0xA3, 0xC1 }, // TOP_SIGNATURE_P P = new byte[128] { 0xF9, 0x67, 0xAD, 0x99, 0x12, 0x31, 0x0C, 0x56, 0xA2, 0x2E, 0x16, 0x1C, 0x46, 0xB3, 0x4D, 0x5B, 0x43, 0xBE, 0x42, 0xA2, 0xF6, 0x86, 0x96, 0x80, 0x42, 0xC3, 0xC7, 0x3F, 0xC3, 0x42, 0xF5, 0x87, 0x49, 0x33, 0x9F, 0x07, 0x5D, 0x6E, 0x2C, 0x04, 0xFD, 0xE3, 0xE1, 0xB2, 0xAE, 0x0A, 0x0C, 0xF0, 0xC7, 0xA6, 0x1C, 0xA1, 0x63, 0x50, 0xC8, 0x09, 0x9C, 0x51, 0x24, 0x52, 0x6C, 0x5E, 0x5E, 0xBD, 0x1E, 0x27, 0x06, 0xBB, 0xBC, 0x9E, 0x94, 0xE1, 0x35, 0xD4, 0x6D, 0xB3, 0xCB, 0x3C, 0x68, 0xDD, 0x68, 0xB3, 0xFE, 0x6C, 0xCB, 0x8D, 0x82, 0x20, 0x76, 0x23, 0x63, 0xB7, 0xE9, 0x68, 0x10, 0x01, 0x4E, 0xDC, 0xBA, 0x27, 0x5D, 0x01, 0xC1, 0x2D, 0x80, 0x5E, 0x2B, 0xAF, 0x82, 0x6B, 0xD8, 0x84, 0xB6, 0x10, 0x52, 0x86, 0xA7, 0x89, 0x8E, 0xAE, 0x9A, 0xE2, 0x89, 0xC6, 0xF7, 0xD5, 0x87, 0xFB }, // TOP_SIGNATURE_Q Q = new byte[128] { 0xD7, 0xA1, 0x0F, 0x9A, 0x8B, 0xF2, 0xC9, 0x11, 0x95, 0x32, 0x9A, 0x8C, 0xF0, 0xD9, 0x40, 0x47, 0xF5, 0x68, 0xA0, 0x0D, 0xBD, 0xC1, 0xFC, 0x43, 0x2F, 0x65, 0xF9, 0xC3, 0x61, 0x0F, 0x25, 0x77, 0x54, 0xAD, 0xD7, 0x58, 0xAC, 0x84, 0x40, 0x60, 0x8D, 0x3F, 0xF3, 0x65, 0x89, 0x75, 0xB5, 0xC6, 0x2C, 0x51, 0x1A, 0x2F, 0x1F, 0x22, 0xE4, 0x43, 0x11, 0x54, 0xBE, 0xC9, 0xB4, 0xC7, 0xB5, 0x1B, 0x05, 0x0B, 0xBC, 0x56, 0x9A, 0xCD, 0x4A, 0xD9, 0x73, 0x68, 0x5E, 0x5C, 0xFB, 0x92, 0xB7, 0x8B, 0x0D, 0xFF, 0xF5, 0x07, 0xCA, 0xB4, 0xC8, 0x9B, 0x96, 0x3C, 0x07, 0x9E, 0x3E, 0x6B, 0x2A, 0x11, 0xF2, 0x8A, 0xB1, 0x8A, 0xD7, 0x2E, 0x1B, 0xA5, 0x53, 0x24, 0x06, 0xED, 0x50, 0xB8, 0x90, 0x67, 0xB1, 0xE2, 0x41, 0xC6, 0x92, 0x01, 0xEE, 0x10, 0xF0, 0x61, 0xBB, 0xFB, 0xB2, 0x7D, 0x4A, 0x73 } }; #endregion #region Keystone Keys private static byte[] keystone_passcode_secret = new byte[32] { 0xC7, 0x44, 0x05, 0xF6, 0x74, 0x24, 0xBA, 0x34, 0x2B, 0xC1, 0x27, 0x62, 0x51, 0xBB, 0xC2, 0xF5, 0x55, 0xF1, 0x60, 0x25, 0xB6, 0xA1, 0xB6, 0x71, 0x47, 0x80, 0xDB, 0xAE, 0xC8, 0x52, 0xFA, 0x2F }; private static byte[] keystone_ks_secret = new byte[32] { 0x78, 0x3D, 0x6F, 0x3A, 0xE9, 0x1C, 0x0E, 0x07, 0x12, 0xFC, 0xAA, 0xB7, 0x95, 0x0B, 0xDE, 0x06, 0x85, 0x5C, 0xF7, 0xA2, 0x2D, 0xCD, 0xBD, 0xE1, 0x27, 0xE9, 0xBF, 0xCB, 0xAD, 0x0F, 0xF0, 0xFE }; #endregion #endregion #region Constructors /// <summary> /// Initializes a new instance of the Package class on the specified file. /// </summary> /// <param name="FileName">The location of the file to load.</param> public Package(string FileName) { IO = new EndianIO(FileName, EndianType.BigEndian, true); } /// <summary> /// Initializes a new instance of the Package class on the specified byte array. /// </summary> /// <param name="Data">The byte array to load.</param> public Package(byte[] Data) { IO = new EndianIO(Data, EndianType.BigEndian, true); } /// <summary> /// Initializes a new instance of the Package class on the specified stream. /// </summary> /// <param name="Stream">The stream to load.</param> public Package(Stream Stream) { IO = new EndianIO(Stream, EndianType.BigEndian, true); } #endregion #region Private Methods private static uint ReverseBytes(uint val) { return (val & 0x000000FFU) << 24 | (val & 0x0000FF00U) << 8 | (val & 0x00FF0000U) >> 8 | (val & 0xFF000000U) >> 24; } private static byte[] Sha256(byte[] data) { return SHA256.Create().ComputeHash(data); } private static byte[] HmacSha256(byte[] key, byte[] data) { var sha = new HMACSHA256(key); sha.ComputeHash(data); return sha.Hash; } private bool IsPasscodeValid(string data) { return Regex.IsMatch(data, @"^[A-Za-z0-9-_]+$"); } private byte[] ComputeKeys(byte[] ContentId, byte[] Passcode, uint Index) { if (ContentId.Length != PKG_CONTENT_ID_SIZE) return null; if (Passcode.Length != PKG_PASSCODE_SIZE) return null; byte[] IndexBytes = Sha256(BitConverter.GetBytes(ReverseBytes(Index))); byte[] ContentIdBytes = Sha256(Encoding.ASCII.GetBytes(Encoding.ASCII.GetString(ContentId).PadRight((int)PKG_CONTENT_ID_BLOCK_SIZE, '\0'))); byte[] data = new byte[IndexBytes.Length + ContentIdBytes.Length + Passcode.Length]; Buffer.BlockCopy(IndexBytes, 0, data, 0, IndexBytes.Length); Buffer.BlockCopy(ContentIdBytes, 0, data, IndexBytes.Length, ContentIdBytes.Length); Buffer.BlockCopy(Passcode, 0, data, IndexBytes.Length + ContentIdBytes.Length, Passcode.Length); return Sha256(data); } private byte[] ComputeImageKey(byte[] ContentId, byte[] Passcode) { return ComputeKeys(ContentId, Passcode, 1); } private byte[] ComputeFingerprint(byte[] Passcode) { return HmacSha256(keystone_passcode_secret, Passcode); } private byte[] ComputeKeystone(byte[] Fingerprint) { var ms = new MemoryStream(); var writer = new EndianWriter(ms, EndianType.LittleEndian); writer.Write("keystone"); writer.Write((ushort)2); writer.Write((ushort)1); writer.Write(new byte[20]); writer.Write(Fingerprint); byte[] Digest = HmacSha256(keystone_ks_secret, ms.ToArray()); writer.Write(Digest); writer.Close(); writer.Dispose(); return ms.ToArray(); } private byte[] GenerateKeyBlock(byte[] Modulus, byte[] Exponent, byte[] Key) { byte[] Seed = new byte[Modulus.Length + Key.Length]; Buffer.BlockCopy(Modulus, 0, Seed, 0, Modulus.Length); Buffer.BlockCopy(Key, 0, Seed, Modulus.Length, Key.Length); byte[] HashedSeed = Sha256(Sha256(Seed)); uint[] SeedArray = new uint[HashedSeed.Length / sizeof(uint)]; for (int i = 0; i < (HashedSeed.Length / sizeof(uint)); i++) SeedArray[i] = ReverseBytes(BitConverter.ToUInt32(HashedSeed, i * sizeof(uint))); var entropy = new Entropy(SeedArray); var message = new MemoryStream(); var writer = new EndianWriter(message, EndianType.LittleEndian); writer.Write((byte)0); writer.Write((byte)2); writer.Write(entropy.CalculateEntropy(224)); writer.Write((byte)0); writer.Write(Key); writer.Close(); writer.Dispose(); // FIX: .NET RSA does not want to work with generated message. return RsaEncrypt(message.ToArray(), RSA_TOP_SIGNATURE); } private static bool ArrayEquals(byte[] a, byte[] b) { if (a.Length != b.Length) return false; for (int i = 0; i < a.Length; i++) if (a[i] != b[i]) return false; return true; } private byte[] CalculateTopSignature() { IO.In.SeekTo(0); byte[] TopBlock = IO.In.ReadBytes(0xFE0); byte[] TopDigest = IO.In.ReadBytes(PKG_HASH_SIZE); byte[] TopSignature = IO.In.ReadBytes(0x100); byte[] ComputedTopDigest = Sha256(TopBlock); if (!ArrayEquals(TopDigest, ComputedTopDigest)) throw new Exception("CNT: Invalid top digest."); byte[] TopBlockBytes = new byte[TopBlock.Length + TopDigest.Length]; Buffer.BlockCopy(TopBlock, 0, TopBlockBytes, 0, TopBlock.Length); Buffer.BlockCopy(TopDigest, 0, TopBlockBytes, TopBlock.Length, TopDigest.Length); byte[] TopSignatureDigest = Sha256(TopBlockBytes); return GenerateKeyBlock(RSA_TOP_SIGNATURE.Modulus, RSA_TOP_SIGNATURE.Exponent, TopSignatureDigest); } private string EntryIdToString(EntryId id) { switch (id) { case EntryId.PKG_ENTRY_ID__DIGESTS: return ".digests"; case EntryId.PKG_ENTRY_ID__ENTRY_KEYS: return ".entry_keys"; case EntryId.PKG_ENTRY_ID__IMAGE_KEY: return ".image_key"; case EntryId.PKG_ENTRY_ID__GENERAL_DIGESTS: return ".general_digests"; case EntryId.PKG_ENTRY_ID__METAS: return ".metas"; case EntryId.PKG_ENTRY_ID__ENTRY_NAMES: return ".entry_names"; case EntryId.PKG_ENTRY_ID__LICENSE_DAT: return "license.dat"; case EntryId.PKG_ENTRY_ID__LICENSE_INFO: return "license.info"; case EntryId.PKG_ENTRY_ID__NPTITLE_DAT: return "nptitle.dat"; case EntryId.PKG_ENTRY_ID__NPBIND_DAT: return "npbind.dat"; case EntryId.PKG_ENTRY_ID__SELFINFO_DAT: return "selfinfo.dat"; case EntryId.PKG_ENTRY_ID__IMAGEINFO_DAT: return "imageinfo.dat"; case EntryId.PKG_ENTRY_ID__TARGET_DELTAINFO_DAT: return "target-deltainfo.dat"; case EntryId.PKG_ENTRY_ID__ORIGIN_DELTAINFO_DAT: return "origin-deltainfo.dat"; case EntryId.PKG_ENTRY_ID__PSRESERVED_DAT: return "psreserved.dat"; case EntryId.PKG_ENTRY_ID__PARAM_SFO: return "param.sfo"; case EntryId.PKG_ENTRY_ID__PLAYGO_CHUNK_DAT: return "playgo-chunk.dat"; case EntryId.PKG_ENTRY_ID__PLAYGO_CHUNK_SHA: return "playgo-chunk.sha"; case EntryId.PKG_ENTRY_ID__PLAYGO_MANIFEST_XML: return "playgo-manifest.xml"; case EntryId.PKG_ENTRY_ID__PRONUNCIATION_XML: return "pronunciation.xml"; case EntryId.PKG_ENTRY_ID__PRONUNCIATION_SIG: return "pronunciation.sig"; case EntryId.PKG_ENTRY_ID__PIC1_PNG: return "pic1.png"; case EntryId.PKG_ENTRY_ID__PUBTOOLINFO_DAT: return "pubtoolinfo.dat"; case EntryId.PKG_ENTRY_ID__APP__PLAYGO_CHUNK_DAT: return "app/playgo-chunk.dat"; case EntryId.PKG_ENTRY_ID__APP__PLAYGO_CHUNK_SHA: return "app/playgo-chunk.sha"; case EntryId.PKG_ENTRY_ID__APP__PLAYGO_MANIFEST_XML: return "app/playgo-manifest.xml"; case EntryId.PKG_ENTRY_ID__SHAREPARAM_JSON: return "shareparam.json"; case EntryId.PKG_ENTRY_ID__SHAREOVERLAYIMAGE_PNG: return "shareoverlayimage.png"; case EntryId.PKG_ENTRY_ID__SAVE_DATA_PNG: return "save_data.png"; case EntryId.PKG_ENTRY_ID__SHAREPRIVACYGUARDIMAGE_PNG: return "shareprivacyguardimage.png"; case EntryId.PKG_ENTRY_ID__ICON0_PNG: return "icon0.png"; case EntryId iconpng when (iconpng >= EntryId.PKG_ENTRY_ID__ICON0_00_PNG && iconpng <= EntryId.PKG_ENTRY_ID__ICON0_30_PNG): return string.Format("icon0_{0:00}.png", iconpng - EntryId.PKG_ENTRY_ID__ICON0_00_PNG); case EntryId.PKG_ENTRY_ID__PIC0_PNG: return "pic0.png"; case EntryId.PKG_ENTRY_ID__SND0_AT9: return "snd0.at9"; case EntryId picpng when (picpng >= EntryId.PKG_ENTRY_ID__PIC1_00_PNG && picpng <= EntryId.PKG_ENTRY_ID__PIC1_30_PNG): return string.Format("pic1_{0:00}.png", picpng - EntryId.PKG_ENTRY_ID__PIC1_00_PNG); case EntryId.PKG_ENTRY_ID__CHANGEINFO__CHANGEINFO_XML: return "changeinfo/changeinfo.xml"; case EntryId changeinfo when (changeinfo >= EntryId.PKG_ENTRY_ID__CHANGEINFO__CHANGEINFO_00_XML && changeinfo <= EntryId.PKG_ENTRY_ID__CHANGEINFO__CHANGEINFO_30_XML): return string.Format("changeinfo/changeinfo_{0:00}.png", changeinfo - EntryId.PKG_ENTRY_ID__CHANGEINFO__CHANGEINFO_00_XML); case EntryId.PKG_ENTRY_ID__ICON0_DDS: return "icon0.dds"; case EntryId icondds when (icondds >= EntryId.PKG_ENTRY_ID__ICON0_00_DDS && icondds <= EntryId.PKG_ENTRY_ID__ICON0_30_DDS): return string.Format("icon0_{0:00}.dds", icondds - EntryId.PKG_ENTRY_ID__ICON0_00_DDS); case EntryId.PKG_ENTRY_ID__PIC0_DDS: return "pic0.dds"; case EntryId.PKG_ENTRY_ID__PIC1_DDS: return "pic1.dds"; case EntryId picdds when (picdds >= EntryId.PKG_ENTRY_ID__PIC1_00_DDS && picdds <= EntryId.PKG_ENTRY_ID__PIC1_30_DDS): return string.Format("pic1_{0:00}.dds", picdds - EntryId.PKG_ENTRY_ID__PIC1_00_DDS); case EntryId trophytrp when (trophytrp >= EntryId.PKG_ENTRY_ID__TROPHY__TROPHY00_TRP && trophytrp <= EntryId.PKG_ENTRY_ID__TROPHY__TROPHY99_TRP): return string.Format("trophy/trophy_{0:00}.trp", trophytrp - EntryId.PKG_ENTRY_ID__TROPHY__TROPHY00_TRP); case EntryId keymap when (keymap >= EntryId.PKG_ENTRY_ID__KEYMAP_RP__001_PNG && keymap <= EntryId.PKG_ENTRY_ID__KEYMAP_RP__010_PNG): return string.Format("keymap_rp/keymap_rp{0:000}.png", keymap - EntryId.PKG_ENTRY_ID__KEYMAP_RP__001_PNG); case EntryId keymaprp when (keymaprp >= EntryId.PKG_ENTRY_ID__KEYMAP_RP__00__001_PNG && keymaprp <= EntryId.PKG_ENTRY_ID__KEYMAP_RP__30__010_PNG): return string.Format("keymap_rp/{0}/keymap_rp{1:000}.png", (keymaprp - EntryId.PKG_ENTRY_ID__KEYMAP_RP__00__001_PNG) / 0x10, (keymaprp - EntryId.PKG_ENTRY_ID__KEYMAP_RP__00__001_PNG) % 0x10); default: throw new Exception("CNT: Invalid 'Entry Id' value."); } } private ContainerHeader SeekToContainer(EndianIO io) { io.SeekTo(0x400); Pkg.Container.unk_0x400 = io.In.ReadUInt32(); Pkg.Container.PfsImageCount = io.In.ReadUInt32(); Pkg.Container.PfsFlags = io.In.ReadUInt64(); Pkg.Container.PfsImageOffset = io.In.ReadUInt64(); Pkg.Container.PfsImageSize = io.In.ReadUInt64(); Pkg.Container.MountImageOffset = io.In.ReadUInt64(); Pkg.Container.MountImageSize = io.In.ReadUInt64(); Pkg.Container.PackageSize = io.In.ReadUInt64(); Pkg.Container.PfsSignedSize = io.In.ReadUInt32(); Pkg.Container.PfsCacheSize = io.In.ReadUInt32(); Pkg.Container.PfsImageDigest = io.In.ReadBytes(PKG_HASH_SIZE); Pkg.Container.PfsSignedDigest = io.In.ReadBytes(PKG_HASH_SIZE); Pkg.Container.PfsSplitSizeNth0 = io.In.ReadUInt64(); Pkg.Container.PfsSplitSizeNth1 = io.In.ReadUInt64(); return Pkg.Container; } private byte[] RsaDecrypt(byte[] data, RSAParameters parameters) { using (var rsa = new RSACryptoServiceProvider(2048)) { // Import the Rsa key information. // This needs to include private key information. rsa.ImportParameters(parameters); return rsa.Decrypt(data, false); } } private byte[] RsaEncrypt(byte[] data, RSAParameters parameters) { using (var rsa = new RSACryptoServiceProvider(2048)) { // Import the Rsa key information. // This needs to include private key information. rsa.ImportParameters(parameters); return rsa.Encrypt(data, true); } } private Entry[] SeekToEntries(EndianIO io) { io.SeekTo(0x2400); byte[] DecEntryKeyset = RsaDecrypt(io.In.ReadBytes(PKG_ENTRY_KEYSET_ENC_SIZE), RSA_TOP_SIGNATURE); byte[] ImageKey = ComputeImageKey(Encoding.ASCII.GetBytes(ContentId), Encoding.ASCII.GetBytes(Passcode)); byte[] Fingerprint = ComputeFingerprint(Encoding.ASCII.GetBytes(Passcode)); byte[] Keystone = ComputeKeystone(Fingerprint); //byte[] GeneratedTopSignature = GenerateKeyBlock(param.Modulus, param.Exponent, ) io.SeekTo(Pkg.Header.EntryTableOffset); Pkg.Entries = new Entry[Pkg.Header.EntryCount]; for (int i = 0; i < Pkg.Header.EntryCount; ++i) { Pkg.Entries[i].Id = (EntryId)IO.In.ReadUInt32(); Pkg.Entries[i].unk = IO.In.ReadUInt32(); Pkg.Entries[i].Flags1 = IO.In.ReadUInt32(); Pkg.Entries[i].Flags2 = IO.In.ReadUInt32(); Pkg.Entries[i].Offset = IO.In.ReadUInt32(); Pkg.Entries[i].Size = IO.In.ReadUInt32(); Pkg.Entries[i].Pad = IO.In.ReadUInt64(); Pkg.Entries[i].Name = EntryIdToString(Pkg.Entries[i].Id); Pkg.Entries[i].KeyIndex = ((Pkg.Entries[i].Flags2 & 0xF000) >> 12); Pkg.Entries[i].IsEncrypted = ((Pkg.Entries[i].Flags1 & 0x80000000) != 0) ? true : false; } return Pkg.Entries; } #endregion #region Public Methods #region PlayStation 4 Package Structure public struct PackageFile { public PackageHeader Header; public ContainerHeader Container; public Entry[] Entries; public bool IsFinalized; }; public struct PackageHeader { public uint Magic; public uint Flags; public uint unk_0x08; public uint unk_0x0C; public uint EntryCount; public ushort ScEntryCount; public ushort EntryCount2; public uint EntryTableOffset; public uint MainEntDataSize; public ulong BodyOffset; public ulong BodySize; public byte[] Pad; public string ContentId; public DrmType DrmType; public ContentType ContentType; public uint ContentFlags; public uint PromoteSize; public uint VersionDate; public uint VersionHash; public uint unk_0x88; /* for delta patches only? */ public uint unk_0x8C; /* for delta patches only? */ public uint unk_0x90; /* for delta patches only? */ public uint unk_0x94; /* for delta patches only? */ public IroTag IroTag; public uint EkcVersion; public byte[] Pad1; public byte[] ScEntries1Hash; public byte[] ScEntries2Hash; public byte[] DigestTableHash; public byte[] BodyDigest; }; public struct ContainerHeader { public uint unk_0x400; public uint PfsImageCount; public ulong PfsFlags; // Still got to figure out flags. public ulong PfsImageOffset; public ulong PfsImageSize; public ulong MountImageOffset; public ulong MountImageSize; public ulong PackageSize; public uint PfsSignedSize; public uint PfsCacheSize; public byte[] PfsImageDigest; public byte[] PfsSignedDigest; public ulong PfsSplitSizeNth0; public ulong PfsSplitSizeNth1; } public struct Entry { public EntryId Id; public uint unk; public uint Flags1; public uint Flags2; public uint Offset; public uint Size; public ulong Pad; public string Name; public uint KeyIndex; public bool IsEncrypted; public byte[] ToArray() { var ms = new MemoryStream(); var writer = new EndianWriter(ms, EndianType.BigEndian); writer.Write((uint)Id); writer.Write(unk); writer.Write(Flags1); writer.Write(Flags2); writer.Write(Offset); writer.Write(Size); writer.Write(Pad); writer.Close(); return ms.ToArray(); } } public struct EntryKeyset { public byte[] iv; public byte[] key; } #endregion public void Read() { IO.In.BaseStream.Position = 0; Pkg.Header.Magic = IO.In.ReadUInt32(); Pkg.Header.Flags = IO.In.ReadUInt32(); if (Pkg.Header.Magic != 0x7F434E54) throw new Exception("Invalid magic detected for loaded PKG file!"); Pkg.IsFinalized = (Pkg.Header.Flags & PKG_FLAG_FINALIZED) != 0; Pkg.Header.unk_0x08 = IO.In.ReadUInt32(); Pkg.Header.unk_0x0C = IO.In.ReadUInt32(); Pkg.Header.EntryCount = IO.In.ReadUInt32(); Pkg.Header.ScEntryCount = IO.In.ReadUInt16(); Pkg.Header.EntryCount2 = IO.In.ReadUInt16(); Pkg.Header.EntryTableOffset = IO.In.ReadUInt32(); Pkg.Header.MainEntDataSize = IO.In.ReadUInt32(); Pkg.Header.BodyOffset = IO.In.ReadUInt64(); Pkg.Header.BodySize = IO.In.ReadUInt64(); Pkg.Header.Pad = IO.In.ReadBytes(0x10); Pkg.Header.ContentId = IO.In.ReadAsciiString((int)PKG_CONTENT_ID_BLOCK_SIZE); Pkg.Header.DrmType = (DrmType)IO.In.ReadUInt32(); Pkg.Header.ContentType = (ContentType)IO.In.ReadUInt32(); Pkg.Header.ContentFlags = IO.In.ReadUInt32(); // Got to figure out the flags. Pkg.Header.PromoteSize = IO.In.ReadUInt32(); Pkg.Header.VersionDate = IO.In.ReadUInt32(); Pkg.Header.VersionHash = IO.In.ReadUInt32(); Pkg.Header.unk_0x88 = IO.In.ReadUInt32(); Pkg.Header.unk_0x8C = IO.In.ReadUInt32(); Pkg.Header.unk_0x90 = IO.In.ReadUInt32(); Pkg.Header.unk_0x94 = IO.In.ReadUInt32(); Pkg.Header.IroTag = (IroTag)IO.In.ReadUInt32(); Pkg.Header.EkcVersion = IO.In.ReadUInt32(); Pkg.Header.Pad1 = IO.In.ReadBytes(96); Pkg.Header.ScEntries1Hash = IO.In.ReadBytes(PKG_HASH_SIZE); Pkg.Header.ScEntries2Hash = IO.In.ReadBytes(PKG_HASH_SIZE); Pkg.Header.DigestTableHash = IO.In.ReadBytes(PKG_HASH_SIZE); Pkg.Header.BodyDigest = IO.In.ReadBytes(PKG_HASH_SIZE); Pkg.Container = SeekToContainer(IO); Pkg.Entries = SeekToEntries(IO); byte[] sig = CalculateTopSignature(); System.Windows.Forms.MessageBox.Show(BitConverter.ToString(sig)); // Read PFS content. IO.In.SeekTo(Pkg.Container.PfsImageOffset); var PFS = new PlaystationFileSystem(); PFS.Open(IO.In.ReadBytes(Pkg.Container.PfsSignedSize)); } #endregion #region Properties /// <summary> /// Gets or sets the Passcode. /// </summary> public string Passcode { get { return _Passcode; } set { if (value.Length != PKG_PASSCODE_SIZE || !IsPasscodeValid(value)) throw new Exception("Invalid passcode specified!"); _Passcode = value; } } /// <summary> /// Gets or sets the ContentId /// </summary> public string ContentId { get { return Pkg.Header.ContentId; } set { if (value.Length != PKG_CONTENT_ID_SIZE) throw new Exception("Invalid Content Id specified!"); Pkg.Header.ContentId = value; } } #endregion } }
using Alabo.Domains.Repositories; using Alabo.Industry.Offline.Order.Domain.Entities; namespace Alabo.Industry.Offline.Order.Domain.Repositories { public interface IMerchantOrderProductRepository : IRepository<MerchantOrderProduct, long> { } }
using Iris.Infrastructure.Contracts.Services; using Iris.Network; using TinyIoC; namespace Iris.Core { public static class IrisCore { private readonly static TinyIoCContainer Container = new TinyIoCContainer(); static IrisCore() { RegisterDependencies(); InitializeNetworking(); } private static void RegisterDependencies() { Container.Register<IMouseService, MouseService>().AsSingleton(); Container.Register<IConfigurationService, IrisConfigurationService>().AsSingleton(); Container.Register<INetworkManager, IrisNetworkManager>().AsSingleton(); } private static void InitializeNetworking() { NetworkManager.Initialize(); } internal static INetworkManager NetworkManager => Container.Resolve<INetworkManager>(); public static IMouseService MouseService => Container.Resolve<IMouseService>(); public static IConfigurationService ConfigurationService => Container.Resolve<IConfigurationService>(); } }
using DevEngine.Graphics; namespace DevEngine.Levels.Tiles { public class SelectionTile : Tile { public SelectionTile(int id) : base(id) { } public override void Render(Renderer renderer, int x, int y) { base.Render(renderer, x, y); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using DFC.ServiceTaxonomy.ContentApproval.Extensions; using DFC.ServiceTaxonomy.ContentApproval.Models; using DFC.ServiceTaxonomy.ContentApproval.Models.Enums; using DFC.ServiceTaxonomy.ContentApproval.ViewModels; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc.Localization; using Microsoft.AspNetCore.Mvc.ModelBinding; using OrchardCore.ContentManagement; using OrchardCore.ContentManagement.Display.ContentDisplay; using OrchardCore.ContentManagement.Display.Models; using OrchardCore.ContentPreview; using OrchardCore.Contents.AuditTrail.Models; using OrchardCore.DisplayManagement.ModelBinding; using OrchardCore.DisplayManagement.Notify; using OrchardCore.DisplayManagement.Views; namespace DFC.ServiceTaxonomy.ContentApproval.Drivers { public class ContentApprovalPartDisplayDriver : ContentPartDisplayDriver<ContentApprovalPart> { private readonly IAuthorizationService _authorizationService; private readonly IHttpContextAccessor _httpContextAccessor; private readonly INotifier _notifier; private readonly IHtmlLocalizer<ContentApprovalPartDisplayDriver> H; public ContentApprovalPartDisplayDriver(IAuthorizationService authorizationService, IHttpContextAccessor httpContextAccessor, INotifier notifier, IHtmlLocalizer<ContentApprovalPartDisplayDriver> htmlLocalizer) { _authorizationService = authorizationService; _httpContextAccessor = httpContextAccessor; _notifier = notifier; H = htmlLocalizer; } public override async Task<IDisplayResult?> DisplayAsync(ContentApprovalPart part, BuildPartDisplayContext context) { var currentUser = _httpContextAccessor.HttpContext?.User; var results = new List<IDisplayResult>(); if (part.ReviewStatus != ReviewStatus.NotInReview && await _authorizationService.AuthorizeAsync(currentUser, part.ReviewType.GetRelatedPermission(), part)) { results.Add(Initialize<ContentApprovalPartViewModel>( "ContentApprovalPart_Admin_InReview", viewModel => PopulateViewModel(part, viewModel)) .Location("SummaryAdmin", "Actions:First")); } return Combine(results.ToArray()); } public override async Task<IDisplayResult?> EditAsync(ContentApprovalPart part, BuildPartEditorContext context) { var currentUser = _httpContextAccessor.HttpContext?.User; if (currentUser == null) { return null; } var reviewPermission = part.ReviewType.GetRelatedPermission(); if (part.ReviewStatus == ReviewStatus.InReview && (!context.Updater.ModelState.IsValid || !await _authorizationService.AuthorizeAsync(currentUser, reviewPermission))) { await _notifier.WarningAsync(H["This content item is now under review and should not be modified."]); } var editorShape = GetEditorShapeType(context); var reviewStatuses = new[] { ReviewStatus.ReadyForReview, ReviewStatus.InReview }; var results = new List<IDisplayResult>(); // Show force publish if ((part.ReviewStatus == ReviewStatus.NotInReview || part.ReviewStatus == ReviewStatus.RequiresRevision) && await _authorizationService.AuthorizeAsync(currentUser, Permissions.ForcePublishPermissions.ForcePublishPermission)) { results.Add(Initialize<ContentApprovalPartViewModel>( $"{editorShape}_ForcePublish", viewModel => PopulateViewModel(part, viewModel)) .Location("Actions:15")); } // Show Request review option if (await _authorizationService.AuthorizeAsync(currentUser, Permissions.RequestReviewPermissions.RequestReviewPermission)) { results.Add(Initialize<ContentApprovalPartViewModel>( $"{editorShape}_RequestReview", viewModel => PopulateViewModel(part, viewModel)) .Location("Actions:16")); } // Show Request revision option if (reviewStatuses.Any(r => part.ReviewStatus == r) && await _authorizationService.AuthorizeAsync(currentUser, reviewPermission)) { results.Add(Initialize<ContentApprovalPartViewModel>( $"{editorShape}_RequestRevision", viewModel => PopulateViewModel(part, viewModel)) .Location("Actions:First")); } return Combine(results.ToArray()); } public override async Task<IDisplayResult?> UpdateAsync(ContentApprovalPart part, IUpdateModel updateModel, UpdatePartEditorContext context) { var isPreview = _httpContextAccessor.HttpContext?.Features.Get<ContentPreviewFeature>()?.Previewing ?? false; if (isPreview) { return await EditAsync(part, context); } var viewModel = new ContentApprovalPartViewModel(); var currentUser = _httpContextAccessor.HttpContext?.User; if (part.ReviewStatus == ReviewStatus.InReview && !await _authorizationService.AuthorizeAsync(currentUser, part.ReviewType.GetRelatedPermission())) { updateModel.ModelState.AddModelError("ReviewStatus", "This item is currently under review and cannot be modified at this time."); return await EditAsync(part, context); } await updateModel.TryUpdateModelAsync(viewModel, Prefix); var keys = updateModel.ModelState.Keys; // For Publish, Force-Publish, Save Draft & Exit and Send Back actions the user must enter a comment for the audit trail if (!await IsAuditTrailCommentValid(part, updateModel)) { updateModel.ModelState.AddModelError("Comment", "Please update the comment field before submitting."); return await EditAsync(part, context); } if (keys.Contains(Constants.SubmitSaveKey)) { var saveType = updateModel.ModelState[Constants.SubmitSaveKey].AttemptedValue; if (saveType.StartsWith(Constants.SubmitRequestApprovalValuePrefix)) { part.ReviewStatus = ReviewStatus.ReadyForReview; part.ReviewType = Enum.Parse<ReviewType>(saveType.Replace(Constants.SubmitRequestApprovalValuePrefix, "")); await _notifier.SuccessAsync(H["{0} is now ready to be reviewed.", part.ContentItem.DisplayText]); } else if (saveType.StartsWith(Constants.SubmitRequiresRevisionValue)) { part.ReviewStatus = ReviewStatus.RequiresRevision; part.ReviewType = ReviewType.None; } else // implies a draft save or send back for revision { part.ReviewStatus = ReviewStatus.NotInReview; part.ReviewType = ReviewType.None; } } else if (keys.Contains(Constants.SubmitPublishKey)) { part.ReviewStatus = ReviewStatus.NotInReview; var publishType = updateModel.ModelState[Constants.SubmitPublishKey].AttemptedValue; if (publishType.StartsWith(Constants.SubmitRequestApprovalValuePrefix)) { part.IsForcePublished = true; part.ReviewType = Enum.Parse<ReviewType>(publishType.Replace(Constants.SubmitRequestApprovalValuePrefix, "")); } else { part.IsForcePublished = false; part.ReviewType = ReviewType.None; } } return await EditAsync(part, context); } private static void PopulateViewModel(ContentApprovalPart part, ContentApprovalPartViewModel viewModel) { viewModel.ContentItemId = part.ContentItem.ContentItemId; viewModel.ReviewStatus = part.ReviewStatus; viewModel.ReviewTypes = EnumExtensions.GetEnumNameAndDisplayNameDictionary(typeof(ReviewType)).Where(rt => rt.Key != ReviewType.None.ToString()); } private static async Task<bool> IsAuditTrailCommentValid(ContentApprovalPart part, IUpdateModel updateModel) { bool commentValid = true; if (part != null && updateModel != null) { var isCommentRequired = IsCommentRequired(updateModel.ModelState); if (isCommentRequired) { var auditTrailPartExists = part.ContentItem.Has<OrchardCore.Contents.AuditTrail.Models.AuditTrailPart>(); if (auditTrailPartExists) { var auditTrail = new AuditTrailPart(); await updateModel.TryUpdateModelAsync(auditTrail, nameof(AuditTrailPart)); if (string.IsNullOrEmpty(auditTrail.Comment)) { commentValid = false; } } } } return commentValid; } private static bool IsCommentRequired(ModelStateDictionary modelStateDictionary) { var keys = modelStateDictionary.Keys; if (!keys.Any()) { return false; } // All publishing actions require a comment if (keys.Contains(Constants.SubmitPublishKey)) { return true; } // Only Save Draft and exit and Send back actions require a comment if (keys.Contains(Constants.SubmitSaveKey)) { var keyValue = modelStateDictionary[Constants.SubmitSaveKey].AttemptedValue; return new[] {Constants.SubmitSaveKey, Constants.SubmitRequiresRevisionValue}.Any(kv => kv.Equals(keyValue, StringComparison.CurrentCultureIgnoreCase)); } return false; /* * Button/Action matrix Key/Action Comment * -------------------- --------------------------------------------------------------------------- --------------------- * Publish - constants.SubmitPublishKey action = submit.Publish Required * Publish and continue - constants.SubmitPublishKey action = submit.PublishAndContinue Required * * Force Publish * Content Design - constants.SubmitPublishKey action = submit.RequestApproval - ContentDesign Required * Stakeholder - constants.SubmitPublishKey action = submit.RequestApproval - Stakeholder Required * SME - constants.SubmitPublishKey action = submit.RequestApproval - SME Required * UX - constants.SubmitPublishKey action = submit.RequestApproval - UX Required * * Save Draft and continue - constants.SubmitSaveKey action = submit.SaveAndContinue Optional * Save Draft and exit - constants.SubmitSaveKey action = submit.Save Required * * Request review * Content Design - constants.SubmitSaveKey action = submit.RequestApproval - ContentDesign Optional * Stakeholder - constants.SubmitSaveKey action = submit.RequestApproval - Stakeholder Optional * SME - constants.SubmitSaveKey action = submit.RequestApproval - SME Optional * UK - constants.SubmitSaveKey action = submit.RequestApproval - UX Optional * * Send back - constants.SubmitSaveKey action = submit.RequiresRevision Required * * Preview draft - N/A (opens new tab) * * Visualise draft graph - N/A (opens new tab) * Visualise published graph - N/A (opens new tab) * * Cancel - N/A (exits page) */ } } }
using gView.Framework.Proj; using System; using System.Collections.Generic; using System.Text; namespace gView.Framework.Geometry.SpatialRefTranslation { internal class Proj4CoordinateSystemWriter { private class P4Parameter { private string _p, _v; public P4Parameter(string p, string v) { _p = p; _v = v; } public string Parameter { get { return _p; } } public string ParameterValue { get { return _v; } } } private static List<P4Parameter> _p4parameters = new List<P4Parameter>(); private static IFormatProvider _nhi = System.Globalization.CultureInfo.InvariantCulture.NumberFormat; private static object lockThis = new object(); public static string Write(object obj) { lock (lockThis) { _p4parameters.Clear(); if (obj is GeographicCoordinateSystem) { _p4parameters.Add(new P4Parameter("+proj", "longlat")); WriteGeographicCoordinateSystem(obj as GeographicCoordinateSystem); } if (obj is ProjectedCoordinateSystem) { WriteProjectedCoordinateSystem(obj as ProjectedCoordinateSystem); } return Write(); } } private static string Write() { StringBuilder sb = new StringBuilder(); foreach (P4Parameter parameter in _p4parameters) { if (sb.Length > 0) { sb.Append(" "); } sb.Append(parameter.Parameter + "=" + parameter.ParameterValue); } return sb.ToString(); } private static void WriteGeographicCoordinateSystem(GeographicCoordinateSystem geogrCoordSystem) { // +proj=longlat +ellps=clrk80 +towgs84=-294.7,-200.1,525.5,0,0,0,0 +no_defs #region Ellipsoid Ellipsoid ellipsoid = geogrCoordSystem.HorizontalDatum.Ellipsoid; double majorAxis, minorAxis, invFlattening; string ellps = ProjDB.SpheroidByName(ellipsoid.Name, out majorAxis, out minorAxis, out invFlattening); if (ellps != String.Empty && majorAxis == ellipsoid.SemiMajorAxis && minorAxis == ellipsoid.SemiMinorAxis) { _p4parameters.Add(new P4Parameter("+ellps", ellps)); } else { _p4parameters.Add(new P4Parameter("+a", ellipsoid.SemiMajorAxis.ToString(_nhi))); _p4parameters.Add(new P4Parameter("+b", ellipsoid.SemiMinorAxis.ToString(_nhi))); } #endregion #region WGS84 WGS84ConversionInfo wgs84 = geogrCoordSystem.HorizontalDatum.WGS84Parameters; if (wgs84.IsInUse) { _p4parameters.Add(new P4Parameter("+towgs84", String.Format("{0},{1},{2},{3},{4},{5},{6}", wgs84.Dx.ToString(_nhi), wgs84.Dy.ToString(_nhi), wgs84.Dz.ToString(_nhi), wgs84.Ex.ToString(_nhi), wgs84.Ey.ToString(_nhi), wgs84.Ez.ToString(_nhi), wgs84.Ppm.ToString(_nhi)))); } #endregion } private static void WriteProjectedCoordinateSystem(ProjectedCoordinateSystem projCoordSystem) { string projP4 = ProjDB.ProjectionP4ByName(projCoordSystem.Projection.Name); if (projP4 == String.Empty) { throw new NotImplementedException("Unknown projection " + projCoordSystem.Projection.Name); } _p4parameters.Add(new P4Parameter("+proj", projP4)); WriteGeographicCoordinateSystem(projCoordSystem.GeographicCoordinateSystem); for (int i = 0; i < projCoordSystem.Projection.NumParameters; i++) { ProjectionParameter projParameter = projCoordSystem.Projection.GetParameter(i); switch (projParameter.Name.ToLower()) { case "latitude_of_origin": case "latitude_of_center": _p4parameters.Add(new P4Parameter("+lat_0", projParameter.Value.ToString(_nhi))); break; case "central_meridian": case "longitude_of_origin": case "longitude_of_center": _p4parameters.Add(new P4Parameter("+lon_0", projParameter.Value.ToString(_nhi))); break; case "scale_factor": _p4parameters.Add(new P4Parameter("+k", projParameter.Value.ToString(_nhi))); break; case "false_easting": _p4parameters.Add(new P4Parameter("+x_0", projParameter.Value.ToString(_nhi))); break; case "false_northing": _p4parameters.Add(new P4Parameter("+y_0", projParameter.Value.ToString(_nhi))); break; case "azimuth": _p4parameters.Add(new P4Parameter("+alpha", projParameter.Value.ToString(_nhi))); break; case "standard_parallel_1": _p4parameters.Add(new P4Parameter("+lat_1", projParameter.Value.ToString(_nhi))); break; case "standard_parallel_2": _p4parameters.Add(new P4Parameter("+lat_2", projParameter.Value.ToString(_nhi))); break; } } } } }
using BookARoom.Model; using BookARoom.Model.BLL; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.ModelBinding; using System.Web.UI; using System.Web.UI.WebControls; namespace BookARoom.Pages.CustomerPages { public partial class CustomerDetails : System.Web.UI.Page { private Service _service; private Service Service { get { return _service ?? (_service = new Service()); } } protected void Page_Load(object sender, EventArgs e) { } /// <summary> /// Hämtar kunddata med id (från route) /// </summary> /// <param name="id"></param> /// <returns></returns> public Customer CustomerListView_GetItem([RouteData] int id) { try { return Service.GetCustomer(id); } catch (Exception) { Page.ModelState.AddModelError(String.Empty, "Fel inträffade vid hämtning av kundinformation."); return null; } } /// <summary> /// Bearbetar innehåll efter att ItemDataBound för listview är genomförd /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void CustomerListView_ItemDataBound(object sender, ListViewItemEventArgs e) { //Letar reda på label i formuläret var label = e.Item.FindControl("CustomerTypeLabel") as Label; //Om label återfanns - Läs in data och sätt text på labeln som motsvarar kundens kundtyp if (label != null) { var customer = (Customer)e.Item.DataItem; var customerType = Service.GetAllCustomerTypes() .Single(ct => ct.CustomerTypeId == customer.CustomerTypeId); label.Text = String.Format(label.Text, customerType.CustomerType); } } } }
using System; namespace CharacterCreation.Items { public class Item { } }
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace MoveCarHackathonEdition.MySqlNS { [Table("movecar.car_user")] public class car_user { public int ID { get; set; } [Required] [StringLength(50)] public string CAR_USERNAME { get; set; } [Required] [StringLength(25)] public string PASSWORD { get; set; } [Required] [StringLength(100)] public string MOBILE_ID { get; set; } } }
using System; using System.Xml.Linq; namespace Cogito.Web.Configuration { /// <summary> /// Provides configuration methods for 'system.webServer/httpCompression'. /// </summary> public class WebSystemWebServerHttpCompressionConfigurator : IWebElementConfigurator { readonly XElement element; /// <summary> /// Initializes a new instance. /// </summary> /// <param name="element"></param> public WebSystemWebServerHttpCompressionConfigurator(XElement element) { this.element = element ?? throw new ArgumentNullException(nameof(element)); } /// <summary> /// Returns the configuration. /// </summary> /// <returns></returns> public XElement Element => element; public WebSystemWebServerHttpCompressionConfigurator Directory(string directory) { return this.Configure(e => e.SetAttributeValue("directory", directory)); } } }
namespace UnityAtoms { /// <summary> /// Interface defining a generic `IPair&lt;T&gt;`. /// </summary> public interface IPair<T> { T Item1 { get; set; } T Item2 { get; set; } void Deconstruct(out T item1, out T item2); } }
 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace BLL.DTO { public class UserDTO { public int UserId { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public string Birthday { get; set; } public string City { get; set; } public string Email { get; set; } public string Image { get; set; } public int? ListContactsId { get; set; } public virtual ListContactsDTO ListContacts { get; set; } //public virtual ICollection<MessageDTO> Messages { get; set; } //public virtual ICollection<FriendRequestDTO> FriendRequests { get; set; } //public UserDTO() //{ // Messages = new List<MessageDTO>(); // FriendRequests = new List<FriendRequestDTO>(); //} } }
using UnityEngine; using System.Collections; // Class for representing a basic 'node' in the environment that enemies can interact with // Note that collisions with nodes are only turned on for enemies (via Physics2D's layer settings) [RequireComponent(typeof (Collider2D))] public abstract class Node : MonoBehaviour { public bool nodeEnabled = true; private Collider2D nodeCollider; void Start () { nodeCollider = GetComponent<Collider2D>(); } void Update () { nodeCollider.enabled = nodeEnabled; } void OnTriggerEnter2D(Collider2D collider) { // Enemy movement script (allows this node to control enemy movement) GameObject enemy = collider.gameObject; FollowPlayer follow = enemy.GetComponent<FollowPlayer>(); if (follow != null) if (ShouldTrigger(follow)) Trigger(enemy.GetComponent<Movement>()); } // Check conditions for triggering here. Should be overridden in subclasses. protected virtual bool ShouldTrigger(FollowPlayer follow) { return true; } protected abstract void Trigger(Movement movement); }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using IRAPShared; namespace IRAP.Entities.DPA { [IRAPDB(TableName = "IRAPDPA..xdr_MethodParams")] public class xdr_MethodParams { /// <summary> /// 全局序号 /// </summary> [IRAPKey(IsKey = true)] public long ID { get; set; } /// <summary> /// 分区键 /// </summary> [IRAPKey(IsKey = true)] public long PartitioningKey { get; set; } /// <summary> /// 参数采集时间 /// </summary> public long CollectingTime { get; set; } /// <summary> /// 设备代码 /// </summary> public string EquipmentCode { get; set; } /// <summary> /// 工序代码 /// </summary> public string OperationCode { get; set; } /// <summary> /// 工步号 /// </summary> public int StepNo { get; set; } /// <summary> /// 产品编号 /// </summary> public string ProductNo { get; set; } /// <summary> /// 批次号 /// </summary> public string LotNumber { get; set; } /// <summary> /// 序列号 /// </summary> public string SerialNumber { get; set; } /// <summary> /// 序号 /// </summary> public int Ordinal { get; set; } /// <summary> /// 参数代码 /// </summary> public string ParamCode { get; set; } /// <summary> /// 参数名称 /// </summary> public string ParamName { get; set; } /// <summary> /// 备注 /// </summary> public string Remark { get; set; } /// <summary> /// 参数采集模式 /// </summary> public int CollectMode { get; set; } /// <summary> /// 低限值 /// </summary> public long LowLimit { get; set; } /// <summary> /// 标准 /// </summary> public string Criterion { get; set; } /// <summary> /// 高限值 /// </summary> public long HighLimit { get; set; } /// <summary> /// 放大数量级 /// </summary> public int Scale { get; set; } /// <summary> /// 单位 /// </summary> public string UnitOfMeasure { get; set; } /// <summary> /// 结论 /// </summary> public string Conclusion { get; set; } /// <summary> /// 参数值 1 /// </summary> public long Metric01 { get; set; } /// <summary> /// 参数值 2 /// </summary> public long Metric02 { get; set; } /// <summary> /// 参数值 3 /// </summary> public long Metric03 { get; set; } /// <summary> /// 参数值 4 /// </summary> public long Metric04 { get; set; } /// <summary> /// 参数值 5 /// </summary> public long Metric05 { get; set; } public xdr_MethodParams Clone() { return MemberwiseClone() as xdr_MethodParams; } } }
using System.IO; using System.Web.Mvc; using FIMMonitoring.Domain; using FIMMonitoring.Web.Extensions; using FIMMonitoring.Web.Properties; namespace FIMMonitoring.Web.Controllers { [ValidateAntiForgeryTokenOnAllPosts] public class BaseController : Controller { protected FIMContext Context = new FIMContext(Settings.Default.CommandTimeout); protected SoftLogsContext SoftLogsContext = new SoftLogsContext(Settings.Default.CommandTimeout); public int PageSize => 25; public BaseController(){} private void MergeMessage(string alertType, string message) { if (!TempData.Keys.Contains(alertType)) TempData.Add(alertType, message); else TempData[alertType] = TempData[alertType] + "<br />" + message; } public void Attention(string message) { MergeMessage(Alerts.ATTENTION, message); } public void Success(string message) { MergeMessage(Alerts.SUCCESS, message); } public void Warning(string message) { MergeMessage(Alerts.WARNING, message); } public void Information(string message) { MergeMessage(Alerts.INFORMATION, message); } public void Error(string message) { MergeMessage(Alerts.ERROR, message); } protected string RenderPartialViewToString(string viewName, object model) { if (string.IsNullOrEmpty(viewName)) viewName = ControllerContext.RouteData.GetRequiredString("action"); ViewData.Model = model; using (StringWriter sw = new StringWriter()) { ViewEngineResult viewResult = ViewEngines.Engines.FindPartialView(ControllerContext, viewName); ViewContext viewContext = new ViewContext(ControllerContext, viewResult.View, ViewData, TempData, sw); viewResult.View.Render(viewContext, sw); return sw.GetStringBuilder().ToString(); } } } }
using Euler_Logic.Helpers; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Euler_Logic.Problems { public class Problem668 : ProblemBase { public override string ProblemName { get { return "668: Square root Smooth Numbers"; } } public override string GetAnswer() { BruteForce(100); return ""; } private void Solve(ulong max) { var primes = new PrimeSieve((ulong)Math.Sqrt(max)); } private void Recursive(IEnumerable<ulong> primes, int primeIndex, ulong num, ulong max) { for (int nextIndex = primeIndex; nextIndex < primes.Count(); nextIndex++) { var prime = primes.ElementAt(nextIndex); if (prime * num > max) { break; } var temp = num; do { temp *= prime; if (temp <= max) { Recursive(primes, primeIndex + 1, temp, max); } else { break; } } while (true); } } private List<ulong> _found; private void BruteForce(ulong max) { _found = new List<ulong>(); var primes = new PrimeSieve(max); for (ulong num = 4; num <= max; num++) { if (!primes.IsPrime(num)) { if (IsGood(num, primes)) { _found.Add(num); } } } } private bool IsGood(ulong num, PrimeSieve primes) { var root = (ulong)Math.Sqrt(num); if (root * root == num) { root -= 1; } var temp = num; foreach (var prime in primes.Enumerate) { if (prime > root) { break; } while (temp % prime == 0) { temp /= prime; } if (temp == 1) { break; } } return temp == 1; } } }
namespace BuhtigIssueTracker.Interfaces { public interface IComment { IUser Author { get; } string Text { get; } } }
using NUnit.Framework; using ProgFrog.Core.Data.Serialization; using ProgFrog.Interface.Data.Serialization; using ProgFrog.Interface.Model; using System; using System.Collections.Generic; namespace ProgFrog.Tests { [TestFixture] public class JsonSerializerTests { private IModelSerializer<ProgrammingTask> _serializer; [SetUp] public void Setup() { _serializer = new JsonSerializer<ProgrammingTask>(); } [Test] public void TestSerialize() { var obj = new ProgrammingTask { Description = "test", Identifier = new GuidIdentifier(Guid.NewGuid()), ParamsAndResults = new List<ParamsAndResults>() }; obj.ParamsAndResults.Add(new ParamsAndResults { Params = new List<string>() { "prms1" }, Results = "res1" }); var serialized = _serializer.Serialize(obj); var serializedExpected = "{\"Description\":\"test\",\"ParamsAndResults\":[{\"Params\":[\"prms1\"],\"Results\":\"res1\"}]}"; Assert.AreEqual(serializedExpected, serialized); } [Test] public void TestDeserialize() { var obj = new ProgrammingTask { Description = "test", Identifier = new GuidIdentifier(Guid.NewGuid()), ParamsAndResults = new List<ParamsAndResults>() }; obj.ParamsAndResults.Add(new ParamsAndResults { Params = new List<string>() { "prms1" }, Results = "res1" }); var serialized= "{\"Description\":\"test\",\"ParamsAndResults\":[{\"Params\":[\"prms1\"],\"Results\":\"res1\"}]}"; var deserialized = _serializer.Deserialize(serialized); Assert.AreEqual(obj, deserialized); } } }
using System; namespace TreatmentJournal.Domain { public class Class1 { } }
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using WebApplication1.Models; namespace WebApplication1.Controllers { public class DbController : Controller { // GET: Db public ActionResult Index() { FDB pseudobaza = new FDB(); F obiekt1 = new F(); obiekt1.ID = 1; obiekt1.GRUPA = "test1"; obiekt1.OPIS = "brak opisu"; F obiekt2 = new F(); obiekt2.ID = 2; obiekt2.GRUPA = "test2"; obiekt2.ROK = 2016; F obiekt3 = new F(); obiekt3.ID = 3; obiekt3.GRUPA = "test3"; obiekt3.ODDZIAL_WYD = "asd"; pseudobaza.Lista.Add(obiekt1); pseudobaza.Lista.Add(obiekt2); pseudobaza.Lista.Add(obiekt3); return View(pseudobaza.Lista); } } }
using UnityEngine; using System.Collections; public class LaunchButton : MonoBehaviour { public LaunchMenu menu; public void OnClick(){ menu.LaunchTerminal (); } }
using System; namespace Sum_Numbers { class Program { static void Main(string[] args) { int numberOfNumbers = int.Parse(Console.ReadLine()); int sumOfNumbers = 0; for (int i = 0; i < numberOfNumbers; i++) { int inputNumber = int.Parse(Console.ReadLine()); sumOfNumbers += inputNumber; } Console.WriteLine(sumOfNumbers); } } }
using CarRental.API.BL.Models.Prices; using CarRental.API.BL.Services.Prices; using CarRental.API.DAL.Entities; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace CarRental.API.Controllers { [ApiController] [Route("[controller]")] public class PriceController : ControllerBase { private readonly IPriceService _priceService; public PriceController(IPriceService priceService) { _priceService = priceService; } [HttpGet] [Route("GetAllPrices")] /// <summary> /// Get a list of items /// </summary> /// <returns>List with TodoModels</returns> public virtual async Task<IEnumerable<PriceModel>> GetAllPrices() { return await _priceService.GetAllAsync(); } [HttpGet] [Route("GetDetailedPrices")] public virtual async Task<IEnumerable<DetailedPrices>> GetDetailedPrices() { return await _priceService.GetDetailedPrices(); } /// <summary> /// Get an item by its id. /// </summary> /// <param name="id">id of the item you want to get</param> /// <returns>Item or StatusCode 404</returns> [HttpGet("GetPrice/{id}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status404NotFound)] [ProducesDefaultResponseType] public virtual async Task<ActionResult<PriceModel>> GetOnePrice(Guid id) { var item = await _priceService.GetAsync(id); if (item is null) { return NotFound(); } return item; } /// <summary> /// Add an item /// </summary> /// <param name="item">Model to add, id will be ignored</param> /// <returns>Id of created item</returns> [HttpPost("AddPrice")] [ProducesResponseType(StatusCodes.Status201Created)] [ProducesDefaultResponseType] public virtual async Task<PriceItem> CreateOnePrice(CreatePriceModel item) { return await _priceService.CreateAsync(item); } /// <summary> /// Update or create an item /// </summary> /// <param name="item"></param> /// <returns></returns> [HttpPut("UpdatePrice")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status204NoContent)] [ProducesDefaultResponseType] public virtual async Task<ActionResult<int>> UpdatePrice(PriceModel item) { var updateItemId = await _priceService.UpsertAsync(item); return Ok(updateItemId); } /// <summary> /// Delete an item /// </summary> /// <param name="id">Id of the item to delete</param> /// <returns>StatusCode 200 or 404</returns> [HttpDelete("DeletePrice/{id}")] [ProducesResponseType(StatusCodes.Status204NoContent)] [ProducesDefaultResponseType] public virtual async Task<ActionResult<bool>> DeletePrice(Guid id) { await _priceService.DeleteAsync(id); return NoContent(); } } }
using System; namespace Apv.AV.Services.DTO { public class ApvAPIResponse<T> { public ApvAPIResponse(int _code, string _msg, T _data) { this.code = _code; this.msg = _msg; this.data = _data; } public int code { get; set; } public string msg { get; set; } public T data { get; set; } } }
using System; using System.Collections.Generic; using System.Text; using System.Threading; namespace Delegates { public class MoviePlayer { public string CurrentMovie { get; set; } public delegate void MovieFinishedHandler(); public event MovieFinishedHandler MovieFinished; public void PlayMovie() { Console.WriteLine($"Playing Movie {CurrentMovie}"); Thread.Sleep(3000); MovieFinished?.Invoke(); } } }
using System; using System.Diagnostics.CodeAnalysis; using System.Reflection; using EnsureThat.Annotations; using EnsureThat.Internals; using JetBrains.Annotations; using NotNullAttribute = System.Diagnostics.CodeAnalysis.NotNullAttribute; namespace EnsureThat.Enforcers { [SuppressMessage("Performance", "CA1822:Mark members as static")] public sealed class TypeArg { private static class Types { internal static readonly Type IntType = typeof(int); internal static readonly Type ShortType = typeof(short); internal static readonly Type DecimalType = typeof(decimal); internal static readonly Type DoubleType = typeof(double); internal static readonly Type FloatType = typeof(float); internal static readonly Type BoolType = typeof(bool); internal static readonly Type DateTimeType = typeof(DateTime); internal static readonly Type StringType = typeof(string); } [return: NotNull] [ContractAnnotation("param:null => halt")] public Type IsInt([ValidatedNotNull, NotNull]Type param, [InvokerParameterName] string paramName = null) => IsOfType(param, Types.IntType, paramName); [return: NotNull] [ContractAnnotation("param:null => halt")] public object IsInt([ValidatedNotNull, NotNull]object param, [InvokerParameterName] string paramName = null) => IsOfType(param, Types.IntType, paramName); [return: NotNull] [ContractAnnotation("param:null => halt")] public Type IsShort([ValidatedNotNull, NotNull]Type param, [InvokerParameterName] string paramName = null) => IsOfType(param, Types.ShortType, paramName); [return: NotNull] [ContractAnnotation("param:null => halt")] public object IsShort([ValidatedNotNull, NotNull]object param, [InvokerParameterName] string paramName = null) => IsOfType(param, Types.ShortType, paramName); [return: NotNull] [ContractAnnotation("param:null => halt")] public Type IsDecimal([ValidatedNotNull, NotNull]Type param, [InvokerParameterName] string paramName = null) => IsOfType(param, Types.DecimalType, paramName); [return: NotNull] [ContractAnnotation("param:null => halt")] public object IsDecimal([ValidatedNotNull, NotNull]object param, [InvokerParameterName] string paramName = null) => IsOfType(param, Types.DecimalType, paramName); [return: NotNull] [ContractAnnotation("param:null => halt")] public Type IsDouble([ValidatedNotNull, NotNull]Type param, [InvokerParameterName] string paramName = null) => IsOfType(param, Types.DoubleType, paramName); [return: NotNull] [ContractAnnotation("param:null => halt")] public object IsDouble([ValidatedNotNull, NotNull]object param, [InvokerParameterName] string paramName = null) => IsOfType(param, Types.DoubleType, paramName); [return: NotNull] [ContractAnnotation("param:null => halt")] public Type IsFloat([ValidatedNotNull, NotNull]Type param, [InvokerParameterName] string paramName = null) => IsOfType(param, Types.FloatType, paramName); [return: NotNull] [ContractAnnotation("param:null => halt")] public object IsFloat([ValidatedNotNull, NotNull]object param, [InvokerParameterName] string paramName = null) => IsOfType(param, Types.FloatType, paramName); [return: NotNull] [ContractAnnotation("param:null => halt")] public Type IsBool([ValidatedNotNull, NotNull]Type param, [InvokerParameterName] string paramName = null) => IsOfType(param, Types.BoolType, paramName); [return: NotNull] [ContractAnnotation("param:null => halt")] public object IsBool([ValidatedNotNull, NotNull]object param, [InvokerParameterName] string paramName = null) => IsOfType(param, Types.BoolType, paramName); [return: NotNull] [ContractAnnotation("param:null => halt")] public Type IsDateTime([ValidatedNotNull, NotNull]Type param, [InvokerParameterName] string paramName = null) => IsOfType(param, Types.DateTimeType, paramName); [return: NotNull] [ContractAnnotation("param:null => halt")] public object IsDateTime([ValidatedNotNull, NotNull]object param, [InvokerParameterName] string paramName = null) => IsOfType(param, Types.DateTimeType, paramName); [return: NotNull] [ContractAnnotation("param:null => halt")] public Type IsString([ValidatedNotNull, NotNull]Type param, [InvokerParameterName] string paramName = null) => IsOfType(param, Types.StringType, paramName); [return: NotNull] [ContractAnnotation("param:null => halt")] public object IsString([ValidatedNotNull, NotNull]object param, [InvokerParameterName] string paramName = null) => IsOfType(param, Types.StringType, paramName); [return: NotNull] [ContractAnnotation("param:null => halt")] public T IsOfType<T>([ValidatedNotNull, NotNull]T param, Type expectedType, [InvokerParameterName] string paramName = null) where T : class { Ensure.Any.IsNotNull(param, paramName); IsOfType(param.GetType(), expectedType, paramName); return param; } [return: NotNull] [ContractAnnotation("param:null => halt")] public Type IsOfType([ValidatedNotNull, NotNull]Type param, Type expectedType, [InvokerParameterName] string paramName = null) { Ensure.Any.IsNotNull(param, paramName); Ensure.Any.IsNotNull(expectedType, nameof(expectedType)); if (param != expectedType) throw Ensure.ExceptionFactory.ArgumentException( string.Format(DefaultFormatProvider.Strings, ExceptionMessages.Types_IsOfType_Failed, expectedType.FullName, param.FullName), paramName); return param; } [return: NotNull] [ContractAnnotation("param:null => halt")] public T IsNotOfType<T>([ValidatedNotNull, NotNull]T param, Type nonExpectedType, [InvokerParameterName] string paramName = null) where T : class { Ensure.Any.IsNotNull(param, paramName); IsNotOfType(param.GetType(), nonExpectedType, paramName); return param; } [return: NotNull] [ContractAnnotation("param:null => halt")] public Type IsNotOfType([ValidatedNotNull, NotNull]Type param, Type nonExpectedType, [InvokerParameterName] string paramName = null) { Ensure.Any.IsNotNull(param, paramName); Ensure.Any.IsNotNull(nonExpectedType, nameof(nonExpectedType)); if (param == nonExpectedType) throw Ensure.ExceptionFactory.ArgumentException( string.Format(DefaultFormatProvider.Strings, ExceptionMessages.Types_IsNotOfType_Failed, nonExpectedType.FullName), paramName); return param; } [return: NotNull] [ContractAnnotation("param:null => halt")] public T IsAssignableToType<T>([ValidatedNotNull, NotNull]T param, Type expectedType, [InvokerParameterName] string paramName = null) where T : class { Ensure.Any.IsNotNull(param, paramName); IsAssignableToType(param.GetType(), expectedType, paramName); return param; } [return: NotNull] [ContractAnnotation("param:null => halt")] public Type IsAssignableToType([ValidatedNotNull, NotNull]Type param, Type expectedType, [InvokerParameterName] string paramName = null) { Ensure.Any.IsNotNull(param, paramName); Ensure.Any.IsNotNull(expectedType, nameof(expectedType)); if (!expectedType.IsAssignableFrom(param)) throw Ensure.ExceptionFactory.ArgumentException( string.Format(DefaultFormatProvider.Strings, ExceptionMessages.Types_IsAssignableToType_Failed, expectedType.FullName, param.FullName), paramName); return param; } [return: NotNull] [ContractAnnotation("param:null => halt")] public T IsNotAssignableToType<T>([ValidatedNotNull, NotNull]T param, Type nonExpectedType, [InvokerParameterName] string paramName = null) where T : class { Ensure.Any.IsNotNull(param, paramName); IsNotAssignableToType(param.GetType(), nonExpectedType, paramName); return param; } [return: NotNull] [ContractAnnotation("param:null => halt")] public Type IsNotAssignableToType([ValidatedNotNull, NotNull]Type param, Type nonExpectedType, [InvokerParameterName] string paramName = null) { Ensure.Any.IsNotNull(param, paramName); Ensure.Any.IsNotNull(nonExpectedType, nameof(nonExpectedType)); if (nonExpectedType.IsAssignableFrom(param)) throw Ensure.ExceptionFactory.ArgumentException( string.Format(DefaultFormatProvider.Strings, ExceptionMessages.Types_IsNotAssignableToType_Failed, nonExpectedType.FullName), paramName); return param; } [return: NotNull] [ContractAnnotation("param:null => halt")] public T IsClass<T>([ValidatedNotNull, NotNull]T param, [InvokerParameterName] string paramName = null) { if (param == null) throw Ensure.ExceptionFactory.ArgumentNullException( ExceptionMessages.Types_IsClass_Failed_Null, paramName); IsClass(param.GetType(), paramName); return param; } [return: NotNull] [ContractAnnotation("param:null => halt")] public Type IsClass([ValidatedNotNull, NotNull]Type param, [InvokerParameterName] string paramName = null) { if (param == null) throw Ensure.ExceptionFactory.ArgumentNullException( ExceptionMessages.Types_IsClass_Failed_Null, paramName); if (!param.GetTypeInfo().IsClass) throw Ensure.ExceptionFactory.ArgumentException( string.Format(DefaultFormatProvider.Strings, ExceptionMessages.Types_IsClass_Failed, param.FullName), paramName); return param; } } }
// Copyright 2012 Mike Caldwell (Casascius) // This file is part of Bitcoin Address Utility. // Bitcoin Address Utility is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // Bitcoin Address Utility is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with Bitcoin Address Utility. If not, see http://www.gnu.org/licenses/. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Diagnostics; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using BtcAddress.Properties; using Org.BouncyCastle.Math; using Org.BouncyCastle.Math.EC; using Casascius.Bitcoin; namespace BtcAddress { public partial class KeyCombiner : Form { public KeyCombiner() { InitializeComponent(); } private void btnCombine_Click(object sender, EventArgs e) { if (sender == null) throw new ArgumentNullException("sender"); if (e == null) throw new ArgumentNullException("e"); // What is input #1? if (txtInput1.Text != null) { var input1 = txtInput1.Text; if (txtInput2.Text != null) { var input2 = txtInput2.Text; PublicKey pub1 = null; PublicKey pub2 = null; KeyPair kp1 = null; KeyPair kp2 = null; if (KeyPair.IsValidPrivateKey(input1)) { pub1 = kp1 = new KeyPair(input1); } else if (PublicKey.IsValidPublicKey(input1)) { pub1 = new PublicKey(input1); } else { MessageBox.Show(Resources.KeyCombiner_btnCombine_Click_Input_key__1_is_not_a_valid_Public_Key_or_Private_Key_Hex, Resources.KeyCombiner_btnCombine_Click_Can_t_combine, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (KeyPair.IsValidPrivateKey(input2)) { pub2 = kp2 = new KeyPair(input2); } else if (PublicKey.IsValidPublicKey(input2)) { pub2 = new PublicKey(input2); } else { MessageBox.Show(Resources.KeyCombiner_btnCombine_Click_Input_key__2_is_not_a_valid_Public_Key_or_Private_Key_Hex, Resources.KeyCombiner_btnCombine_Click_Can_t_combine, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (kp1 == null && kp2 == null && rdoAdd.Checked == false) { MessageBox.Show(Resources.KeyCombiner_btnCombine_Click_Can_t_multiply_two_public_keys___At_least_one_of_the_keys_must_be_a_private_key_, Resources.KeyCombiner_btnCombine_Click_Can_t_combine, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (pub1.IsCompressedPoint != pub2.IsCompressedPoint) { MessageBox.Show(Resources.KeyCombiner_btnCombine_Click_Can_t_combine_a_compressed_key_with_an_uncompressed_key_, Resources.KeyCombiner_btnCombine_Click_Can_t_combine, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (pub1.AddressBase58 == pub2.AddressBase58) { if (MessageBox.Show(Resources.KeyCombiner_btnCombine_Click_Both_of_the_key_inputs_have_the_same_public_key_hash___You_can_continue__but_the_results_are_probably_going_to_be_wrong___You_might_have_provided_the_wrong_information__such_as_two_parts_from_the_same_side_of_the_transaction__instead_of_one_part_from_each_side___Continue_anyway_, "Duplicate Key Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) != DialogResult.OK) { return; } } var ps = Org.BouncyCastle.Asn1.Sec.SecNamedCurves.GetByName("secp256k1"); // Combining two private keys? if (kp1 != null && kp2 != null) { if (kp1.PrivateKeyBytes != null) { var e1 = new BigInteger(1, kp1.PrivateKeyBytes); if (kp2.PrivateKeyBytes != null) { var e2 = new BigInteger(1, kp2.PrivateKeyBytes); if (ps != null && ps.N != null) { var ecombined = (rdoAdd.Checked ? e1.Add(e2) : e1.Multiply(e2)).Mod(ps.N); Debug.WriteLine(kp1.PublicKeyHex); Debug.WriteLine(kp2.PublicKeyHex); if (ecombined != null) { var kpcombined = new KeyPair( Util.Force32Bytes(ecombined.ToByteArrayUnsigned()), kp1.IsCompressedPoint); if (txtOutputAddress != null) if (kpcombined.AddressBase58 != null) txtOutputAddress.Text = kpcombined.AddressBase58; if (txtOutputPubkey != null) if (kpcombined.PublicKeyHex != null) txtOutputPubkey.Text = kpcombined.PublicKeyHex.Replace(" ", string.Empty); if (kpcombined.PrivateKeyBase58 != null) txtOutputPriv.Text = kpcombined.PrivateKeyBase58; } } } } } else if (kp1 != null || kp2 != null) { // Combining one public and one private var priv = kp1 ?? kp2; var pub = kp1 == null ? pub1 : pub2; var point = pub.GetECPoint(); if (point == null) throw new ArgumentNullException("point"); if (priv.PrivateKeyBytes != null) { var combined = rdoAdd != null && rdoAdd.Checked ? point.Add(priv.GetECPoint()) : point.Multiply(new BigInteger(1, priv.PrivateKeyBytes)); if (combined.Y != null && combined.X != null) { var combinedc = ps.Curve.CreatePoint(combined.X.ToBigInteger(), combined.Y.ToBigInteger(), priv.IsCompressedPoint); if (combinedc == null) throw new ArgumentNullException("combinedc"); var pkcombined = new PublicKey(combinedc.GetEncoded()); if (txtOutputAddress != null) txtOutputAddress.Text = pkcombined.AddressBase58; if (txtOutputPubkey != null) txtOutputPubkey.Text = pkcombined.PublicKeyHex.Replace(" ", string.Empty); } } txtOutputPriv.Text = Resources.KeyCombiner_btnCombine_Click_Only_available_when_combining_two_private_keys; } else { // Adding two public keys var combined = pub1.GetECPoint().Add(pub2.GetECPoint()); if (combined != null && (combined.X != null && combined.Y != null)) { var combinedc = ps.Curve.CreatePoint(combined.X.ToBigInteger(), combined.Y.ToBigInteger(), pub1.IsCompressedPoint); if (combinedc != null) { var pkcombined = new PublicKey(combinedc.GetEncoded()); if (txtOutputAddress != null) txtOutputAddress.Text = pkcombined.AddressBase58; if (txtOutputPubkey != null && pkcombined.PublicKeyHex != null) txtOutputPubkey.Text = pkcombined.PublicKeyHex.Replace(" ", string.Empty); } } txtOutputPriv.Text = Resources.KeyCombiner_btnCombine_Click_Only_available_when_combining_two_private_keys; } } } } private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { if (sender == null) throw new ArgumentNullException("sender"); if (e == null) throw new ArgumentNullException("e"); MessageBox.Show(Resources.KeyCombiner_linkLabel1_LinkClicked_EC_Addition_should_not_be_used_for_two_factor_storage___Use_multiplication_instead__Addition_is_safe_when_employing_a_vanity_pool_to_generate_vanity_addresses__and_is_required_for_vanity_address_generators_to_achieve_GPU_accelerated_performance___For_some_other_uses__addition_is_unsafe_due_to_its_reversibility__so_always_use_multiplication_instead_wherever_possible_); } } }
using UnityEngine; using System.Collections; public class RayCast : MonoBehaviour { public float range; private float dmg = 45f; private Camera fpsCam; private Vector3 rayOrigin; RaycastHit hit; // Use this for initialization void Start () { fpsCam = Camera.main; } // Update is called once per frame void Update () { rayOrigin = fpsCam.ViewportToWorldPoint(new Vector3(0.5f ,0.5f, 0)); if(Input.GetButtonDown("Fire1")) { //GetComponent<Animator>().Play(0); attack(); } } void attack() { if (Physics.Raycast(rayOrigin, fpsCam.transform.forward, out hit, range)) { Debug.Log(hit.collider.gameObject); if(hit.collider.CompareTag("Enemy")) hit.collider.GetComponent<EnemyHealth>().enemyHP -= dmg; } } }
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace API.Model { public class Avancement { [Key] public int Id { get; set; } [ForeignKey("IdInscrit")] public Inscrit Inscrit { get; set; } [ForeignKey("IdVideo")] public Video Video { get; set; } [ForeignKey("IdCours")] public Cours Cours { get; set; } public int IdInscrit { get; set; } public int IdVideo { get; set; } public int IdCours { get; set; } } }
using System.Collections; using System.Collections.Generic; using UnityEngine; [RequireComponent(typeof(LineRenderer))] public class Bolt : MonoBehaviour { [SerializeField] private float TimeBetweenFlickers = 0.1f; [SerializeField] private int NumberOfSegments = 6; [SerializeField] private float VarianceAmplitude = 0.025f; private LineRenderer mLine; private float mNextFlicker; virtual protected void Awake() { mLine = GetComponent<LineRenderer>(); RegenerateSegments(); } virtual protected void Update() { if (GameManager.GameState == GameManager.State.GameOver) return; mNextFlicker -= Time.deltaTime; if (mNextFlicker <= 0.0f) { RegenerateSegments(); mNextFlicker = TimeBetweenFlickers; } } private void RegenerateSegments() { Vector3[] segments = new Vector3[NumberOfSegments]; float step = 1.0f / (NumberOfSegments - 1); for (int i = 0; i < NumberOfSegments; i++) { segments[i] = new Vector3( Random.Range(-VarianceAmplitude, VarianceAmplitude), Random.Range(0.0f, VarianceAmplitude), i * step); } mLine.numPositions = NumberOfSegments; mLine.SetPositions(segments); } }
using Pe.Stracon.SGC.Infraestructura.Core.Base; using Pe.Stracon.SGC.Infraestructura.QueryModel.Contractual; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Pe.Stracon.SGC.Infraestructura.Core.QueryContract.Contractual { /// <summary> /// Definición del Repositorio de Variable /// </summary> /// <remarks> /// Creación : GMD 20150527 <br /> /// Modificación : <br /> /// </remarks> public interface IVariableLogicRepository : IQueryRepository<VariableLogic> { /// <summary> /// Realiza la búsqueda de variables de acuerdo al indicador global y plantilla /// </summary> /// <param name="codigoPlantilla">Código de Plantilla</param> /// <returns>Lista de variables de acuerdo al indicador global y plantilla</returns> List<VariableLogic> BuscarVariableGlobal(Guid? codigoPlantilla); /// <summary> /// Realiza la busqueda de variables /// </summary> /// <param name="codigoVariable"></param> /// <param name="identificador"></param> /// <param name="nombre"></param> /// <param name="codigoTipo"></param> /// <param name="indicadorGlobal"></param> /// <param name="codigoPlantilla"></param> /// <returns>Lista de variables</returns> List<VariableLogic> BuscarVariable(Guid? codigoVariable, string identificador, string nombre, string codigoTipo, bool? indicadorGlobal, Guid? codigoPlantilla, bool? indicadorVariableSistema); } }
namespace ProgrammingCourseWork { public enum Categories { Salad = 0, Soup, Main, Beverage, Dessert } }
using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace WebServiceApiBiblioteca.Models { public class RegistroP { public class Rootobject { public Class1[] Property1 { get; set; } } public class Class1 { public int id_libro { get; set; } public string nombre_libro { get; set; } public string autor { get; set; } public string editorial { get; set; } public int cantidad_disponible { get; set; } public DateTime fecha_publicacion { get; set; } public REGISTRO_LIBRO[] REGISTRO_LIBRO { get; set; } } public class REGISTRO_LIBRO { public int id { get; set; } public int id_libro { get; set; } public int id_estudiante { get; set; } public DateTime fecha_registro { get; set; } public DateTime fecha_entrega { get; set; } public bool multa { get; set; } public string observaciones { get; set; } public ESTUDIANTE ESTUDIANTE { get; set; } } public class ESTUDIANTE { public int id_estudiante { get; set; } public string nombre_estudiante { get; set; } public string apellido_estudiante { get; set; } public float telefono_movil { get; set; } public string email { get; set; } public string grupo { get; set; } public int grado { get; set; } public object[] REGISTRO_LIBRO { get; set; } } } }
// Copyright (c) 2018 FiiiLab Technology Ltd // Distributed under the MIT software license, see the accompanying // file LICENSE or or http://www.opensource.org/licenses/mit-license.php. using System; using System.Collections.Generic; using System.Text; namespace FiiiChain.Framework { public class Base58 { public static string Encode(byte[] bytes) { return SimpleBase.Base58.Bitcoin.Encode(bytes); } public static byte[] Decode(string text) { return SimpleBase.Base58.Bitcoin.Decode(text); } } }
using gView.Framework.Globalisation; using gView.Framework.IO; using gView.Framework.UI; using System; using System.Collections.Generic; namespace gView.Plugins.MapTools { [gView.Framework.system.RegisterPlugIn("1F1B9CEC-F957-43fd-B482-C41606160560")] public class MainToolbar : IToolbar, IPersistable { private List<Guid> _guids; public MainToolbar() { _guids = new List<Guid>(); _guids.Add(new Guid("D1A87DBA-00DB-4704-B67B-4846E6F03959")); // New _guids.Add(new Guid("CEACE261-ECE4-4622-A892-58A5B32E5295")); // Load _guids.Add(new Guid("FCA2C303-A0B6-4f36-BD21-E1C119EB9C8E")); // Save _guids.Add(new Guid("00000000-0000-0000-0000-000000000000")); _guids.Add(new Guid("11BA5E40-A537-4651-B475-5C7C2D65F36E")); // Add Dataset _guids.Add(new Guid("0728E12C-AC12-4264-9B47-ECE6BB0CFFA9")); // TOC _guids.Add(new Guid("00000000-0000-0000-0000-000000000000")); _guids.Add(new Guid("97F70651-C96C-4b6e-A6AD-E9D3A22BFD45")); // Copy _guids.Add(new Guid("3E36C2AD-2C58-42ca-A662-EE0C2DC1369D")); // Cut _guids.Add(new Guid("0F8673B3-F1C9-4f5f-86C4-2B41FCBE535B")); // Paste _guids.Add(new Guid("4F54D455-1C22-469e-9DBB-78DBBEF6078D")); // Delete //_guids.Add(new Guid("00000000-0000-0000-0000-000000000000")); } #region IToolbar Members //public bool Visible //{ // get // { // return _visible; // } // set // { // _visible = value; // } //} public string Name { get { return LocalizedResources.GetResString("Toolbars.Standard", "Standard"); } } public List<Guid> GUIDs { get { return _guids; } set { _guids = value; } } #endregion #region IPersistable Members public string PersistID { get { return ""; } } public void Load(gView.Framework.IO.IPersistStream stream) { } public void Save(gView.Framework.IO.IPersistStream stream) { } #endregion } [gView.Framework.system.RegisterPlugIn("052F5F8C-94FC-4827-9147-F65FCC61FFB3")] public class ToolsToolbar : IToolbar, IPersistable { private List<Guid> _guids; public ToolsToolbar() { _guids = new List<Guid>(); _guids.Add(new Guid("09007AFA-B255-4864-AC4F-965DF330BFC4")); // Zoomin Dyn _guids.Add(new Guid("51D04E6F-A13E-40b6-BF28-1B8E7C24493D")); // Zoomout Dyn _guids.Add(new Guid("00000000-0000-0000-0000-000000000000")); _guids.Add(new Guid("3E2E9F8C-24FB-48f6-B80E-1B0A54E8C309")); // SmartNavigation _guids.Add(new Guid("2680F0FD-31EE-48c1-B0F7-6674BAD0A688")); // Pan _guids.Add(new Guid("00000000-0000-0000-0000-000000000000")); _guids.Add(new Guid("6351BCBE-809A-43cb-81AA-6414ED3FA459")); // Zoomin Static _guids.Add(new Guid("E1C01E9D-8ADC-477b-BCD1-6B7BBA756D44")); // Zoomout Static _guids.Add(new Guid("58AE3C1D-40CD-4f61-8C5C-0A955C010CF4")); // Zoom To Full Extent _guids.Add(new Guid("00000000-0000-0000-0000-000000000000")); _guids.Add(new Guid("82F8E9C3-7B75-4633-AB7C-8F9637C2073D")); // Back _guids.Add(new Guid("CFE66CDF-CD95-463c-8CD1-2541574D719A")); // Forward _guids.Add(new Guid("00000000-0000-0000-0000-000000000000")); _guids.Add(new Guid("1E21835C-FD41-4e68-8462-9FAA66EA5A54")); // QueryTuemeText _guids.Add(new Guid("51A2CF81-E343-4c58-9A42-9207C8DFBC01")); // QueryThemeCombo _guids.Add(new Guid("F13D5923-70C8-4c6b-9372-0760D3A8C08C")); // Identify _guids.Add(new Guid("ED5B0B59-2F5D-4b1a-BAD2-3CABEF073A6A")); // Search _guids.Add(new Guid("00000000-0000-0000-0000-000000000000")); _guids.Add(new Guid("D185D794-4BC8-4f3c-A5EA-494155692EAC")); // Measure _guids.Add(new Guid("2AC4447E-ACF3-453D-BB2E-72ECF0C8506E")); // XY _guids.Add(new Guid("00000000-0000-0000-0000-000000000000")); _guids.Add(new Guid("646860CF-4F82-424b-BF7D-822BE7A214FF")); // Select _guids.Add(new Guid("F3DF8F45-4BAC-49ee-82E6-E10711029648")); // Zoom 2 Selection _guids.Add(new Guid("16C05C00-7F21-4216-95A6-0B4B020D3B7D")); // Clear Selection } #region IToolbar Members //public bool Visible //{ // get // { // return _visible; // } // set // { // _visible = value; // } //} public string Name { get { return LocalizedResources.GetResString("Toolbars.Tools", "Tools"); } } public List<Guid> GUIDs { get { return _guids; } set { _guids = value; } } #endregion #region IPersistable Member void IPersistable.Load(IPersistStream stream) { //_visible = (bool)stream.Load("visible", true); } void IPersistable.Save(IPersistStream stream) { //stream.Save("visible", _visible); } #endregion } [gView.Framework.system.RegisterPlugIn("9FBD6EB9-9D41-475f-BEC4-1D983B1590BC")] public class ScaleToolbar : IToolbar, IPersistable { private List<Guid> _guids; public ScaleToolbar() { _guids = new List<Guid>(); _guids.Add(new Guid("9AADD17B-CDD0-4111-BBC5-E31E060CE210")); // ScaleText _guids.Add(new Guid("03058244-16EE-44dd-B185-5522281498F5")); // Scale } #region IToolbar Member public string Name { get { return LocalizedResources.GetResString("Toolbars.Scale", "Scale"); } } public List<Guid> GUIDs { get { return _guids; } set { } } #endregion #region IPersistable Member public void Load(IPersistStream stream) { } public void Save(IPersistStream stream) { } #endregion } }
using UnityEngine; using UnityEngine.UI; public class ImageClear : Graphic { protected override void OnPopulateMesh(VertexHelper vh) { vh.Clear(); } }
using System; using System.Collections.Generic; using System.Linq; using DelftTools.Shell.Core; using DelftTools.Shell.Core.Workflow; using DelftTools.Utils; using DelftTools.Utils.Collections.Generic; using NUnit.Framework; using Rhino.Mocks; namespace DelftTools.Tests.Core { [TestFixture] public class FolderTest { readonly MockRepository mocks = new MockRepository(); [Test] public void Clone() { Folder f = new Folder(); const string folderName = "test1"; f.Name = folderName; Folder f2 = (Folder) f.DeepClone(); Assert.AreEqual(f2.Name, f.Name); } /// <summary> /// When list of dataitems is assigned to folder dataitems owner property should be updated /// </summary> [Test] public void UpdateDataItemOwner() { EventedList<IDataItem> dataItems = new EventedList<IDataItem>(); DataItem dataItem = new DataItem(); dataItems.Add(dataItem); Folder folder = new Folder {DataItems = dataItems}; Assert.AreEqual(folder, dataItem.Owner); EventedList<IDataItem> dataItems2 = new EventedList<IDataItem>(); DataItem dataItem2 = new DataItem(); dataItems2.Add(dataItem2); folder.DataItems = dataItems2; } /// <summary> /// When list of folders is assigned to folder folders parent property should be updated /// </summary> [Test] public void UpdateFolderParent() { Folder folder = new Folder(); Folder childFolder = new Folder(); EventedList<Folder>folders=new EventedList<Folder>(); folders.Add(childFolder); folder.Folders = folders; Assert.AreEqual(folder, childFolder.Parent); } [Test] public void AddDataItemImplicitly() { var folder = new Folder(); var value = "test"; folder.Add(value); Assert.AreEqual(1, folder.Items.Count); Assert.AreEqual(typeof(string), folder.DataItems.FirstOrDefault().ValueType); Assert.AreEqual(value, folder.DataItems.FirstOrDefault().Value); } [Test] public void GetAllItemsRecursive() { Folder folder = new Folder(); DataItem dataItem = new DataItem(); var subFolder = new Folder {Name = "subFolder"}; var model = mocks.Stub<IModel>(); Expect.Call(model.GetDirectChildren()).Return(Enumerable.Empty<object>()).Repeat.Any(); mocks.ReplayAll(); folder.Items.Add(model); folder.Items.Add(dataItem); folder.Items.Add(subFolder); // no default sorting expect same sequence as adding Assert.AreEqual(new object[] { folder, model,dataItem,subFolder }, folder.GetAllItemsRecursive().ToArray()); } [Test] public void CannotDeleteLinkedDataItem() { Folder folder = new Folder(); DataItem dataItem = new DataItem(); folder.Items.Add(dataItem); //create a reference to the dataitem DataItem linkedItem = new DataItem(); linkedItem.LinkTo(dataItem); //try to delete the item this should not happen folder.Items.RemoveAt(0); //todo: find a way to read the message in the log4net logger. Assert.AreEqual(1,folder.DataItems.Count()); } [Test] public void DisposingFolderDisposesContents() { Folder folder = new Folder(); IDataItem dataItem = mocks.StrictMultiMock<IDataItem>(new[] { typeof(IDisposable) }); (dataItem as IDisposable).Expect(d => d.Dispose()).Repeat.Once(); //our test dataItem.Expect(d => d.LinkedBy).Return(new List<IDataItem>()).Repeat.Any(); dataItem.Expect(d => d.Owner).Repeat.Any().SetPropertyAndIgnoreArgument(); mocks.ReplayAll(); folder.Items.Add(dataItem); folder.Dispose(); mocks.VerifyAll(); } [Test] public void SetDataItemValueByName() { var folder = new Folder(); var dataItem = new DataItem("s1"); folder.Add(dataItem); var item = folder["s1"]; item .Should().Be.EqualTo(dataItem); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Lab2_api.Models; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; namespace Lab2_api.Controllers { [Route("api/[controller]")] [ApiController] public class MoviesController : ControllerBase { private Models.MoviesDbContext context; public MoviesController(Models.MoviesDbContext context) { this.context = context; } //// GET: api/Flowers //[HttpGet] //public IEnumerable<Models.Movie> Get() //{ // return context.Movies.Where(m => m.Date <= new DateTime(2019, 3, 11, 11, 20, 0) // && m.Date >= new DateTime(2019, 3, 10, 12, 30, 0)).OrderBy(m => m.Year); //} // GET: api/Flowers [HttpGet] public IEnumerable<Models.Movie> Get([FromQuery]DateTime? from, [FromQuery]DateTime? to, [FromQuery]String genre) { IQueryable<Movie> result = context.Movies.Include(m => m.Comments); if (from == null && to == null && genre == null) { return result; } if (from != null) { result = result.Where(m => m.Date >= from); } if (to != null) { result = result.Where(m => m.Date <= to); } if (genre != null) { result = result.Where(m => m.Genre.Equals(genre)); } return result; } // GET: api/Products/5 [HttpGet("{id}", Name = "Get")] public IActionResult Get(int id) { var existing = context.Movies.Include(m => m.Comments).FirstOrDefault(movie => movie.Id == id); if (existing == null) { return NotFound(); } return Ok(existing); } // POST: api/Products [HttpPost] public void Post([FromBody] Movie movie) { //if (!ModelState.IsValid) //{ //} context.Movies.Add(movie); context.SaveChanges(); } // PUT: api/Flowers/5 [HttpPut("{id}")] public IActionResult Put(int id, [FromBody] Movie movie) { var existing = context.Movies.Include(t => t.Comments).AsNoTracking().FirstOrDefault(m => m.Id == id); if (existing == null) { context.Movies.Add(movie); context.SaveChanges(); return Ok(movie); } movie.Id = id; context.Movies.Update(movie); context.SaveChanges(); return Ok(movie); } // DELETE: api/ApiWithActions/5 [HttpDelete("{id}")] public IActionResult Delete(int id) { var existing = context.Movies.Include(t => t.Comments).FirstOrDefault(movie => movie.Id == id); if (existing == null) { return NotFound(); } context.Movies.Remove(existing); context.SaveChanges(); return Ok(); } } }