// GET: /SaleEnquiryProductMappingMaster/

        public ActionResult Index()
        {
            IEnumerable <SaleEnquiryLineIndexViewModel> SaleEnquiryProductMapping = _SaleEnquiryLineService.GetSaleEnquiryLineListForIndex().ToList();

            int DivisionId = (int)System.Web.HttpContext.Current.Session["DivisionId"];
            int SiteId     = (int)System.Web.HttpContext.Current.Session["SiteId"];

            if (SaleEnquiryProductMapping.FirstOrDefault() != null)
            {
                ProductBuyerSettings ProductBuyerSettings = new ProductBuyerSettingsService(_unitOfWork).GetProductBuyerSettings(DivisionId, SiteId);
                SaleEnquiryProductMapping.FirstOrDefault().ProductBuyerSettings = Mapper.Map <ProductBuyerSettings, ProductBuyerSettingsViewModel>(ProductBuyerSettings);
            }

            return(View(SaleEnquiryProductMapping));
            //return RedirectToAction("Create");
        }
        public JsonResult PendingMappingFill()
        {
            IEnumerable <SaleEnquiryLineIndexViewModel> SaleEnquiryProductMappingWithGrid = _SaleEnquiryLineService.GetSaleEnquiryLineListForIndex().ToList();

            if (SaleEnquiryProductMappingWithGrid != null)
            {
                List <SaleEnquiryLineIndexViewModel_Temp> SaleEnquiryProductMappingWithGrid_TempList = new List <SaleEnquiryLineIndexViewModel_Temp>();

                foreach (var temp in SaleEnquiryProductMappingWithGrid)
                {
                    SaleEnquiryLineIndexViewModel_Temp obj = new SaleEnquiryLineIndexViewModel_Temp();
                    obj.SaleEnquiryLineId        = temp.SaleEnquiryLineId;
                    obj.SaleEnquiryHeaderDocNo   = temp.SaleEnquiryHeaderDocNo;
                    obj.SaleEnquiryHeaderDocDate = temp.SaleEnquiryHeaderDocDate.ToString("dd/MMM/yyyy");
                    obj.SaleToBuyerId            = temp.SaleToBuyerId;
                    obj.SaleToBuyerName          = temp.SaleToBuyerName;
                    obj.BuyerSpecification       = temp.BuyerSpecification;
                    obj.BuyerSpecification1      = temp.BuyerSpecification1;
                    obj.BuyerSpecification2      = temp.BuyerSpecification2;
                    obj.BuyerSpecification3      = temp.BuyerSpecification3;

                    SaleEnquiryProductMappingWithGrid_TempList.Add(obj);
                }

                JsonResult json = Json(new { Success = true, Data = SaleEnquiryProductMappingWithGrid_TempList }, JsonRequestBehavior.AllowGet);
                json.MaxJsonLength = int.MaxValue;
                return(json);
            }
            return(Json(new { Success = true }, JsonRequestBehavior.AllowGet));
        }
Beispiel #3
0
        public JsonResult Index(int id)
        {
            var p = _SaleEnquiryLineService.GetSaleEnquiryLineListForIndex(id).ToList();

            return(Json(p, JsonRequestBehavior.AllowGet));
        }