public ActionResult _ProducLeft() { string chuoi = ""; var list = (from p in db.v_Product_DescTotalNumber select p).Take(30).ToList(); for (int i = 0; i < list.Count; i++) { chuoi += "<li><p><a href=\"/thong-tin/" + list[i].Tag + "\" title=\"" + list[i].Name + "\">" + list[i].Name + "</a></p><a href=\"/thong-tin/" + list[i].Tag + "\" title=\"" + list[i].Name + "\"><img src=\"" + list[i].Image + "\" alt=\"" + list[i].Name + "\"/></a><p>Giá bán: " + StringClass.Format_Price(list[i].PricePromotion.ToString()) + "đ</p></li>"; } ViewBag.View = chuoi; list.Clear(); list = null; return(PartialView()); }
public ActionResult Detail(string tag) { string chuoi = ""; string chuoilink = ""; string image = ""; string imagethumb = ""; string Cart = ""; int category = 0; int proId = 0; string baohanh = ""; string noibat = ""; string chitiet = ""; string thanhtoan = ""; string canhbao = ""; string khuyenmai = ""; string fb = ""; var pro = (from p in data.Products where p.Tag == tag select p).ToList(); if (pro.Count > 0) { proId = pro[0].Id; data.sp_Product_Update(proId, pro[0].Name, pro[0].Tag, pro[0].Image, pro[0].Description, pro[0].Weight, pro[0].ChatLieu, pro[0].Status, pro[0].Detail, pro[0].SpTon, pro[0].Count, (pro[0].View + 1), pro[0].Like, pro[0].IdCategory, pro[0].Date, pro[0].Index, pro[0].Priority, pro[0].Keyword, pro[0].Title, pro[0].Content, pro[0].Ord, pro[0].Active, pro[0].PriceRetail, pro[0].PricePromotion, pro[0].Num, pro[0].Noibat, pro[0].Baohanh, pro[0].Giamgia); data.SaveChanges(); category = pro[0].IdCategory; var cate = (from p in data.GroupProducts where p.Id == category select p).ToList(); if (cate.Count > 0) { chuoilink = "<li class='Last'><a href='/danh-muc/" + cate[0].Tag + "'>" + cate[0].Name + "</a></li>"; } cate.Clear(); cate = null; ViewBag.link = chuoilink; int g = 0; if (pro[0].Num != null) { g = int.Parse(pro[0].Num.ToString()); } chuoi += "<input type=\"hidden\" id=\"item_id\" value=\"" + pro[0].Id + "\">"; imagethumb += "<li class='active' rel='1'><img src=\"" + pro[0].Image + "\" alt=\"" + pro[0].Name + "\" title=\"Click to enlarge\" /></li>"; //if (g == 0) //{ image += "<a href=\"" + pro[0].Image + "\" class=\"highslide\" rel=\"position: 'inside' , showTitle: false\" id=\"zoom1\" style=\"position: relative; display: block;\" onclick=\"return hs.expand(this)\"><img src=\"" + pro[0].Image + "\" alt=\"" + pro[0].Name + "\" /></a>"; //} //else //{ // image += "<a href=\"" + pro[0].Image + "\" class=\"highslide\" rel=\"position: 'inside' , showTitle: false\" id=\"zoom1\" style=\"position: relative; display: block;\" onclick=\"return hs.expand(this)\"><img src=\"" + pro[0].Image + "\" alt=\"" + pro[0].Name + "\" /></a>"; //} chuoi += "<input type=\"hidden\" id=\"item_id\" value=\"" + pro[0].Id + "\" />"; chuoi += "<p id=\"titPro\">" + pro[0].Name + "</p>"; chuoi += "<p>Mã SP: <span class=\"value\">" + pro[0].Code + "</span></p>"; chuoi += "<div class=\"divInfo\">"; if (g > 0) { //chuoi += "<p><span class=\"txtw80\">Tình trạng:</span><span class=\"stock\">Còn hàng</span></p>"; if ((pro[0].PricePromotion / pro[0].PriceRetail) * 100 < 100) { chuoi += "<p><span id=\"valBanle-cu\">Giá cũ: " + StringClass.Format_Price(pro[0].PriceRetail.ToString()) + "đ</span></p>"; chuoi += "<p>Giá bán: <span id=\"valBanle\"> " + StringClass.Format_Price(pro[0].PricePromotion.ToString()) + "đ</span></p>"; } else { chuoi += "<p>Giá: <span id=\"valBanle\"> " + StringClass.Format_Price(pro[0].PricePromotion.ToString()) + "đ</span></p>"; } } else { //chuoi += "<p><span class=\"txtw80\">Tình trạng:</span><span class=\"nostock\">Hết hàng</span></p>"; chuoi += "<p>Giá bán: <span id=\"valBanle\">" + StringClass.Format_Price(pro[0].PricePromotion.ToString()) + "đ</span></p>"; } //chuoi += "<span class=\"lblProduct\"> </span>"; chuoi += "</div>"; int pid = pro[0].Id; var proimages = (from im in data.ProImages where im.IdPro == pid select im).ToList(); int k = 2; for (int j = 0; j < proimages.Count; j++) { if (proimages.Count > 1) { imagethumb += "<li class='active' rel='" + (k + j) + "'><img src=\"" + proimages[j].Image + "\" alt=\"" + pro[0].Name + "\" /></li>"; } image += "<a href=\"" + proimages[j].Image + "\" class=\"highslide\" onclick=\"return hs.expand(this)\"><img src=\"" + proimages[j].Image + "\" alt=\"" + pro[0].Name + "\" /></a>"; } if (g > 0) { Cart += "<p id=\"Cart\"><a id=\"btnAddCart\" href=\"javascript:;\" class=\"btnBuyNow add-to-cart\" title=\"Thêm sản phẩm này vào giỏ hàng\"><span id=\"txt\"></span></a><a id=\"btnAddCart\" title=\"Mua ngay\" href=\"javascript:;\" class=\"btnAddCart\" rel=\"/Home/checkout\"><span id=\"txt1\">Mua ngay</span></a></p>"; } else { Cart += "<p id=\"Cart\"><a id=\"btnAddCart\" href=\"javascript:;\" class=\"btnBuyNow Disabled\" title=\"Thêm sản phẩm này vào giỏ hàng\"><span id=\"txt\"></span></a><a id=\"btnAddCart\" title=\"Mua ngay\" href=\"javascript:;\" class=\"btnAddCart Disabled\" rel=\"/Home/checkout\"><span id=\"txt1\">Mua ngay</span></a></p>"; } chitiet = pro[0].Content; noibat = pro[0].Noibat; int idcate = pro[0].IdCategory; var bh = data.GroupProducts.Find(idcate); baohanh = bh.BaoHanh; // bao hanh #region [Title, Keyword, Deskription] string t = pro[0].Title; string tt = pro[0].Description; string ttt = pro[0].Keyword; if (pro[0].Title != null && pro[0].Title.Length > 0) { ViewBag.tit = pro[0].Title; } else { ViewBag.tit = pro[0].Name; } if (pro[0].Description != null && pro[0].Description.Length > 0) { ViewBag.des = pro[0].Description; } else { ViewBag.des = pro[0].Name; } if (pro[0].Keyword != null && pro[0].Keyword.Length > 0) { ViewBag.key = pro[0].Keyword; } else { ViewBag.key = pro[0].Name; } #endregion ViewBag.cart = Cart; proimages.Clear(); proimages = null; fb += "<div class=\"fb-like\" style=\"margin-top: 15px; padding-bottom: 3px\" data-href=\"" + Request.Url.ToString() + "\" data-send=\"true\" data-max-width=\"950\" data-show-faces=\"true\"></div>"; fb += "<div class=\"fb-comments\" style=\"margin-top: 15px\" data-href=\"" + Request.Url.ToString() + "\" data-max-width=\"950\" data-num-posts=\"5\"></div>"; #region [Sản phẩm cùng loại] string chuoicungloai = ""; var list = (from p in data.Products where p.Active == true && p.IdCategory == category && p.Tag != tag orderby p.Ord ascending select p).Take(21).ToList(); for (int i = 0; i < list.Count; i++) { //if (i % 3 != 0) //{ // chuoicungloai += "<li class=\"other\">"; //} //else //{ // chuoicungloai += "<li class=\"right\">"; //} //chuoicungloai += "<div class=\"imagespro\"><a href=\"/thong-tin/" + list[i].Tag + "\" title=\"" + list[i].Name + "\"><img src=\"" + list[i].Image + "\" alt=\"" + list[i].Name + "\" title=\"" + list[i].Name + "\"/></a></div>"; // chuoicungloai += "<div>"; // if (list[i].Code != null && list[i].Code != "") // { // chuoicungloai += "<p class=\"gia_cu\">" + list[i].Code + " đ</p>"; // } // else // { // chuoicungloai += "<p class=\"gia_cu\">No size</p>"; // } // if (list[i].PricePromotion == 0) // { // chuoicungloai += "<p class=\"gia_sp\">Giá: Vui lòng liên hệ</p>"; // } // else // { // chuoicungloai += "<p class=\"gia_sp\">Giá: " + os.os.Format_Price(list[i].PricePromotion.ToString()) + " đ</p>"; // } // chuoicungloai += "</div>"; // chuoicungloai += "<p class=\"sp_code\"><a href=\"/thong-tin/" + list[i].Tag + "\">" + list[i].Name + "</a></p>"; //chuoicungloai += "</li>"; if (i % 3 != 0) { chuoicungloai += "<li class=\"other\">"; chuoicungloai += "<div class=\"imagespro\"><a href=\"/thong-tin/" + list[i].Tag + "\" title=\"" + list[i].Name + "\"><img src=\"" + list[i].Image + "\" alt=\"" + list[i].Name + "\" title=\"" + list[i].Name + "\"/></a></div>"; if ((list[i].PricePromotion / list[i].PriceRetail) * 100 < 100) { chuoicungloai += "<div>"; if (list[i].Code != null && list[i].Code != "") { chuoicungloai += "<p class=\"sp_code\">Mã SP: " + list[i].Code + "</p>"; } else { chuoicungloai += "<p class=\"sp_code\">No size</p>"; } if (list[i].PricePromotion == 0) { chuoicungloai += "<p class=\"gia_sp\">Giá: Vui lòng liên hệ</p>"; } else { chuoicungloai += "<p class=\"gia_cu\">Giá cũ: " + os.os.Format_Price(list[i].PriceRetail.ToString()) + "đ</p>"; chuoicungloai += "<p class=\"gia_sp\">Giá bán: " + os.os.Format_Price(list[i].PricePromotion.ToString()) + "đ</p>"; } chuoicungloai += "</div>"; chuoicungloai += "<p class=\"sp_name\"><a href=\"/thong-tin/" + list[i].Tag + "\"> " + list[i].Name + "</a></p>"; chuoicungloai += "<div class=\"giamgia\">"; chuoicungloai += "<span class=\"discount-label\">Giảm</span>"; chuoicungloai += "<span class=\"discount-value\">" + onsoft.Models.StringClass.Round(double.Parse((100 - (list[i].PricePromotion / list[i].PriceRetail) * 100).ToString()), 2) + "%</span>"; chuoicungloai += "</div>"; } else { chuoicungloai += "<div>"; if (list[i].Code != null && list[i].Code != "") { chuoicungloai += "<p class=\"sp_code\">Mã SP: " + list[i].Code + "</p>"; } else { chuoicungloai += "<p class=\"sp_code\">No size</p>"; } if (list[i].PricePromotion == 0) { chuoicungloai += "<p class=\"gia_sp\">Giá: Vui lòng liên hệ</p>"; } else { chuoicungloai += "<p class=\"gia_sp\">Giá bán: " + os.os.Format_Price(list[i].PricePromotion.ToString()) + "đ</p>"; } chuoicungloai += "</div>"; chuoicungloai += "<p class=\"sp_name\"><a href=\"/thong-tin/" + list[i].Tag + "\">" + list[i].Name + "</a></p>"; } chuoicungloai += "</li>"; } else { chuoicungloai += "<li class=\"right\">"; chuoicungloai += "<div class=\"imagespro\"><a href=\"/thong-tin/" + list[i].Tag + "\" title=\"list[i].Name\"><img src=\"" + list[i].Image + "\" alt=\"" + list[i].Name + "\" title=\"" + list[i].Name + "\"/></a></div>"; chuoicungloai += "<div>"; if (list[i].Code != null && list[i].Code != "") { chuoicungloai += "<p class=\"sp_code\">Mã SP: " + list[i].Code + "</p>"; } else { chuoicungloai += "<p class=\"sp_code\">No size</p>"; } if (list[i].PricePromotion == 0) { chuoicungloai += "<p class=\"gia_sp\">Giá: Vui lòng liên hệ</p>"; } else { chuoicungloai += "<p class=\"gia_sp\">Giá bán: " + os.os.Format_Price(list[i].PricePromotion.ToString()) + "đ</p>"; } chuoicungloai += "</div>"; chuoicungloai += "<p class=\"sp_name\"><a href=\"/thong-tin/" + list[i].Tag + "\">" + list[i].Name + "</a></p>"; chuoicungloai += "</li>"; } } ViewBag.cungloai = chuoicungloai; list.Clear(); list = null; #endregion #region [Sản phẩm nhiều người mua] string chuoinhieu = ""; var listnn = (from p in data.v_Product_DescTotalNumber select p).Take(20).ToList(); for (int e = 0; e < listnn.Count; e++) { chuoinhieu += "<li>"; chuoinhieu += "<a href=\"/dong-ho/" + listnn[e].Tag + "\"><img src=\"" + listnn[e].Image + "\" /></a>"; chuoinhieu += "<a href=\"/dong-ho/" + listnn[e].Tag + "\">" + listnn[e].Name + "</a>"; if ((listnn[e].PricePromotion / listnn[e].PriceRetail) * 100 < 100) { chuoinhieu += "<p><span>" + os.os.Format_Price(listnn[e].PriceRetail.ToString()) + "đ</span></p>"; chuoinhieu += "<p>" + os.os.Format_Price(listnn[e].PricePromotion.ToString()) + "đ</p>"; } else { chuoinhieu += "<p>" + os.os.Format_Price(listnn[e].PricePromotion.ToString()) + "đ</p>"; } chuoinhieu += "</li>"; } ViewBag.nhieu = chuoinhieu; listnn.Clear(); listnn = null; #endregion } ViewBag.images = image; ViewBag.imagethumb = imagethumb; ViewBag.pro = chuoi; pro.Clear(); pro = null; #region [Hiển thị thông tin các Tab] var listconf = data.Configs.ToList(); if (listconf.Count > 0) { thanhtoan = listconf[0].Thanhtoan; canhbao = listconf[0].Canhbao; khuyenmai = listconf[0].Helpsize; } listconf.Clear(); listconf = null; string chuoitab_head = ""; string chuoitab_content = ""; if (chitiet != null && chitiet != "") { chuoitab_head += "<li><a href=\"#tabs-1\">Thông tin sản phẩm</a></li>"; chuoitab_content += "<div id=\"tabs-1\"><p>" + chitiet + " " + canhbao + "</p></div>"; } if (noibat != null && noibat != "") { chuoitab_head += "<li><a href=\"#tabs-2\">Ưu điểm nổi bật</a></li>"; chuoitab_content += "<div id=\"tabs-2\"><p>" + noibat + "</p></div>"; } if (baohanh != null && baohanh != "") { chuoitab_head += "<li><a href=\"#tabs-3\">Thông tin bảo hành</a></li>"; chuoitab_content += "<div id=\"tabs-3\"><p>" + baohanh + "</p></div>"; } if (thanhtoan != null && thanhtoan != "") { chuoitab_head += "<li><a href=\"#tabs-4\">Phương thức thanh toán</a></li>"; chuoitab_content += "<div id=\"tabs-4\"><p>" + thanhtoan + "</p></div>"; } //if (canhbao != null && canhbao != "") //{ // chuoitab_head += "<li><a href=\"#tabs-5\">Cảnh báo</a></li>"; // chuoitab_content += "<div id=\"tabs-5\"><p>" + canhbao + "</p></div>"; //} if (khuyenmai != null && khuyenmai != "") { chuoitab_head += "<li><a href=\"#tabs-6\">Khuyến mại</a></li>"; chuoitab_content += "<div id=\"tabs-6\"><p>" + khuyenmai + "</p></div>"; } chuoitab_head += "<li><a href=\"#tabs-7\">Bình luận đánh giá</a></li>"; chuoitab_content += "<div id=\"tabs-7\"><p>" + fb + "</p></div>"; ViewBag.tabhead = chuoitab_head; ViewBag.tabcontent = chuoitab_content; #endregion #region [Hỗ trợ trực tuyến] string chuoisp = ""; string chuoi_tel = ""; string chuoi_hotline = ""; string chuoi_mobile = ""; var listsp = data.Supports.ToList(); if (listsp.Count > 0) { for (int i = 0; i < listsp.Count; i++) { if (listsp[i].Type == 0) { chuoisp += "<p><a href=\"ymsgr:sendim?" + listsp[i].Nick + "\" title=\"" + listsp[i].Name + "\"><img alt=\"" + listsp[i].Name + "\" src=\"http://opi.yahoo.com/online?u=" + listsp[i].Nick + "&m=g&t=1\" border=\"0\" align=\"middle\"></a></p>"; } else if (listsp[i].Type == 1) { chuoisp += "<p><a href=\"skype:" + listsp[i].Nick + "?chat\"><img src=\"HTTP://MYSTATUS.SKYPE.COM/smallclassic/" + listsp[i].Nick + "\" title=\"" + listsp[i].Name + "\"></a></p>"; } else if (listsp[i].Type == 2) { chuoi_hotline += "<p><a href=\"#\" class=\"hl\" title=\"" + listsp[i].Name + "\"></a><span>HOTLINE: " + listsp[i].Tel + "</span></p>"; } else if (listsp[i].Type == 3) { chuoi_tel += "<p><a href=\"#\" class=\"cel\" title=\"" + listsp[i].Name + "\"></a>" + listsp[i].Tel + "</p>"; } else if (listsp[i].Type == 4) { chuoi_mobile += "<p><a href=\"#\" class=\"mob\" title=\"" + listsp[i].Name + "\"></a>" + listsp[i].Tel + "</p>"; } } chuoisp = chuoisp + chuoi_tel + chuoi_mobile + chuoi_hotline; } ViewBag.support = chuoisp; #endregion //#region[view drop Colors] //var procolor = data.ProColors.Where(n => n.IdPro == proId).ToList(); //List<DropDownList> listcolor = new List<DropDownList>(); //listcolor.Add(new DropDownList { value = "0", text = "Như ảnh" }); //if (procolor.Count > 0) //{ // List<DropDownList> listcolor1 = new List<DropDownList>(); // for (int k = 0; k < procolor.Count; k++) // { // int clId=procolor[k].IdColor; // var color = data.Colors.Where(n => n.Id == clId).ToList(); // for (int i = 0; i < color.Count; i++) // { // string sid=color[i].Id.ToString(); // string sname=color[i].Name.ToString(); // listcolor1.Add(new DropDownList { value = "" + sid + "", text = "" + sname + "" }); // //ViewBag.color = new SelectList(color, "Id", "Name"); // } // } // ViewBag.color = new SelectList(listcolor1, "value", "text"); //} //else //{ // ViewBag.color = new SelectList(listcolor, "value", "text"); //} //#endregion //#region[view drop Sizes] //var prosize = data.ProSizes.Where(n => n.IdPro == proId).ToList(); //List<DropDownList> listsize = new List<DropDownList>(); //listsize.Add(new DropDownList { value = "0", text = "Freesize" }); //if (prosize.Count > 0) //{ // List<DropDownList> listsize1 = new List<DropDownList>(); // for (int s = 0; s < prosize.Count; s++) // { // int szId = prosize[s].IdSize; // var size = data.Sizes.Where(n => n.Id == szId).ToList(); // for (int i = 0; i < size.Count; i++) // { // string sid = size[i].Id.ToString(); // string sname = size[i].Name.ToString(); // listsize1.Add(new DropDownList { value = "" + sid + "", text = "" + sname + "" }); // //ViewBag.sizes = new SelectList(size, "Id", "Name"); // } // } // ViewBag.size = new SelectList(listsize1, "value", "text"); //} //else //{ // ViewBag.size = new SelectList(listsize, "value", "text"); //} //#endregion return(View()); }
public ActionResult OrderIndexot(int?page, string SoDH) { int imPage = 0; var all = db.Ords.OrderByDescending(o => o.Id).ToList(); ViewBag.Bill = db.v_OrderDetail_Product.OrderByDescending(o => o.Id).ToList(); int pageSize = 25; int pageNumber = (page ?? 1); if (Request.HttpMethod == "GET") { if (Session["SoDH"] != null) { SoDH = Session["SoDH"].ToString(); Session["SoDH"] = null; } } else { page = 1; } if (!String.IsNullOrEmpty(SoDH)) { int oId = Int32.Parse(SoDH); all = all.Where(p => p.Id == oId || p.Tel == oId.ToString() || p.Name == oId.ToString()).OrderByDescending(p => p.Id).ToList(); } // begin [get last page] if (page != null) { ViewBag.mPage = (int)page; imPage = (int)page; } else { ViewBag.mPage = 1; imPage = 1; } ViewBag.PageSize = pageSize; // Thiết lập phân trang PagedListRenderOptions pro = new PagedListRenderOptions(); pro.DisplayLinkToFirstPage = PagedListDisplayMode.Always; pro.DisplayLinkToLastPage = PagedListDisplayMode.Always; pro.DisplayLinkToPreviousPage = PagedListDisplayMode.Always; pro.DisplayLinkToNextPage = PagedListDisplayMode.Always; pro.DisplayLinkToIndividualPages = true; pro.DisplayPageCountAndCurrentLocation = false; pro.MaximumPageNumbersToDisplay = 5; pro.DisplayEllipsesWhenNotShowingAllPageNumbers = true; pro.EllipsesFormat = "…"; pro.LinkToFirstPageFormat = "Trang đầu"; pro.LinkToPreviousPageFormat = "«"; pro.LinkToIndividualPageFormat = "{0}"; pro.LinkToNextPageFormat = "»"; pro.LinkToLastPageFormat = "Trang cuối"; pro.PageCountAndCurrentLocationFormat = "Page {0} of {1}."; pro.ItemSliceAndTotalFormat = "Showing items {0} through {1} of {2}."; pro.FunctionToDisplayEachPageNumber = null; pro.ClassToApplyToFirstListItemInPager = null; pro.ClassToApplyToLastListItemInPager = null; pro.ContainerDivClasses = new[] { "pagination-container" }; pro.UlElementClasses = new[] { "pagination" }; pro.LiElementClasses = Enumerable.Empty <string>(); string Chuoi = ""; for (int i = 0; i < all.Count; i++) { Chuoi += "<table class=\"table table-striped table-bordered dataTable table-hover\" cellspacing=\"0\" style=\"border-collapse: collapse;\">"; Chuoi += "<tr>"; Chuoi += "<th scope=\"col\" class=\"CheckBoxsmall\" style=\"width: 10px; vertical-align: middle; padding: 1px 10px; background-color: #22c0cb;\">"; Chuoi += "<input name=\"mPage\" id=\"mPage\" value=\"" + imPage.ToString() + "\" hidden=\"hidden\" />"; Chuoi += "<input name=\"PageSize\" id=\"PageSize\" value=\"" + pageSize.ToString() + "\" hidden=\"hidden\" />"; //Chuoi+="@Html.CheckBox(\"chk\" "+ all[i].Id.ToString() +", new { id = \"chkSelect\", onclick = \"Javascript:chkSelect_OnClick(this,0)\", @class = \"chk\" })"; Chuoi += "<input type=\"checkbox\" Name=\"chk" + all[i].Id.ToString() + "\" id = \"chkSelect\" onclick = \"Javascript:chkSelect_OnClick(this,0)\" class =\"chk\" />"; Chuoi += "</th>"; Chuoi += "<th scope=\"col\" id=\"name\" style=\"width: 250px; vertical-align: middle; padding: 1px 10px; background-color: #22c0cb; color: #fff\">Số đơn hàng: " + all[i].Id.ToString() + "</th>"; Chuoi += "<th scope=\"col\" id=\"date\" style=\"width: 150px; vertical-align: middle; padding: 1px 10px; background-color: #22c0cb; color: #fff\">Ngày đặt hàng: " + all[i].SDate.Value.ToShortDateString() + "</th>"; Chuoi += "<th scope=\"col\" id=\"date\" style=\"width: 200px; vertical-align: middle; padding: 1px 10px; background-color: #22c0cb; color: #fff\">Họ tên: " + all[i].Customer.Name + "</th>"; Chuoi += "<th scope=\"col\" id=\"date\" style=\"width: 200px; vertical-align: middle; padding: 1px 10px; background-color: #22c0cb; color: #fff\">Điện thoại: " + all[i].Customer.Tel + "</th>"; Chuoi += "<th scope=\"col\" id=\"status\" style=\"width: 200px; vertical-align: middle; padding: 1px 10px; background-color: #22c0cb; color: #fff;\">Tình trạng: "; Chuoi += "<label id=\"" + all[i].Id.ToString() + "\" style=\"display:inline; font-weight:bold;\">" + StringClass.ShowStateBill(all[i].Status.ToString()) + "</label>"; Chuoi += "</th>"; Chuoi += "<th scope=\"col\" class=\"number\" style=\"text-align: center; vertical-align: middle; padding: 1px 10px; background-color: #22c0cb;\">"; Chuoi += "<a style=\"width:50px; float:left;color:#fff\" href=\"../../Order/OrderEdit?id=" + all[i].Id.ToString() + "\" class=\"action-link-button\" title=\"Chi tiết hóa đơn\"><i class=\"icon-info-sign\"></i></a>"; Chuoi += "<a style=\"width:10px; float:left; color:#fff\" href=\"OrderDelete?id=" + all[i].Id.ToString() + "&page=" + imPage.ToString() + "&pagesize=" + pageSize.ToString() + "\" class=\"yesno action-link-button\" title=\"Bạn chắc chắn muốn xóa hóa đơn này ?\"><i class=\"icon-trash\"></i></a>"; Chuoi += "</th>"; Chuoi += "</tr>"; Chuoi += "</table>"; Chuoi += "<!--Chi tiết hóa đơn-->"; int oID = all[i].Id; var bill = (from b in db.v_OrderDetail_Product where b.IdOr == oID select b).ToList(); //Chuoi+="float? totalPrice = (from o in Model where (o.Id == Model[i].Id) select o).Single().Amount;"; Chuoi += "<table class=\"table table-striped table-bordered dataTable table-hover\" cellspacing=\"0\" id=\"cph_Main_ctl00_ctl00_grvProducts\" style=\"border-collapse: collapse;\">"; Chuoi += "<tr>"; Chuoi += "<th scope=\"col\" style=\"width: 60px; text-align: center;\">Ảnh SP</th>"; Chuoi += "<th scope=\"col\" style=\"width: 170px;\">Tên Sản phẩm</th>"; Chuoi += "<th scope=\"col\" style=\"width: 60px;\">Số lượng</th>"; Chuoi += "<th scope=\"col\" style=\"width: 90px;\">Giá bán(vnđ)</th>"; Chuoi += "<th scope=\"col\" style=\"width: 90px;\">Thành tiền(vnđ)</th>"; //Chuoi+="<th scope=\"col\" style=\"width: 330px;\">Tiền vận chuyển(vnđ)</th>"; Chuoi += "<th scope=\"col\" style=\"width: 120px; text-align: center;\" rowspan=\"500\">Tổng tiền(vnđ)"; //Chuoi+="<p style=\"color: red\">"+ os.os.Format_Price(all[i].Amount.ToString()) +" VNĐ</p>Nhập mã bưu điện<br />"; //Chuoi += "<input type=\"text\" Name=\"Ord" + all[i].Id.ToString() + "\" value = \"\" id=\"PostCode" + all[i].Id.ToString() + "\" class =\"PostCode\" style=\"width:120px;\"/>"; Chuoi += "</th>"; Chuoi += "<th scope=\"col\" style=\"width: 120px; text-align: center;\" rowspan=\"500\">"; if (all[i].Status == "1") { Chuoi += "<label id=\"Nhantien\" class=\"btn Nhantien\" data-id=\"" + all[i].Id + "\"><i class=\"icon-save\"></i> Đã nhận tiền</label>"; } else if (all[i].Status == "2") { Chuoi += "<label id=\"Guihang\" class=\"btn Guihang\" data-id=\"" + all[i].Id + "\"><i class=\"icon-save\"></i> Đã gửi hàng</label>"; } else if (all[i].Status == "3") { Chuoi += "<label>Đơn hàng đã gửi</label>"; } else { Chuoi += "<label>Đơn hàng bị hủy</label>"; } Chuoi += "</th>"; Chuoi += " </tr>"; for (int j = 0; j < bill.Count; j++) { Chuoi += "<tr style=\"background-color: #fff\">"; Chuoi += "<td class=\"text-center\" style=\"vertical-align: middle; padding: 2px 0px;\">"; Chuoi += "<img width=\"60px\" src=\"" + bill[j].Image + "\" alt=\"\"/></td>"; Chuoi += "<td style=\"vertical-align: middle;\">" + bill[j].Name + ""; //Chuoi += "<p style=\"color: #22c0cb; text-align: left; padding: 0; margin: 0\"> - Màu: " + bill[j].CName + " <br /> - Size: " + bill[j].SName + ""; Chuoi += "</p>"; Chuoi += "</td>"; Chuoi += "<td class=\"text\" style=\"vertical-align: middle; text-align: center\">" + bill[j].Name + "</td>"; Chuoi += "<td class=\"text\" style=\"vertical-align: middle; text-align: center\">" + StringClass.Format_Price(bill[j].Price.ToString()) + "</td>"; Chuoi += "<td class=\"text\" style=\"vertical-align: middle; text-align: center\">" + StringClass.Format_Price(bill[j].Total.ToString()) + "</td>"; //Chuoi += " <td class=\"text\" style=\"vertical-align: middle;\">- Tiền VC: <span style=\"color: red\">" + StringClass.Format_Price(all[i].PriceVC.ToString()) + "<br />"; //Chuoi += "- Cộng thêm 20% cước VC ngoại thành, nông thôn nếu có:<span style=\"color: red\">" + StringClass.Format_Price(all[i].PriceNT.ToString()) + "</span><br />"; // if (all[i].TypePay == "1") // { // Chuoi+="<label style=\"font-weight: bold\">- Hình thức VC: Chuyển phát nhanh</label>"; // } // else if (all[i].TypePay == "2") // { // Chuoi+="<label style=\"font-weight: bold\">- Hình thức VC: Chuyển phát bình thường</label>"; // } // else if (all[i].TypePay == "3") // { // Chuoi+=" <label style=\"font-weight: bold\">- Hình thức VC: Chuyển bằng ô tô</label>"; // } //Chuoi+="</td>"; Chuoi += "</tr>"; } Chuoi += "</table>"; Chuoi += "<div id=\"mnbtomad\">"; Chuoi += "<div class=\"head\">Thông tin nhận hàng:</div>"; if (all[i].Name != null && all[i].Name != "") { string NameProvince = ""; string times = ""; int tinhid = int.Parse(all[i].ProviceId.ToString()); var provi = db.Provinces.Where(m => m.Id == tinhid).FirstOrDefault(); if (provi != null) { NameProvince = provi.Name; if (all[i].TypePay == "1") { times = provi.Time; } else if (all[i].TypePay == "2") { times = provi.Time1; } else { times = provi.Time2; } } Chuoi += "<div class=\"item\" style=\"margin-left: 135px;\">Họ tên: <span>" + all[i].Name + "</span></div>"; Chuoi += "<div class=\"item\">Điện thoại: <span>" + all[i].Tel + "</span></div>"; //if (all[i].TypePay == "1") //{ // Chuoi += "<div class=\"item400\">Gửi hàng bằng:<span> Chuyển phát nhanh - </span><b>" + times + "</b></div>"; //} //else if (all[i].TypePay == "2") //{ // Chuoi += "<div class=\"item400\">Gửi hàng bằng:<span> Chuyển phát thường - </span><b>" + times + "</b></div>"; //} //else //{ // Chuoi += "<div class=\"item400\">Gửi hàng bằng:<span> Ô tô - </span><b>" + times + "</b></div>"; //} Chuoi += "<div class=\"item500\">Địa chỉ: <span>" + all[i].Address + " - " + NameProvince + "</span></div>"; } else { string times = ""; string NameProvince = ""; int tinhid = int.Parse(all[i].Customer.Provice.ToString()); var provi = db.Provinces.Where(m => m.Id == tinhid).FirstOrDefault(); if (provi != null) { NameProvince = provi.Name; if (all[i].TypePay == "1") { times = provi.Time; } else if (all[i].TypePay == "2") { times = provi.Time1; } else { times = provi.Time2; } } Chuoi += "<div class=\"item\" style=\"margin-left: 135px;\">Họ tên: <span>" + all[i].Customer.Name + "</span></div>"; Chuoi += "<div class=\"item\">Điện thoại: <span>" + all[i].Customer.Tel + "</span></div>"; //if (all[i].TypePay == "1") //{ // Chuoi += "<div class=\"item400\">Gửi hàng bằng:<span> Chuyển phát nhanh - </span><b>" + times + "</b></div>"; //} //else if (all[i].TypePay == "2") //{ // Chuoi += "<div class=\"item400\">Gửi hàng bằng:<span> Chuyển phát thường - </span><b>" + times + "</b></div>"; //} //else //{ // Chuoi += "<div class=\"item400\">Gửi hàng bằng:<span> Ô tô - </span><b>" + times + "</b></div>"; //} Chuoi += "<div class=\"item500\">Địa chỉ: <span>" + all[i].Customer.Address + " - " + NameProvince + "</span></div>"; } Chuoi += "</div>"; Chuoi += "</div>"; } ViewBag.or = Chuoi; ViewBag.Pro = pro; return(View(all.ToPagedList(pageNumber, pageSize))); }