public ActionResult AddSection(SectionIndex form)
        {
            var section = new Bolumler()
            {
                BolumAd = form.Bolumad,
                BolumID = form.Bolumid
            };

            Database.Session.Save(section);
            Database.Session.Flush();
            return(RedirectToAction("Index", "Section"));
        }
Example #2
0
        public static PanelSectionViewModel CreateCenterPanelSection(Point3D center, double xSectionSize, double ySectionSize, int i, int j)
        {
            PanelSectionViewModel section = null;
            var idx = new SectionIndex();

            idx.SetIndex(i, j);

            if (_sectionsDictionary.TryGetValue(idx, out PanelSectionViewModel vm))
            {
                vm.SizeX  = xSectionSize;
                vm.SizeY  = ySectionSize;
                vm.SizeZ  = SizeZ;
                vm.Center = center;

                vm.Reset();
                section = vm;
            }
            else
            {
                section = new PanelSectionViewModel()
                {
                    XSectionIndex = i,
                    YSectionIndex = j,
                    Position      = PanelSectionPosition.Center,
                    NumCells      = NumCells,
                    SizeX         = xSectionSize,
                    SizeY         = ySectionSize,
                    SizeZ         = SizeZ,
                    Center        = center,
                    Visible       = true
                };

                section.Initialize();
                _sectionsDictionary.Add(idx, section);
            }

            return(section);
        }
Example #3
0
 public bool Equals(SectionIndex s) => index == s.index;