public async Task <IActionResult> Edit(int id, [Bind("Id,Cypher,NameRus,NameKaz,NameEng,AcademicDepartmentId")] BDirection bDirection)
        {
            if (id != bDirection.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(bDirection);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!BDirectionExists(bDirection.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AcademicDepartmentId"] = new SelectList(_context.AcademicDepartment, "Id", "Id", bDirection.AcademicDepartmentId);
            return(View(bDirection));
        }
        public async Task <IActionResult> Create([Bind("Id,Cypher,NameRus,NameKaz,NameEng,AcademicDepartmentId")] BDirection bDirection)
        {
            if (ModelState.IsValid)
            {
                _context.Add(bDirection);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AcademicDepartmentId"] = new SelectList(_context.AcademicDepartment, "Id", "Id", bDirection.AcademicDepartmentId);
            return(View(bDirection));
        }
    // Update is called once per frame
    void Update()
    {
        if (oldPosition != transform.position)
        {
            if (Moveable)
            {
                //transform.position = new Vector3(transform.position.x, GenTrack.Copy.GetTensorHeight(transform.position), transform.position.z);

                GenTrack.CPChanged(ElementsIndex, CpRole, transform.position, 0f, 0f, 0f);

                oldPosition = transform.position;

                B1Next.ParentPosChanged();
                B2Prev.ParentPosChanged();
                BDirection.ParentPosChanged();
            }
            else
            {
                transform.position = oldPosition;
            }
        }
    }