Summary description for DataBank
예제 #1
0
        public ActionResult Details(int?id)
        {
            MethodBank mb     = new MethodBank();
            int        userId = Convert.ToInt32(Session["UserID"]);
            int        subId  = Convert.ToInt32(Session["SubcriptionId"]);
            int        resId  = Convert.ToInt32(Session["ResId"]);

            if (id == null || !mb.UseResource(userId, subId, resId))
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DataBank db       = new DataBank();
            ToDoList toDoList = db.GetToDolistItem(id);

            if (toDoList == null)
            {
                return(HttpNotFound());
            }
            toDoList.Resource = db.GetResource(Convert.ToInt32(Session["ResId"]));
            ToDoListViewModel viewModel = new ToDoListViewModel();

            viewModel.ID          = toDoList.ID;
            viewModel.Title       = toDoList.Title;
            viewModel.Content     = toDoList.Content;
            viewModel.CreatedDate = toDoList.CreatedDate;
            viewModel.Done        = toDoList.Done;
            viewModel.DueDate     = toDoList.DueDate;
            viewModel.Prority     = toDoList.Prority;
            return(View(viewModel));
        }
예제 #2
0
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DataBank db       = new DataBank();
            ToDoList toDoList = db.GetToDolistItem(id);

            if (toDoList == null)
            {
                return(HttpNotFound());
            }
            toDoList.Resource = db.GetResource(Convert.ToInt32(Session["ResId"]));
            ToDoListViewModel viewModel = new ToDoListViewModel();

            viewModel.ID          = toDoList.ID;
            viewModel.Title       = toDoList.Title;
            viewModel.Content     = toDoList.Content;
            viewModel.CreatedDate = toDoList.CreatedDate;
            viewModel.Done        = toDoList.Done;
            viewModel.DueDate     = toDoList.DueDate;
            viewModel.Prority     = toDoList.Prority;
            return(View(viewModel));
        }
예제 #3
0
 void Start()
 {
     dataBank = this;
     vidas    = 1;
     rings    = 0;
     score    = 0;
 }
예제 #4
0
    public static void UpdateSaveData()
    {
        DataBank         bank     = DataBank.Open();
        UserGameSaveData saveData = new UserGameSaveData();

        saveData.pleaseCharacterId         = UserPlayData.Instance.userGamePlayData.pleaseCharacterId;
        saveData.pleaseCommandFlg          = UserPlayData.Instance.userGamePlayData.pleaseCommandFlg;
        saveData.pleaseCompleteTime        = UserPlayData.Instance.userGamePlayData.pleaseCompleteTime;
        saveData.pleaseCompleteYear        = UserPlayData.Instance.userGamePlayData.pleaseCompleteTime.Year;
        saveData.pleaseCompleteMonth       = UserPlayData.Instance.userGamePlayData.pleaseCompleteTime.Month;
        saveData.pleaseCompleteDay         = UserPlayData.Instance.userGamePlayData.pleaseCompleteTime.Day;
        saveData.pleaseCompleteHour        = UserPlayData.Instance.userGamePlayData.pleaseCompleteTime.Hour;
        saveData.pleaseCompleteMinute      = UserPlayData.Instance.userGamePlayData.pleaseCompleteTime.Minute;
        saveData.pleaseCompleteSecond      = UserPlayData.Instance.userGamePlayData.pleaseCompleteTime.Second;
        saveData.pleaseCompleteMilliSecond = UserPlayData.Instance.userGamePlayData.pleaseCompleteTime.Second;
        saveData.pleaseItemId       = UserPlayData.Instance.userGamePlayData.pleaseItemId;
        saveData.userCharacterDatas = new List <UserCharacterSaveData>();
        foreach (KeyValuePair <int, UserCharacterData> userSaveData in UserPlayData.Instance.userGamePlayData.userCharacterData)
        {
            foreach (KeyValuePair <int, int> itemCountTable in userSaveData.Value.itemCountTable)
            {
                var userCharacterSaveData = new UserCharacterSaveData();
                userCharacterSaveData.characterId = userSaveData.Key;
                userCharacterSaveData.itemId      = itemCountTable.Key;
                userCharacterSaveData.itemCount   = itemCountTable.Value;
                saveData.userCharacterDatas.Add(userCharacterSaveData);
            }
        }
        bank.Store("userGamePlay", saveData);
        bank.SaveAll();
    }
예제 #5
0
    // Update is called once per frame
    void Update()
    {
        // タイトルシーンでの処理
        if (DataBank.GetCurrScene() == Scene.TITLE)
        {
            UtillityMethod.PlanetRotate(this.gameObject, -gameData.MAP_SPEED * Time.deltaTime);
        }
        // ゲームシーンでの処理
        else
        {
            UtillityMethod.PlanetRotate(this.gameObject, gameData.speed);

            if (UtillityMethod.GetMessage(Message.RESPOWN))
            {
                transform.position = new Vector3(0, 10, -10);
                transform.rotation = new Quaternion(0, 0, 0, 0);
            }

            himoController.CreateHimo(gameObject);

            DestroyChild("TitleEnd");

            // イベント処理(くしゃみ)
            if (EventDirector.can_achoo_event)
            {
                EventDirector.StartAchooEvent(gameObject);
            }
        }
    }
예제 #6
0
        public ActionResult DeleteConfirmed(int id)
        {
            DataBank db       = new DataBank();
            ToDoList toDoList = db.GetToDolistItem(id);

            db.RemoveToDo(toDoList);
            return(RedirectToAction("Index"));
        }
예제 #7
0
        public void CorrectConvolutionsAdding()
        {
            DataBank dataBank = new DataBank();

            Assert.AreEqual(0, dataBank.ConvolutionsCount);
            dataBank.Convolutions.Add("123");
            Assert.AreEqual(1, dataBank.ConvolutionsCount);
        }
예제 #8
0
    void Start()
    {
        _gc   = GameObject.Find("GameController").GetComponent <GameController>();
        _sldm = GameObject.Find("SaveLoadWindow").GetComponent <SaveLoadDataManager>();
        bank  = DataBank.Open();
        //Debug.Log($"save path of bank is { bank.SavePath }");
        //セーブデータが存在しないならば作成せよのIF文
        bank.Load <SaveData>(gameObject.name);
        saveData = bank.Get <SaveData>(gameObject.name);
        if (saveData == null)
        {
            saveData = new SaveData()
            {
                icon_name     = "silhouette",
                chara_name    = "del_chara",
                time          = "YYYY/MM/DD\nah:mm",
                text          = "セーブデータがありません",
                sceneLoadName = "",
                loadnum       = 0,
                id            = ""
            };

            bank.Store(gameObject.name, saveData);

            bank.SaveAll();

            saveData = bank.Get <SaveData>(gameObject.name);
            //bank.Clear();
        }


        foreach (Transform child in this.transform)
        {
            if (child.name == "Image")
            {
                _charaIcoImage = child.gameObject.GetComponent <Image>();
            }
            else if (child.name == "Time")
            {
                _time = child.gameObject.GetComponent <Text>();
            }
            else if (child.name == "Comment")
            {
                foreach (Transform child2 in child.transform)
                {
                    if (child2.name == "Placeholder")
                    {
                        _comment = child2.gameObject.GetComponent <Text>();
                    }
                }
            }
        }
        _charaIcoImage.sprite = Resources.Load <Sprite>("Image/CharaIcons/" + saveData.icon_name);
        _time.text            = saveData.time;
        _comment.text         = saveData.text;
    }
예제 #9
0
 public ActionResult Edit([Bind(Include = "ID,SubcriptionID,UserID,DailyLimit")] UserSubcription userSubcription)
 {
     if (ModelState.IsValid)
     {
         DataBank db = new DataBank();
         db.EditUserSubcription(userSubcription);
         return(RedirectToAction("Index"));
     }
     return(View(userSubcription));
 }
 public ActionResult Edit([Bind(Include = "ID,Name,Description,CreditLimit")] Subcription subcription)
 {
     if (ModelState.IsValid)
     {
         DataBank db = new DataBank();
         db.EditSubcription(subcription);
         return(RedirectToAction("Index"));
     }
     return(View(subcription));
 }
예제 #11
0
        /// <summary>
        /// Gets the address pointed to by a pointer in the data bank.
        /// </summary>
        /// <param name="baseAddress"></param>
        /// <param name="Index"></param>
        /// <returns></returns>
        private int GetPointerLocal(int baseAddress, Register Index = null)
        {
            int addr = DataBank.GetLongAddress(baseAddress);

            if (Index != null)
            {
                addr += Index.Value;
            }
            return(addr);
        }
예제 #12
0
        /// <summary>
        /// Gets the address pointed to by a pointer referenced by a long address.
        /// </summary>
        /// <param name="baseAddress">24-bit address</param>
        /// <param name="Index"></param>
        /// <returns></returns>
        private int GetPointerLong(int baseAddress, Register Index = null)
        {
            int addr = baseAddress;

            if (Index != null)
            {
                addr += Index.Value;
            }
            return(DataBank.GetLongAddress(MemMgr.ReadWord(addr)));
        }
예제 #13
0
 public ApplicationEntryPoint()
 {
     InitializeComponent();
     ApplicationData = DataBank.LoadData();
     if (ApplicationData == null)
     {
         ApplicationData = new DataBank();
         ApplicationData.SaveData();
     }
 }
 public ActionResult Edit([Bind(Include = "ID,Name,ActivationFee")] Resource resource)
 {
     if (ModelState.IsValid)
     {
         DataBank db = new DataBank();
         db.EditResource(resource);
         return(RedirectToAction("Index"));
     }
     return(View(resource));
 }
예제 #15
0
    public void SaveChangePanel()
    {
        bank = DataBank.Open();

        //セーブデータが存在しないならば作成せよのIF文
        bank.Load <SaveData>(gameObject.name);
        saveData = bank.Get <SaveData>(gameObject.name);
        if (saveData == null)
        {
            saveData = new SaveData()
            {
                icon_name     = "silhouette",
                chara_name    = "del_chara",
                time          = "YYYY/MM/DD\nah:mm",
                text          = "セーブデータがありません",
                sceneLoadName = "",
                loadnum       = 0,
                id            = ""
            };

            bank.Store(gameObject.name, saveData);

            bank.SaveAll();

            saveData = bank.Get <SaveData>(gameObject.name);
            //bank.Clear();
        }

        foreach (Transform child in this.transform)
        {
            if (child.name == "Image")
            {
                _charaIcoImage = child.gameObject.GetComponent <Image>();
            }
            else if (child.name == "Time")
            {
                _time = child.gameObject.GetComponent <Text>();
            }
            else if (child.name == "Comment")
            {
                foreach (Transform child2 in child.transform)
                {
                    if (child2.name == "Placeholder")
                    {
                        _comment = child2.gameObject.GetComponent <Text>();
                    }
                }
            }
        }
        _charaIcoImage.sprite = Resources.Load <Sprite>("Image/CharaIcons/" + saveData.icon_name);
        _time.text            = saveData.time;
        _comment.text         = saveData.text;
    }
예제 #16
0
 // Start is called before the first frame update
 void Start()
 {
     if (!singleton)
     {
         DontDestroyOnLoad(gameObject);
         singleton = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
예제 #17
0
        /// <summary>
        /// Gets the address pointed to by a pointer in Direct page.
        /// be in the Direct Page. The address returned will be DBR+Pointer.
        /// </summary>
        /// <param name="baseAddress"></param>
        /// <param name="Index"></param>
        /// <returns></returns>
        private int GetPointerDirect(int baseAddress, Register Index = null)
        {
            int addr = DirectPage.Value + baseAddress;

            if (Index != null)
            {
                addr += Index.Value;
            }
            int pointer = MemMgr.ReadWord(addr);

            return(DataBank.GetLongAddress(pointer));
        }
예제 #18
0
        public ActionResult AddVoucher([Bind(Include = "user,subcription,Used,ExpiryDate")] Voucher voucher)
        {
            DataBank db = new DataBank();

            voucher.user        = db.GetUser(Convert.ToInt32(Session["VoucherUserId"]));
            voucher.subcription = db.GetSubcription(Convert.ToInt32(Session["VoucherSubscriptionId"]));
            voucher.Date        = DateTime.Now;
            if (db.AddVoucher(voucher))
            {
                return(RedirectToAction("Index"));
            }
            return(View());
        }
예제 #19
0
        public void CorrectTaskAdding()
        {
            DataBank   dataBank = new DataBank();
            TaskFormat task     = new TaskFormat();

            dataBank.AddTask(task);

            Assert.AreEqual(1, dataBank.TaskCount);
            Assert.AreEqual(0, dataBank.ProgressedTaskCount);

            dataBank.AddTaskToProgressedList(task);

            Assert.AreEqual(1, dataBank.TaskCount);
            Assert.AreEqual(1, dataBank.ProgressedTaskCount);
        }
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DataBank db       = new DataBank();
            Resource resource = db.GetResource(id);

            if (resource == null)
            {
                return(HttpNotFound());
            }
            return(View(resource));
        }
 public ActionResult Create([Bind(Include = "ID,Name,ActivationFee,subcriptionId")] ResourceModelView resource)
 {
     if (ModelState.IsValid)
     {
         DataBank db       = new DataBank();
         var      res      = db.GetSubcription(resource.subcriptionId);
         var      finalRes = new Resource()
         {
             ActivationFee = resource.ActivationFee, Name = resource.Name, subcription = res
         };
         db.CreateResource(finalRes);
         return(RedirectToAction("Index"));
     }
     return(View(resource));
 }
예제 #22
0
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DataBank db       = new DataBank();
            ToDoList toDoList = db.GetToDolistItem(id);

            if (toDoList == null)
            {
                return(HttpNotFound());
            }
            return(View(toDoList));
        }
        public ActionResult EditCreditPool(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DataBank    db          = new DataBank();
            Subcription subcription = db.GetSubcription(id);

            if (subcription == null)
            {
                return(HttpNotFound());
            }
            return(View(subcription));
        }
예제 #24
0
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DataBank        db = new DataBank();
            UserSubcription userSubcription = db.GetUserSubcription(id);

            if (userSubcription == null)
            {
                return(HttpNotFound());
            }
            return(View(userSubcription));
        }
        public ActionResult Index()
        {
            int      subId               = Convert.ToInt32(Session["SubscriptionID"]);
            DataBank db                  = new DataBank();
            var      dbResource          = db.GetResourceById(subId);
            List <ResourceModelView> rvm = new List <ResourceModelView>();

            foreach (var res in dbResource)
            {
                rvm.Add(new ResourceModelView()
                {
                    ID = res.ID, ActivationFee = res.ActivationFee, Name = res.Name, subcriptionId = subId
                });
            }
            return(View(rvm));
        }
예제 #26
0
 public ActionResult Index()
 {
     if (Session["UserID"] != null)
     {
         Session["ResId"]         = Request.QueryString["resId"];
         Session["SubcriptionId"] = Request.QueryString["subcriptionId"];
         //
         int        UserId = Convert.ToInt32(Session["UserId"]);
         int        subId  = Convert.ToInt32(Session["SubcriptionId"]);
         DataBank   db     = new DataBank();
         MethodBank mb     = new MethodBank();
         ViewBag.CreditBalance = mb.GetUserUsageBalance(subId, UserId);
         return(View(db.GetToDoList()));
     }
     return(RedirectToAction("Login", "Home", new { area = "" }));
 }
예제 #27
0
    // Use this for initialization
    void Start()
    {
        GameObject[] icons = GameObject.FindGameObjectsWithTag(ItemIconTag);
        if (icons.Length > 0)
        {
            ItemIcons = new List <Image>();
            foreach (var i in icons)
            {
                ItemIcons.Add(i.GetComponent <Image>());
            }
        }

        DataBank data = GameObject.FindObjectOfType <DataBank>();

        SetSymptoms(data.symptoms);
    }
예제 #28
0
        public static void Processor()
        {
            Console.Title = "DataBank Converter";
            Main.Choose(1, "databank", out string[] FileNames);

            DataBank DB;

            string[] file_split;
            int      File_Checksum = 0, Get_Checksum;

            foreach (string file in FileNames)
            //try
            {
                string filename = Path.GetFileNameWithoutExtension(file);
                file_split = filename.Split('_');
                DB         = new DataBank();
                if (file_split.Length == 5 && file.EndsWith(".dat"))
                {
                    if (int.TryParse(file_split[3], out File_Checksum))
                    {
                        Get_Checksum = DCC.CalculateChecksum(file);
                        if (File_Checksum == Get_Checksum)
                        {
                            string filepath = file.Replace(filename + ".dat", "");
                            Console.Title = "DataBank Converter: " + filename;
                            DB.DBReader(file);
                            DB.XMLWriter(filepath + file_split[0] + "_" +
                                         file_split[1] + "_" + file_split[2] + ".xml");
                        }
                    }
                }
                else if (file.EndsWith(".xml"))
                {
                    string filepath = file.Replace(Path.GetExtension(file), "");
                    Console.Title = "DataBank Converter: " + Path.GetFileNameWithoutExtension(file);
                    DB.XMLReader(file);
                    DB.DBWriter(filepath);
                }
            }
            //catch (Exception e) { Console.WriteLine(e.Message); }
        }
예제 #29
0
    // Start is called before the first frame update
    void Start()
    {
        if (!singleton)
        {
            DontDestroyOnLoad(gameObject);
            singleton = this;
        }
        else
        {
            Destroy(gameObject);
        }

        if (DataBank.GetCurrScene() == Scene.TITLE)
        {
            //PrefabGenerator.CreateChild(gameObject, "Prefab/UI/title_logoPrefab", new Vector3(0,10,0), 0, "Title_Logo");

            PrefabGenerator.CreateChild(gameObject, "Prefab/UI/sky_bgPrefab", new Vector3(0, 10, 0), 0, "sky_bg");

            PrefabGenerator.CreateChild(gameObject, "Prefab/Event/TitleEnd/TitleEndPrefab", "TitleEnd");
        }
    }
예제 #30
0
        public ActionResult Edit([Bind(Include = "ID,Title,Content,Prority,Done,CreatedDate,DueDate")] ToDoListViewModel toDoList)
        {
            ToDoList UpdatedToDo = new ToDoList();
            DataBank db          = new DataBank();

            UpdatedToDo.ID          = toDoList.ID;
            UpdatedToDo.Title       = toDoList.Title;
            UpdatedToDo.Content     = toDoList.Content;
            UpdatedToDo.CreatedDate = toDoList.CreatedDate;
            UpdatedToDo.Done        = toDoList.Done;
            UpdatedToDo.DueDate     = toDoList.DueDate;
            UpdatedToDo.Prority     = toDoList.Prority;
            UpdatedToDo.Resource    = db.GetResource(toDoList.Resource);

            if (ModelState.IsValid)
            {
                db.EditToDo(UpdatedToDo);
                return(RedirectToAction("Index"));
            }
            return(View(toDoList));
        }