Пример #1
0
        public JsonResult UpdateCartDetailFOrUser(int productId = 0, string TotalPrice = "")
        {
            string Mobilenumber = LoggedInUser.MobileNumber;
            double Totalsum     = 0;
            var    GetCartId    = ObjIProductService.GetCartId(Mobilenumber, productId);
            var    cartId       = GetCartId.Id;

            GetCartId.TotalPrice = TotalPrice;
            var updateCartRecordForProduct = ObjIProductService.UpdateCart(GetCartId);

            if (updateCartRecordForProduct)
            {
                var GetTotalPrice = ObjIProductService.GetCartIdbyNumber(Mobilenumber);
                foreach (var sum in GetTotalPrice)
                {
                    double Totalprice = Convert.ToDouble(sum.TotalPrice);

                    Totalsum += Totalprice;
                }

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

            return(Json(Totalsum, JsonRequestBehavior.AllowGet));
        }
Пример #2
0
        public JsonResult AddCartDetailForUser(string productId = "", int quantity = 0)
        {
            try
            {
                var getProductDetailbyId = ObjIProductService.GetProductDetail(productId);

                string mobilenumber = LoggedInUser.MobileNumber;
                if (quantity == 0)
                {
                    quantity = Convert.ToInt32(getProductDetailbyId.min_qty_to_book);
                }
                var checkCartProduct = ObjIProductService.CheckCartProduct(productId, mobilenumber);
                if (checkCartProduct)
                {
                    TempData["SameProductOncart"] = Resource.GrowOnline_Message_ProductAdded;
                    return(Json("alreadyexits", JsonRequestBehavior.AllowGet));
                }
                else
                {
                    TempData["Added"] = Resource.GrowOnline_Message_ProducAdded;
                    var addOrderDetails = ObjIProductService.AddOrderDetails(getProductDetailbyId, mobilenumber, quantity);
                    return(Json("true", JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #3
0
        public JsonResult GetProductList(int counter, string Category = "", string State = "", string Search = "", string CompanyName = "", string Sort = "", string CropName = "", int MinPrice = 0, int MaxPrice = 0)
        {
            int take = 6;
            int skip = counter;

            if (Category == "0")
            {
                Category = "N/A";
            }
            if (State == "0")
            {
                State = "N/A";
            }
            if (Search == "0")
            {
                Search = "N/A";
            }
            if (CompanyName == "0")
            {
                CompanyName = "N/A";
            }

            var list = ObjIProductService.GetAllProductList(take, skip, Category, State, Search, CompanyName, Sort, CropName, MinPrice, MaxPrice);



            var returnResult = Json(list, JsonRequestBehavior.AllowGet);

            returnResult.MaxJsonLength = int.MaxValue;
            return(returnResult);
        }
Пример #4
0
 public ActionResult GetAllCategory()
 {
     try
     {
         var getAllCategory = ObjIProductService.GetAllCategory();
         return(PartialView("~/Views/ProductMaster/GetAllCategory.cshtml", getAllCategory));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #5
0
        public ActionResult GetProductFilter(string CategoryName = "", string State = "", string search = "", string CompanyName = "")
        {
            if (CategoryName.Trim() != "N/A" || CategoryName != "")
            {
                TempData["CategoryName"] = CategoryName;
                ViewBag.SubCategory      = CategoryName;
            }
            else
            {
                TempData["CategoryName"] = null;
            }
            //for company name
            if (CompanyName.Trim() != "N/A" || CompanyName != "")
            {
                TempData["CompanyName"] = CompanyName;
            }
            else
            {
                TempData["CompanyName"] = null;
            }

            //for search
            if (search.Trim() != "N/A" || search != "")
            {
                TempData["search"] = search;
            }
            else
            {
                TempData["search"] = null;
            }

            //ViewBag.SortBy = ObjIUserService.(0, 2);

            // ViewBag.state = ObjICommonService.BindStateDropdown();

            var checkMinProductPrice = ObjIProductService.CheckMinProductPrice();
            var CheckMaxProductPrice = ObjIProductService.CheckMaxProductPrice();
            var MidPricevalue        = CheckMaxProductPrice / 2;

            ViewBag.MinPrice = checkMinProductPrice;
            ViewBag.MaxPrice = CheckMaxProductPrice;
            ViewBag.MidPrice = MidPricevalue;

            TempData["stateId"] = null;

            var list = new List <ProductMasterViewModel>();



            return(View());
        }
Пример #6
0
 private ProductMasterViewModel GetAllFilterProduct(int currentPage = 0, string CategoryName = "")
 {
     try
     {
         var getAllProducts = ObjIProductService.GetAllProduct(currentPage, CategoryName);
         return(getAllProducts);
         //return PartialView("~/Views/ProductMaster/GetAllProduct.cshtml", getAllProducts);
         //var getAllProducts = ObjIProductService.GetAllProduct(stateCode);
         //return PartialView("~/Views/ProductMaster/GetAllProduct.cshtml", getAllProducts);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #7
0
        public JsonResult GetProductDetailForCart(string ProductId = "")
        {
            try
            {
                TempData["Product"] = "ProductDetail";
                var getProductDetailbyId = ObjIProductService.GetProductDetail(ProductId);

                ProductMasterViewModel objProductMasterViewModel = new ProductMasterViewModel();


                objProductMasterViewModel.pkSkuId          = getProductDetailbyId.pkSkuId;
                objProductMasterViewModel.SkuName          = getProductDetailbyId.SkuName == null ? "N/A" : getProductDetailbyId.SkuName;
                objProductMasterViewModel.ItemCode         = getProductDetailbyId.ItemCode == null ? "N/A" : getProductDetailbyId.ItemCode;
                objProductMasterViewModel.Description      = getProductDetailbyId.Description == null ? "N /A" : getProductDetailbyId.Description;
                objProductMasterViewModel.Price            = getProductDetailbyId.Price == null ? "N/A" : getProductDetailbyId.Price;
                objProductMasterViewModel.CurrentQuantity  = getProductDetailbyId.CurrentQuantity == null ? "N/A" : getProductDetailbyId.CurrentQuantity;
                objProductMasterViewModel.multipleOf       = getProductDetailbyId.multipleOf == "" ? "10" : getProductDetailbyId.multipleOf;
                objProductMasterViewModel.SkuCreatedDate   = getProductDetailbyId.SkuCreatedDate;
                objProductMasterViewModel.GSTPercent       = getProductDetailbyId.GSTPercent == null ? "N/A" : getProductDetailbyId.GSTPercent;
                objProductMasterViewModel.imageUrl         = getProductDetailbyId.imageUrl == null ? "~/upload/no-image.jpg" : getProductDetailbyId.imageUrl;
                objProductMasterViewModel.min_qty_to_book  = getProductDetailbyId.min_qty_to_book == null ? "N/A" : getProductDetailbyId.min_qty_to_book;
                objProductMasterViewModel.max_qty_to_book  = getProductDetailbyId.max_qty_to_book == null ? "N/A" : getProductDetailbyId.max_qty_to_book;
                objProductMasterViewModel.Prd_company_name = getProductDetailbyId.Prd_company_name == null ? "N/A" : getProductDetailbyId.Prd_company_name;
                objProductMasterViewModel.Allow_SAP_Order  = getProductDetailbyId.Allow_SAP_Order;
                objProductMasterViewModel.prd_State        = getProductDetailbyId.prd_State == null ? "N/A" : getProductDetailbyId.prd_State;
                objProductMasterViewModel.Status           = getProductDetailbyId.Status == null ? "N/A" : getProductDetailbyId.Status;
                objProductMasterViewModel.packingSize      = getProductDetailbyId.packingSize == null ? "N/A" : getProductDetailbyId.packingSize;
                objProductMasterViewModel.crp_priority     = getProductDetailbyId.crp_priority;
                //  objProductMasterViewModel.crp_catagory = getProductDetailbyId.crp_type;
                objProductMasterViewModel.ProductPriority = getProductDetailbyId.ProductPriority.ToString();
                objProductMasterViewModel.crp_catagory    = getProductDetailbyId.crp_catagory == null ? "N/A" : getProductDetailbyId.crp_catagory;
                objProductMasterViewModel.crp_type        = getProductDetailbyId.crp_type == null ? "N/A" : getProductDetailbyId.crp_type;
                objProductMasterViewModel.TC   = getProductDetailbyId.TC == null ? "N/A" : getProductDetailbyId.TC;
                objProductMasterViewModel.crop = getProductDetailbyId.crop == null ? "N/A" : getProductDetailbyId.crop;


                TempData["ReturnAction"] = "product";

                return(Json(objProductMasterViewModel, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #8
0
        public JsonResult GetSubCategoryProductList(int counter, string Category = "", string State = "", string Search = "", string Sort = "")
        {
            int take = 8;
            int skip = counter;

            if (Category == "0")
            {
                Category = "N/A";
            }
            if (State == "0")
            {
                State = "N/A";
            }
            if (Search == "0")
            {
                Search = "N/A";
            }


            var list = ObjIProductService.GetSubCategoryProductList(take, skip, Category, State, Search, Sort);


            var checkMinProductPrice = ObjIProductService.CheckMinProductPrice();
            var CheckMaxProductPrice = ObjIProductService.CheckMaxProductPrice();
            var MidPricevalue        = CheckMaxProductPrice / 2;

            ViewBag.MinPrice = checkMinProductPrice;
            ViewBag.MaxPrice = CheckMaxProductPrice;
            ViewBag.MidPrice = MidPricevalue;

            TempData["stateId"] = null;

            //var list = new List<ProductMasterViewModel>();

            var returnResult = Json(list, JsonRequestBehavior.AllowGet);

            returnResult.MaxJsonLength = int.MaxValue;
            return(returnResult);
        }
Пример #9
0
        public ActionResult GetProductsbyCategory(string CategoryName = "", string CompanyName = "", string ProductName = "", string stateName = "")
        {
            var getAllProducts = ObjIProductService.GetProductsbyCategory(CategoryName, CompanyName, ProductName, stateName);

            return(View(getAllProducts));
        }