Example #1
0
        public PartialViewResult EditSize(string SizeGuid, string SectionGuid, string ProductGuid)
        {
            shSizeService _size = new shSizeService();
            shSetSize     size  = _size.FindByKey(SizeGuid);

            if (size == null)
            {
                size = new shSetSize();
            }

            shSectionService           _section  = new shSectionService();
            IEnumerable <shProductSet> dsSection = _section.DanhSachSection_TheoProductGuid(ProductGuid);

            ViewBag.SectionGuid = new SelectList(dsSection, "SectionGuid", "SectionName", SectionGuid);

            IEnumerable <shSetSize> dsSize = _size.DanhSachSize_BySectionGuid(null, ProductGuid, null)
                                             .Where(x => string.IsNullOrWhiteSpace(x.ParentId) ||
                                                    string.IsNullOrEmpty(x.ParentId));

            foreach (var item in dsSize)
            {
                item.SizeName = _section.SectionName(item.SectionGuid) + " - " + item.SizeName;
            }
            ViewBag.Parent = new SelectList(dsSize, "SizeGuid", "SizeName", size.ParentId);
            //size.PriceCurrent = Format.SubStringDotInDecimal(size.PriceCurrent.Value);

            return(PartialView("EditSize", size));
        }
Example #2
0
        public static MvcHtmlString ChatLieu_KichThuoc(this HtmlHelper helper, string SizeGuid, string SizeName, string Stuff, string ParentId, string SectionGuid)
        {
            string html = string.Empty;

            if (!string.IsNullOrWhiteSpace(SizeName))
            {
                html += SizeName;
            }

            if (!string.IsNullOrWhiteSpace(Stuff))
            {
                html += " - " + Stuff;
            }
            string title = string.Empty;
            string style = string.Empty;

            if (!string.IsNullOrWhiteSpace(ParentId))
            {
                shSectionService _section = new shSectionService();
                shSizeService    _size    = new shSizeService();
                shSetSize        size     = _size.FindByKey(ParentId);
                if (size != null)
                {
                    title = "Thuộc bộ sản phẩm: " + _section.SectionName(SectionGuid) + " [" + size.SizeName + "]";
                }
            }
            else
            {
                style = "font-weight:bold; cursor: pointer";
            }
            string span = "<span title='" + title + "' style='" + style + "' class='parent-size'>" + html + "</span>";

            return(new MvcHtmlString(span));
        }
Example #3
0
        public static string NoiDungDonHang(shOrder order, List <CartItem> cart)
        {
            shSectionService _section = new shSectionService();
            shSizeService    _size    = new shSizeService();
            string           noidung  = string.Empty;

            noidung += "<p content-attach> <i>Thông tin người nhận hàng: " + "</i> ";
            noidung += order.FullName;
            if (string.IsNullOrWhiteSpace(order.Phone))
            {
                noidung += " / " + order.Phone;
            }
            if (string.IsNullOrWhiteSpace(order.Email))
            {
                noidung += " / " + order.Email;
            }
            if (string.IsNullOrWhiteSpace(order.Address))
            {
                noidung += " / " + order.Address;
            }
            noidung += " </p>";

            noidung += "<p content-attach><i>Giá trị đơn hàng: " + Format.FormatDecimalToString(order.Total.GetValueOrDefault(0)) + "</i></p>";
            noidung += "<p content-attach><i>Phí ship: " + Format.FormatDecimalToString(order.FeeShip.GetValueOrDefault(0)) + "</i></p>";
            noidung += "<p content-attach><i>Ngày đặt: " + order.NgayDat.GetValueOrDefault(DateTime.Now).ToString("dd/MM/yyyy") + "</i></p>";

            noidung += "<p content-attach><i>Thông tin đơn hàng: ";

            foreach (var item in cart)
            {
                noidung += "<p>" + item.Product.ProductName;
                noidung += _section.SectionName(item.SectionGuid);
                noidung += _size.SizeName(item.SizeGuid) + "</p>";
            }

            noidung += "</i></p>";

            return(noidung);
        }