public ActionResult dsNhap2(string ReceiptIsuueGuid, string SizeGuid, int?Number, string SizeAdd) { shGoodReceiptIsuueDetailService _goodDetail = new shGoodReceiptIsuueDetailService(); List <shGoodReceiptIsuueDetail> dsNhap = new List <shGoodReceiptIsuueDetail>(); shSizeService _size = new shSizeService(); shSetSize size = new shSetSize(); if (!string.IsNullOrEmpty(SizeAdd) || !string.IsNullOrWhiteSpace(SizeAdd)) { string[] dsSizeAdd = SizeAdd.Split(';'); foreach (var childSize in dsSizeAdd) { string[] obj = childSize.Split('$'); if (obj != null) { size = _size.FindByKey(obj[0]); if (size != null) { dsNhap.Add(new shGoodReceiptIsuueDetail { ReceiptIsuueDetailGuid = obj[2], ReceiptIsuueGuid = ReceiptIsuueGuid, ProductGuid = size.ProductGuid, SectionGuid = size.SectionGuid, SizeGuid = size.SizeGuid, Number = TypeHelper.ToInt32(obj[1]), }); } } } } if (!string.IsNullOrEmpty(SizeGuid) || !string.IsNullOrWhiteSpace(SizeGuid)) { size = _size.FindByKey(SizeGuid); dsNhap.Add(new shGoodReceiptIsuueDetail { // ReceiptIsuueDetailGuid = GuidUnique.getInstance().GenerateUnique(), ReceiptIsuueGuid = ReceiptIsuueGuid, ProductGuid = size.ProductGuid, SectionGuid = size.SectionGuid, SizeGuid = size.SizeGuid, Number = Number, }); SizeAdd += SizeGuid + "$" + Number + "$" + "" + ";"; } ViewBag.ReceiptIsuueGuid = ReceiptIsuueGuid; ViewBag.dsNhap = dsNhap; ViewBag.SizeAdd = SizeAdd; return(PartialView("dsNhap", dsNhap)); }
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)); }
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)); }
public static MvcHtmlString SizeName(this HtmlHelper helper, string SizeGuid) { shSizeService _size = new shSizeService(); shSetSize size = _size.FindByKey(SizeGuid); if (size == null) { size = new shSetSize(); } return(new MvcHtmlString(size.SizeName)); }
public static MvcHtmlString SectionName_SizeName(this HtmlHelper helper, string SectionGuid, string SizeGuid) { string html = string.Empty; shSectionService _section = new shSectionService(); shProductSet section = _section.FindByKey(SectionGuid); if (section != null) { html += section.SectionName; } shSizeService _size = new shSizeService(); shSetSize size = _size.FindByKey(SizeGuid); if (size != null) { html += " " + size.SizeName + " " + size.Stuff; } return(new MvcHtmlString(html)); }
public static MvcHtmlString IconUpdate_Delete(this HtmlHelper helper, string SizeGuid) { shSizeService _size = new shSizeService(); shSetSize size = _size.FindByKey(SizeGuid); if (size == null) { size = new shSetSize(); } string icon = "<a href='javascript:void(0)' onclick=Edit('" + SizeGuid + "','" + size.SectionGuid + "')>" + "<span class='fa fa-pencil-square-o' aria-hidden='true' style='transform: scale(1.3, 1.3);' title='Sửa'></span>" + "</a>"; icon += " "; icon += "<a href='javascript:void(0)' onclick=Delete('" + SizeGuid + "','" + size.SectionGuid + "')>" + "<span class='fa fa-trash' aria-hidden='true' style='transform: scale(1.3, 1.3);' title='Xóa'></span> " + "</a>"; return(new MvcHtmlString(icon)); }
public ActionResult CheckOrderProcessing(string OrderGuid, int?OrderStatus, string Description) { shOrderService _order = new shOrderService(); shOrder order = _order.FindByKey(OrderGuid); string message = "OK"; shOrderDetailService _orderdetail = new shOrderDetailService(); IEnumerable <shOrderDetail> ds = _orderdetail.DanhSachOrderDetailBy(order.OrderGuid, order.MemberGuid, null); bool check = false; shSizeService _size = new shSizeService(); shSetSize size = new shSetSize(); foreach (var item in ds) { size = _size.FindByKey(item.SizeGuid); if (item.Number > size.Inventory) { check = true; } } if (check) { message = "Số lượng hàng tồn trong kho không đủ. Xin vui lòng thao tác lại"; } if (Request.IsAjaxRequest()) { return(Json(message, JsonRequestBehavior.AllowGet)); } return(RedirectToAction("Index")); }