public ActionResult DeleteConfirmed(int id)
        {
            SECTION sECTION = db.SECTIONs.Find(id);

            db.SECTIONs.Remove(sECTION);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
 public void Initialize()
 {
     this.open = true;
     this.active = true;
     this.reverse = false;
     this.owner = true;
     this.Location = new Point(0, 0);
     this.section = SECTION.NONE;
 }
Example #3
0
 public void Initialize()
 {
     this.open     = true;
     this.active   = true;
     this.reverse  = false;
     this.owner    = true;
     this.Location = new Point(0, 0);
     this.section  = SECTION.NONE;
 }
Example #4
0
 private static List <TranslationEntity> LoadDataFromDatabase(SECTION tab)
 {
     using (var db = DBConn.Open())
     {
         var param = new DynamicParameters();
         param.Add("@Tab", tab);
         param.Add("@Lang", CurrentUser.Language);
         var model = db.Query <TranslationEntity>("qry_F_Translations", param, commandType: CommandType.StoredProcedure).ToList();
         return(model);
     }
 }
Example #5
0
 public void setAll(Card setCard)
 {
     this.id = setCard.id;
     this.no = setCard.no;
     this.open = setCard.open;
     this.active = setCard.active;
     this.reverse = setCard.reverse;
     this.owner = setCard.owner;
     this.Location.X = setCard.Location.X;
     this.Location.Y = setCard.Location.Y;
     this.section = setCard.section;
 }
Example #6
0
 public void setAll(Card setCard)
 {
     this.id         = setCard.id;
     this.no         = setCard.no;
     this.open       = setCard.open;
     this.active     = setCard.active;
     this.reverse    = setCard.reverse;
     this.owner      = setCard.owner;
     this.Location.X = setCard.Location.X;
     this.Location.Y = setCard.Location.Y;
     this.section    = setCard.section;
 }
 public ActionResult Edit([Bind(Include = "Section_ID,SectionName,TotalStudents,Admin_ID,Class_ID,SectionGroup")] SECTION sECTION)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sECTION).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Admin_ID = new SelectList(db.ADMINs, "Admin_ID", "AdminName", sECTION.Admin_ID);
     ViewBag.Class_ID = new SelectList(db.CLASSes, "Class_ID", "ClassName", sECTION.Class_ID);
     return(View(sECTION));
 }
        // GET: SECTIONs/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SECTION sECTION = db.SECTIONs.Find(id);

            if (sECTION == null)
            {
                return(HttpNotFound());
            }
            return(View(sECTION));
        }
        // GET: SECTIONs/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SECTION sECTION = db.SECTIONs.Find(id);

            if (sECTION == null)
            {
                return(HttpNotFound());
            }
            ViewBag.Admin_ID = new SelectList(db.ADMINs, "Admin_ID", "AdminName", sECTION.Admin_ID);
            ViewBag.Class_ID = new SelectList(db.CLASSes, "Class_ID", "ClassName", sECTION.Class_ID);
            return(View(sECTION));
        }
        public ActionResult Create([Bind(Include = "Section_ID,SectionName,TotalStudents,Admin_ID,Class_ID,SectionGroup")] SECTION sECTION)
        {
            if (ModelState.IsValid)
            {
                db.SECTIONs.Add(sECTION);
                db.SaveChanges();
                // return RedirectToAction("Index");
            }

            ViewBag.Admin_ID = new SelectList(db.ADMINs, "Admin_ID", "AdminName", sECTION.Admin_ID);
            ViewBag.Class_ID = new SelectList(db.CLASSes, "Class_ID", "ClassName", sECTION.Class_ID);
            ModelState.Clear();
            ViewBag.Message = "successfully created";
            return(View());
            // return View(sECTION);
        }
Example #11
0
        private static List <TranslationEntity> GetTranslationSection(SECTION tab)
        {
            string cacheName = "Translations_" + Convert.ToString(tab) + CurrentUser.Language;
            List <TranslationEntity> item = MemoryCache.Default.Get(cacheName) as List <TranslationEntity>;

            if (item == null)
            {
                _method = " (db)";
                item    = LoadDataFromDatabase(tab);
                MemoryCache.Default.Add(cacheName, item, DateTime.Now.AddMinutes(10));
            }
            else
            {
                _method = " (cache)";
            }
            return(item);
        }
Example #12
0
        public static string GetTranslation(SECTION sectionID, int translationID)
        {
            string retVal = "";
            List <TranslationEntity> model = new List <TranslationEntity>();

            model = GetTranslationSection(sectionID);
            if (model != null)
            {
                TranslationEntity myQuery = model.Find(x => x.TranslationID.Equals(translationID));
                if (myQuery != null)
                {
                    retVal = myQuery.TranslationText;
                    if (_debug)
                    {
                        retVal = retVal + _method;
                    }
                }
            }
            return(retVal);
        }
Example #13
0
 private void homeNodeSleep_MouseDown(object sender, MouseEventArgs e)
 {
     if (core.home.nodeSleepNum > 0)
     {
         selectedCard = core.home.nodeSleepOrder[core.home.nodeSleepNum - 1];
         dragFrom = SECTION.HOMENODESLEEP;
         dragging = true;
         diffPoint = new Point(CARDSIZEX / 2, CARDSIZEY / 2);
     }
     RedrawAll();
 }
Example #14
0
 // 山札からドラッグ
 private void homeLibrary_MouseDown(object sender, MouseEventArgs e)
 {
     if (core.home.libraryNum > 0)
     {
         selectedCard = core.home.libraryOrder[core.home.libraryNum - 1];
         dragFrom = SECTION.HOMELIBRARY;
         dragging = true;
         diffPoint = new Point(CARDSIZEX / 2, CARDSIZEY / 2);
     }
     RedrawAll();
 }
Example #15
0
 // 冥界からドラッグ
 private void homeHades_MouseDown(object sender, MouseEventArgs e)
 {
     if (core.home.hadesNum > 0)
     {
         selectedCard = core.home.hadesOrder[core.home.hadesNum - 1];
         dragFrom = SECTION.HOMEHADES;
         dragging = true;
         diffPoint = new Point(CARDSIZEX / 2, CARDSIZEY / 2);
     }
     RedrawAll();
 }
Example #16
0
        //============================== マウス入出力 ==============================
        //----------ドラッグ開始----------
        // カードをドラッグ
        private void Card_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left || e.Button == MouseButtons.Right)
            {
                //----------カードクリック - カード選択----------
                selectedCard = (int)(((PictureBox)sender).Tag);
                PB[selectedCard].BringToFront();

                //----------ドラッグ開始----------
                dragFrom = core.cards[selectedCard].section;
                dragging = true;
                diffPoint = new Point(e.X, e.Y);

                RedrawAll();
            }
        }
Example #17
0
        static Stats ProcessFile(FileInfo file)
        {
            Stats stats = new Stats(file.Name);

            stats.fileCount++;
            if (IsModule(file, ".VBP"))
            {
                stats.vbpCount++;
            }
            if (IsModule(file, ".FRM.CLS.BAS.CTL"))
            {
                SECTION s = SECTION.Header;
                if (IsModule(file, ".FRM"))
                {
                    stats.frmCount++;
                }
                if (IsModule(file, ".CTL"))
                {
                    stats.ctlCount++;
                }
                if (IsModule(file, ".CLS"))
                {
                    stats.clsCount++;
                }
                if (IsModule(file, ".BAS"))
                {
                    stats.basCount++;
                }
                using (StreamReader reader = File.OpenText(file.FullName))
                {
                    string line;
                    while ((line = reader.ReadLine()) != null)
                    {
                        line = line.Trim().ToLower();
                        // look for controls in the header section
                        if (s == SECTION.Header)
                        {
                            if (IsControl(line))
                            {
                                stats.controlCount++;
                            }
                            // reached the attributes section
                            if (line.StartsWith("attribute "))
                            {
                                s = SECTION.Attribs;
                            }
                        }
                        // look for the end of the attributes section
                        if (s == SECTION.Attribs)
                        {
                            if (!line.StartsWith("attribute "))
                            {
                                s = SECTION.Code;
                            }
                        }
                        // look for everything else in the code section
                        if (s == SECTION.Code)
                        {
                            stats.lineCount++;
                            if (line.Length == 0)
                            {
                                stats.blankLineCount++;
                            }
                            else
                            {
                                stats.codeLineCount++;
                            }
                            if (IsComment(line))
                            {
                                stats.commentCount++;
                            }
                            if (IsSub(line))
                            {
                                stats.functionCount++;
                            }
                            if (IsFunction(line))
                            {
                                stats.functionCount++;
                            }
                            if (IsProperty(line))
                            {
                                stats.propertyCount++;
                            }
                        }
                    }
                    reader.Close();
                }
            }
            return(stats);
        }
Example #18
0
    void Update()
    {
        SECTION nextSection = currentDialogueSection + 1;

        if (sectionDelays.Length > (int)nextSection && Time.timeSinceLevelLoad > sectionDelays[(int)nextSection])
        {
            currentDialogueSection = nextSection;
            enterCharacter();
            if (currentDialogueSection == SECTION.I)
            {
                int score = 0;
                foreach (int attitude in attitudes)
                {
                    score += attitude;
                }
                launchConversation(DialogueLoader.getFinaleConversation(score));
            }
            else if (currentDialogueSection == SECTION.J)
            {
                CloseCurtain();
            }
            else if (currentDialogueSection == SECTION.K)
            {
                StartCoroutine(ShowThankYou());
            }
            else if (conversationSections.Length > (int)currentDialogueSection)
            {
                launchFirstValidConversation(conversationSections[(int)currentDialogueSection]);
            }
        }

        if (!isMakingChoice)
        {
            // If the player is not making a choice right now, there's no need to bother with input handling.
            return;
        }

        // only allow user to toggle options if selection has yet to be made
        if (promptBox.activeSelf)
        {
            // makes selection if user pressed enter or space
            if (Input.GetKeyDown("return") || Input.GetKeyDown("enter") || Input.GetKeyDown("space"))
            {
                promptBox.SetActive(false);
                soundFX.promptSelect.Play();
            }

            // toggles options between choice 1 and choice 2 via up and down arrow keys
            if (isUpSelected && (Input.GetKeyDown(KeyCode.DownArrow) || Input.GetKeyDown(KeyCode.S)))
            {
                isUpSelected = false;
                selectorPanel1.SetActive(false);
                selectorPanel2.SetActive(true);
            }
            else if (!isUpSelected && (Input.GetKeyDown(KeyCode.UpArrow) || Input.GetKeyDown(KeyCode.W)))
            {
                isUpSelected = true;
                selectorPanel1.SetActive(true);
                selectorPanel2.SetActive(false);
            }
        }
    }