Пример #1
0
        public void CreateDimss(BoxCulvertSection bs)
        {
            var p1 = Shopdrawing.Core.Utilities.PointsHelper.Offset(bs.BasePoint.Coordinates, 0, bs.H / 2);
            var p2 = Shopdrawing.Core.Utilities.PointsHelper.Offset(p1, bs.B, 0);

            d1 = new LinearDimension(Drawing, p1, p2, p1);
            //Dims.Add(dim);
            d1.Dimpost  = "B=";
            d1.Dimscale = this.DimScale;
            this.Children.Add(d1);
            this.Dependencies.Add(d1);
            d1.OnAddingToCanvas(Drawing.Canvas);
            d1.UpdateVisual();
            Dims.Add(d1);
        }
Пример #2
0
        public BalustradeQuoteModel(BalustradeModel model, Balustrade balustrade, int p = 0, User user = null) :
            this()
        {
            TypeId  = balustrade.BalustradeSystem.ID;
            ColorId = balustrade.Color.ID;
            GlassId = balustrade.GlassSystem.ID;
            foreach (var section in model.Sections)
            {
                Dims.Add(new BalustradeQuoteDimension(section));
            }

            for (var i = 0; i < balustrade.RawBalustradeSections.Count; i++)
            {
                Dims[i].Length = (int)balustrade.RawBalustradeSections[i].Length;
                //Dims[i].Depth = (int)balustrade.RawBalustradeSections[i].Depth;
            }

            P = p;
            if (p == 1)
            {
                Price = balustrade.SellingPrice ?? 0D;
            }
            else if (p == 2)
            {
                VATEnabled = true;
                Price      = (balustrade.SellingPrice ?? 0D) * (1D + ((user?.DefaultCompany?.VatPercent ?? 0D) / 100D));
            }

            ModelId     = model.ID;
            ModelImage  = model.Image;
            ModelUrl    = model.Url;
            Title       = TemplateService.GetText(model.Title, balustrade);
            Keywords    = TemplateService.GetText(model.Keywords, balustrade);
            Description = TemplateService.GetText(model.Description, balustrade);
            H1          = TemplateService.GetText(model.H1, balustrade);
            Body        = TemplateService.GetText(model.Body, balustrade);
            List <string> imageExist = new List <string>();

            for (int counter = 0; counter < 100; counter++)
            {
                string Imgsrc;

                Imgsrc  = string.Empty;
                Imgsrc  = "/images/balustrades/thumb/b";
                Imgsrc += TypeId + "/";
                Imgsrc += ModelImage + "/";
                if (counter == 0)
                {
                    Imgsrc += ColorId + ".jpg";
                }
                else
                {
                    Imgsrc += ColorId + "_" + counter + ".jpg";
                }
                if (System.IO.File.Exists(HttpContext.Current.Server.MapPath(Imgsrc)))
                {
                    imageExist.Add(Imgsrc);
                }
            }
            thumbnailimages = imageExist;
        }