示例#1
0
 private void Timer1_Tick(object sender, EventArgs e)
 {
     foreach (Point item in Univers.CheckAllives())
     {
         Redraw(item);
     }
 }
示例#2
0
        public void createUniver(string n, string t)
        {
            Univers un = new Univers();

            un.NameOfUniver = n;
            un.Town         = t;
            unitOfWork.Univers.Create(un);
        }
示例#3
0
        public void Delete(int id)
        {
            Univers univer = db.Univers.Find(id);

            if (univer != null)
            {
                db.Univers.Remove(univer);
            }
        }
示例#4
0
        public IActionResult GetFaculties(Int32 Id)
        {
            IEnumerable <Faculties> Faculties = fS.getAllFaculties().Where(t => t.UniversId == Id);
            Univers Uni = unvS.getAllUnivers().Where(t => t.Id == Id).First();
            string  qwe = Uni.NameOfUniver;

            ViewBag.ChoisenUniver = qwe;
            return(View("FacultyList", Faculties.ToList()));
        }
示例#5
0
        public JsonResult Post([FromBody] string NameOfUniver, [FromBody] string NameOfFaculty)
        {
            Univers choisenUniver = uS.getUniverByName(NameOfUniver);

            List <Faculties> facultiesOfUniver = new List <Faculties>(fS.getFacultiesOfUniver(choisenUniver.Id));

            Faculties choisenFaculty = facultiesOfUniver.First(c => c.NameOfFaculties == NameOfFaculty);

            return(Json(sS.getSubjectsOfFaculty(choisenFaculty.Id)));
        }
示例#6
0
 public JsonResult Get(String Univer)
 {
     if (Univer != null)
     {
         Univers q = uS.getUniverByName(Univer);
         return(Json(fS.getFacultiesOfUniver(q.Id)));
     }
     else
     {
         return(Json(fS.getAllFaculties()));
     }
 }
示例#7
0
        private void Universe_MouseClick(object sender, MouseEventArgs e)
        {
            Point inLocal = new Point(e.Location.X / Scale, e.Location.Y / Scale);

            switch (e.Button)
            {
            case MouseButtons.Left:
                Univers.SetAlliveCell(inLocal);
                break;

            case MouseButtons.Right:
                Univers.SetDeadCell(inLocal);
                break;

            default:
                break;
            }
            Redraw(inLocal);
        }
示例#8
0
        private void Form1_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.Space:
                ChangePauseState();
                break;

            case Keys.Tab:
                foreach (Point item in Univers.Clear())
                {
                    Redraw(item);
                }
                break;

            default:
                break;
            }
        }
示例#9
0
        public async Task <IActionResult> EditUniver(int id, [Bind("Id,NameOfUniver, Town")] Univers univer)
        {
            if (id != univer.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(univer);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    throw;
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(univer));
        }
示例#10
0
 public void Update(Univers univer)
 {
     db.Entry(univer).State = EntityState.Modified;
 }
示例#11
0
 public void Create(Univers univer)
 {
     db.Univers.Add(univer);
 }
示例#12
0
 public ModulAction(Univers univers)
 {
     this.univers        = univers;
     this.univers.modAct = this;
 }