Ejemplo n.º 1
0
        public ActionResult EditMyBusiness(long Id)
        {
            var listProfession = CommonFile.GetProfession();

            ViewBag.ProfessionList = new SelectList(listProfession, "Id", "Name");
            bindCountryStateCity();



            List <BusinessModel> EditBusinessList = GetBusiness(Id);
            BusinessModel        objModel         = new BusinessModel();

            if (EditBusinessList != null && EditBusinessList.Count() > 0)
            {
                objModel.Id                  = Id;
                objModel.BusinessName        = EditBusinessList[0].BusinessName;
                objModel.BusinessLogo        = EditBusinessList[0].BusinessLogo;
                objModel.Location            = EditBusinessList[0].Location;
                objModel.ProfessionalCatId   = EditBusinessList[0].ProfessionalCatId;
                objModel.ProfessionalKeyword = EditBusinessList[0].ProfessionalKeyword;
                objModel.CityId              = EditBusinessList[0].CityId;
                objModel.PinCode             = EditBusinessList[0].PinCode;
                objModel.UserId              = EditBusinessList[0].UserId;
                objModel.Email               = EditBusinessList[0].Email;
                objModel.Description         = EditBusinessList[0].Description;
                objModel.CountryId           = EditBusinessList[0].CountryId;
                objModel.Phone               = EditBusinessList[0].Phone;
                objModel.Website             = EditBusinessList[0].Website;
                // objModel.StateId = EditBusinessList[0].StateId;
            }
            return(View("MyBusiness", objModel));
        }
Ejemplo n.º 2
0
        public ActionResult MyOrders(SaleOrderModel objmodel)
        {
            LoginModel MdUser = Services.GetLoginWebUser(this.ControllerContext.HttpContext, _JwtTokenManager);
            if (MdUser.Id != 0)
            {
                objmodel.UserId = Convert.ToInt64(MdUser.Id);
            }
            else
            {
                //return JavaScript("window.alert('Please Log-In');");
                return RedirectToAction("Index", "WebLogin");
            }
            var _request = JsonConvert.SerializeObject(objmodel);
            ResponseModel ObjResponse = CommonFile.GetApiResponse(Constant.ApiGetOrders, _request);
            var Orders = JsonConvert.DeserializeObject<List<SaleOrderModel>>(ObjResponse.Response);

            foreach (var orders in Orders)
            {
                TimeSpan time = new TimeSpan(12, 30, 00);
                DateTime date = orders.OrderDate.Add(time);

                var b = date.ToString("dd-MM-yyyy hh:mm tt");

                orders.OrderDatestring = b;


            }
            ViewBag.MyOrders = Orders;
            return View(objmodel);
        }
Ejemplo n.º 3
0
        public string SaveWishlist(AddToCartModel objmodel)
        {

            var _request = JsonConvert.SerializeObject(objmodel);
            ResponseModel ObjResponse = CommonFile.GetApiResponse(Constant.ApiSaveWishlist, _request);

            return ObjResponse.Response;
        }
Ejemplo n.º 4
0
        public ActionResult SaveProduct(FormCollection frmColl, ProductModel ObjProductModel, string radioBtn, string radioBtnEdit)
        {
            LoginModel MdUser = Services.GetLoginUser(this.ControllerContext.HttpContext, _JwtTokenManager);

            // objModel.XmlData = xmlNode;
            //var YourRadioButton1 = Request.Form["SetDefaultImage1"];
            // String Imag= Request.Form["img[]"].ToString();


            if (ModelState.IsValid)
            {
                HttpPostedFileBase FileUpload = Request.Files["FileUploadImage"];
                string             ServerPath = Server.MapPath("~/DocImg/");
                String             FileName   = CommonFile.SaveImage(FileUpload, ServerPath);

                ObjProductModel.ProductImage    = FileName;
                ObjProductModel.XmlProductImage = GetProductImageXml(MdUser.Id, radioBtn, radioBtnEdit);

                if (MdUser.Id != 0)
                {
                    ObjProductModel.UserId = Convert.ToInt64(MdUser.Id);
                }

                if (ObjProductModel.Id == 0)
                {
                    ObjProductModel.Operation = "insert";
                }
                else if (ObjProductModel.Id != 0)
                {
                    ObjProductModel.Operation = "Update";
                }

                var           _request    = JsonConvert.SerializeObject(ObjProductModel);
                ResponseModel ObjResponse = CommonFile.GetApiResponse(Constant.ApiSaveProduct, _request);
                if (String.IsNullOrWhiteSpace(ObjResponse.Response))
                {
                    return(View("Product", ObjProductModel));
                }
                return(RedirectToAction("ProductList", "Products"));
            }
            else
            {
                List <ProductImages> ListProductImages = new List <ProductImages>();
                if (ObjProductModel.Id != 0)
                {
                    ViewBag.ProductImages = EditProductImageList;
                }
                else
                {
                    ViewBag.ProImagesList = "";
                }
                preRequistProduct(ObjProductModel.Id);
            }
            return(View("Product", ObjProductModel));
        }
Ejemplo n.º 5
0
 public PartialViewResult LazyLoaderProducts(string pageindex)
 {
     long? id = Convert.ToInt64(CommonFile.Decode(pageindex));
     int PageIndex = (int)id;
     string SearchCookieValue = Services.GetCookie(this.HttpContext, "SearchBarCookie").Value;
     dynamic _data = SearchCookieValue;
     var json = JsonConvert.DeserializeObject<Dictionary<string, object>>(_data);
     string SearchBarText = json["SearchBarText"].ToString();
     ViewBag.LazyLoaderProducts = ListAllProduct.Where(x => x.ProductName.ToUpper().Contains(SearchBarText.ToUpper())).ToList().Skip(Constant.NumberOfProducts * PageIndex).Take(Constant.NumberOfProducts);
     ViewBag.PageIndex = PageIndex + 1;
     return PartialView("~/Views/Shared/LazyLoaderProducts.cshtml");
 }
Ejemplo n.º 6
0
        public List<ProductModel> GetProduct(long Id)
        {
            var GetProduct = new List<ProductModel>();
            ProductModel objProduct = new ProductModel();
            objProduct.Id = Id;
            LoginModel MdUser = Services.GetLoginUser(this.ControllerContext.HttpContext, _JwtTokenManager);
            var _request = JsonConvert.SerializeObject(objProduct);
            ResponseModel ObjResponse = CommonFile.GetApiResponse(Constant.ApiGetProductDetail, _request);
            GetProduct = JsonConvert.DeserializeObject<List<ProductModel>>(ObjResponse.Response);
            return GetProduct;

        }
Ejemplo n.º 7
0
        private void bindCountryStateCity()
        {
            var CountryList = CommonFile.GetCountry();

            ViewBag.CountryList = new SelectList(CountryList, "Id", "Name");
            var StateList = CommonFile.GetState();

            ViewBag.StateList = new SelectList(StateList, "Id", "Name");
            var CityList = CommonFile.GetCity();

            ViewBag.CityList = new SelectList(CityList, "Id", "Name");
        }
Ejemplo n.º 8
0
        public PartialViewResult WebSiteSidebar()
        {
            ProductModel objModel       = new ProductModel();
            var          ProductCatList = CommonFile.GetProductCategory(null);

            ViewBag.ProductCatList = ProductCatList;
            List <AddToCartModel> ListAddToCart = Services.GetMyCart(this.ControllerContext.HttpContext, _JwtTokenManager);

            ViewBag.AddToCart      = ListAddToCart;
            objModel.CartItemCount = ListAddToCart.Count();
            ViewBag.TotalAmount    = GetTotalAmount(ListAddToCart);
            return(PartialView("~/Views/Shared/_WebSiteSidebar.cshtml", objModel));
        }
Ejemplo n.º 9
0
        public ActionResult MyBusiness()
        {
            if (!CommonFile.IsUserAuthenticate(this.ControllerContext.HttpContext))
            {
                return(RedirectToAction("Index", "Login"));
            }
            var listProfession = CommonFile.GetProfession();

            ViewBag.ProfessionList = new SelectList(listProfession, "Id", "Name");
            bindCountryStateCity();
            BusinessModel objModel = new BusinessModel();

            return(View(objModel));
        }