Пример #1
0
        public async Task <IActionResult> Edit(int id, [Bind("DetailGroupId,Name,ProductGroupId")] DetailGroup detailGroup)
        {
            if (id != detailGroup.DetailGroupId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    await _detailGroupService.Edit(detailGroup);
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!await _detailGroupService.DetailGroupExistence(detailGroup.DetailGroupId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(detailGroup));
        }
Пример #2
0
 public ActionResult Edit([Bind(Include = "DetailGroupId,Name,ProductGroupId")] DetailGroup detailGroups)
 {
     if (ModelState.IsValid)
     {
         _detailGroupService.Edit(detailGroups);
         return(RedirectToAction("Index"));
     }
     ViewBag.PrProductGroupId = new SelectList(_productGroupService.ProductGroups(), "ProductGroupId", "GroupTitle", detailGroups.ProductGroupId);
     return(View(detailGroups));
 }
Пример #3
0
        public async Task <IActionResult> Create([Bind("DetailGroupId,Name,ProductGroupId")] DetailGroup detailGroup)
        {
            if (ModelState.IsValid)
            {
                await _detailGroupService.Add(detailGroup);

                return(RedirectToAction(nameof(Index)));
            }
            return(View(detailGroup));
        }
        public static DetailColumnCollection GetDetails(MyBusinessObject businessObj)
        {
            var columns = new DetailColumnCollection();

            var column = new DetailColumn();
            var group = new DetailGroup("Computer Information");
            group.Add("Computer Name", businessObj.ComputerName);
            group.Add("Network Name", businessObj.NetworkName);

            column.Add(group);
            columns.Add(column);

            return (columns);
        }
Пример #5
0
        // GET: Admin/AttributGrps/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DetailGroup detailGroups = _detailGroupService.GetById(id);

            if (detailGroups == null)
            {
                return(HttpNotFound());
            }
            return(PartialView(detailGroups));
        }
Пример #6
0
        // GET: Admin/DetailGroups/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DetailGroup detailGroups = _detailGroupService.GetById(id);

            if (detailGroups == null)
            {
                return(HttpNotFound());
            }
            ViewBag.PrProductGroupId = new SelectList(_productGroupService.ProductGroups(), "ProductGroupId", "GroupTitle", detailGroups.ProductGroupId);
            return(PartialView(detailGroups));
        }
Пример #7
0
        public static DetailColumnCollection GetDetails(MyBusinessObject businessObj)
        {
            var columns = new DetailColumnCollection();

            var column = new DetailColumn();
            var group  = new DetailGroup("Computer Information");

            group.Add("Computer Name", businessObj.ComputerName);
            group.Add("Network Name", businessObj.NetworkName);

            column.Add(group);
            columns.Add(column);

            return(columns);
        }
        public override DetailGroup GetDetails(ListObject computer)
        {
            // You can cast computer to the specific object and get
            // more detailed information

            if (computer != null)
            {
                DetailGroup group = new DetailGroup("Computer detailed information");
                group.Add("Computer Id:", computer.Id);

                return group;
            }
            else
            {
                return null;
            }
        }
        public override DetailGroup GetDetails(ListObject computer)
        {
            // You can cast computer to the specific object and get
            // more detailed information

            if (computer != null)
            {
                DetailGroup group = new DetailGroup("Computer detailed information");
                group.Add("Computer Id:", computer.Id);

                return(group);
            }
            else
            {
                return(null);
            }
        }
Пример #10
0
    public void GenerateDetailMeshes()
    {
        for (int i = 0; i < detailGroups.Length; i++)
        {
            DetailGroup group            = detailGroups[i];
            int         numberToGenerate = (int)(xsize * ysize * group.density);
            for (int j = 0; j < numberToGenerate; j++)
            {
                Transform randomDetail = group.prefabs[(int)Random.Range(0.0f, group.prefabs.Length)];

                float      x        = Random.Range(-xsize * xscale / 2.0f, xsize * xscale / 2.0f);
                float      z        = Random.Range(-ysize * yscale / 2.0f, ysize * yscale / 2.0f);
                float      y        = GetElevation(x, z);
                float      scale    = Random.Range(group.scaleMin, group.scaleMax);
                Quaternion rotation = Quaternion.AngleAxis(Random.Range(0.0f, 360.0f), Vector3.up);

                Transform detail = Instantiate(randomDetail, new Vector3(x, y, z), rotation) as Transform;
                detail.localScale = detail.localScale * scale;
                detail.parent     = this.transform;
            }
        }
    }
Пример #11
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DetailPageCS"/> class.
        /// </summary>
        public DetailPageCS()
        {
            // create items list
            var groupItems = new List <DetailGroup>();

            // add group 1 items data
            DetailGroup group1 = new DetailGroup {
                ShortName = "Group Index 1"
            };

            int i;

            for (i = 1; i < 10; i++)
            {
                group1.Add(new DetailPageItem {
                    Title = "[" + i + "]elm.text.Subject", Content = "Content text will be written here"
                });
            }

            // add group 2 items data
            DetailGroup group2 = new DetailGroup {
                ShortName = "Group Index 2"
            };

            for (i = 11; i < 20; i++)
            {
                group2.Add(new DetailPageItem {
                    Title = "[" + i + "]elm.text.Subject", Content = "Content text will be written here"
                });
            }

            groupItems.Add(group1);
            groupItems.Add(group2);

            // create list view
            this.listView = new ListView
            {
                // Set the list item row height
                RowHeight         = (int)(0.13 * App.screenHeight),
                HasUnevenRows     = true,
                IsGroupingEnabled = true,

                // Set the group item display name binding
                GroupDisplayBinding = new Binding("DisplayName"),

                // Set the group item short name binding
                GroupShortNameBinding = new Binding("ShortName"),

                ItemsSource = groupItems,

                ItemTemplate = new DataTemplate(() =>
                {
                    Label titleLabel = new Label
                    {
                        TextColor = Color.Black,
                        FontSize  = FONT_SIZE,
                    };

                    Label contentLabel = new Label
                    {
                        TextColor         = Color.Gray,
                        FontSize          = FONT_SIZE - 5,
                        HorizontalOptions = LayoutOptions.StartAndExpand,
                    };

                    Label countLabel = new Label
                    {
                        TextColor = Color.Gray,
                        HorizontalTextAlignment = TextAlignment.End,
                        FontSize = FONT_SIZE - 5,
                        Text     = "[7/14]",
                    };
                    titleLabel.SetBinding(Label.TextProperty, "Title");
                    contentLabel.SetBinding(Label.TextProperty, "Content");

                    var layout = new StackLayout
                    {
                        Padding     = new Thickness(20, 25),
                        Orientation = StackOrientation.Vertical,
                        Children    =
                        {
                            titleLabel,
                            new StackLayout
                            {
                                Spacing     = 30,
                                Orientation = StackOrientation.Horizontal,
                                Children    =
                                {
                                    contentLabel,
                                    countLabel
                                }
                            }
                        }
                    };
                    return(new ViewCell
                    {
                        View = layout
                    });
                }),
            };

            // The title of this page
            this.Title = "Email UI";

            // Content view of this page.
            this.Content = new StackLayout
            {
                VerticalOptions = LayoutOptions.FillAndExpand,
                Children        =
                {
                    this.listView
                }
            };
        }
Пример #12
0
 public void Edit(DetailGroup detailGroup)
 {
     _unitOfWork.DetailGroupRepository.Update(detailGroup);
     _unitOfWork.Save();
 }
Пример #13
0
 public void Delete(DetailGroup detailGroup)
 {
     _unitOfWork.DetailGroupRepository.Delete(detailGroup);
     _unitOfWork.Save();
 }
Пример #14
0
 public void Add(DetailGroup detailGroup)
 {
     _unitOfWork.DetailGroupRepository.Insert(detailGroup);
     _unitOfWork.Save();
 }