Beispiel #1
0
        public ActionResult RemoveAddress(AddressModel ObjModel, long Id)

        {
            ObjModel.Id = Id;

            if (!CommonFile.IsUserAuthenticate(this.ControllerContext.HttpContext))

            {
                return(RedirectToAction("Index", "Login"));
            }

            LoginModel MdUser = Services.GetLoginUser(this.ControllerContext.HttpContext, _JwtTokenManager);

            if (MdUser.Id != 0)

            {
                ObjModel.UserId = Convert.ToInt64(MdUser.Id);
            }

            if (ObjModel.Id != 0)

            {
                ObjModel.Operation = "delete";
            }



            var _request = JsonConvert.SerializeObject(ObjModel);

            ResponseModel ObjResponse = CommonFile.GetApiResponse(Constant.ApiSaveAddress, _request);

            //ResponseModel ObjResponse1 = JsonConvert.DeserializeObject<ResponseModel>(ObjResponse.Response);



            if (String.IsNullOrWhiteSpace(ObjResponse.Response))

            {
                @ViewBag.ResponseMessage = "Error ! Unable to Submit Address";

                return(View("AddAddress", ObjModel));
            }

            if (ObjResponse.Response.Equals("Save Address"))

            {
                //@ViewBag.ResponseMessage = "Your Current Password is Wrong";



                return(RedirectToAction("AddressesList", ObjModel));
            }

            //ViewBag.UserAddress = ListUserAddress;

            return(RedirectToAction("AddressesList", ObjModel));
        }
Beispiel #2
0
        //public List<ProductModel> GetProduct()
        //{
        //    var GetUserProductList = new List<ProductModel>();
        //    ProductModel objmodel = new ProductModel();
        //    LoginModel MdUser = Services.GetLoginUser(this.ControllerContext.HttpContext, _JwtTokenManager);
        //    if (MdUser.Id != 0)
        //        objmodel.UserId = Convert.ToInt64(MdUser.Id);
        //    var _request = JsonConvert.SerializeObject(objmodel);
        //    ResponseModel ObjResponse = CommonFile.GetApiResponse(Constant.ApiGetProduct, _request);
        //    GetUserProductList = JsonConvert.DeserializeObject<List<ProductModel>>(ObjResponse.Response);
        //    return GetUserProductList;

        //}
        public ActionResult Product()
        {
            if (!CommonFile.IsUserAuthenticate(this.ControllerContext.HttpContext))
            {
                return(RedirectToAction("Index", "Login"));
            }

            preRequistProduct(0);
            ProductModel objModel = new ProductModel();

            ViewBag.ProImagesList = "";
            return(View(objModel));
        }
        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));
        }
Beispiel #4
0
        public ActionResult AddressesList(AddressModel ObjModel)

        {
            List <AddressModel> ListUserAddress;

            ListUserAddress = GetUserAddress(null);
            bindCountryStateCity();
            if (ModelState.IsValid)
            {
                if (!CommonFile.IsUserAuthenticate(this.ControllerContext.HttpContext))
                {
                    return(RedirectToAction("Index", "Login"));
                }
                LoginModel MdUser = Services.GetLoginUser(this.ControllerContext.HttpContext, _JwtTokenManager);
                if (MdUser.Id != 0)
                {
                    ObjModel.UserId = Convert.ToInt64(MdUser.Id);
                }
                if (ObjModel.Id != 0)
                {
                    ObjModel.Operation = "update";
                }
                else
                {
                    ObjModel.Operation = "insert";
                }

                var           _request    = JsonConvert.SerializeObject(ObjModel);
                ResponseModel ObjResponse = CommonFile.GetApiResponse(Constant.ApiSaveAddress, _request);
                if (String.IsNullOrWhiteSpace(ObjResponse.Response))

                {
                    @ViewBag.ResponseMessage = "Error ! Unable to Submit Address";
                    return(View("AddAddress", ObjModel));
                }

                if (ObjResponse.Response.Equals("Save Address"))
                {
                    //@ViewBag.ResponseMessage = "Your Current Password is Wrong";
                    ViewBag.UserAddress = ListUserAddress;
                    return(RedirectToAction("AddressesList", ObjModel));
                }

                ViewBag.UserAddress = ListUserAddress;
                return(RedirectToAction("AddressesList", ObjModel));
            }
            ViewBag.UserAddress = ListUserAddress;
            return(View("AddAddress", ObjModel));
        }
Beispiel #5
0
        public ActionResult EditAddress(long Id)

        {
            bindCountryStateCity();

            if (!CommonFile.IsUserAuthenticate(this.ControllerContext.HttpContext))

            {
                return(RedirectToAction("Index", "Login"));
            }

            List <AddressModel> ListAddress = GetUserAddress(Id);

            AddressModel ObjModel = new AddressModel();

            if (ListAddress != null)

            {
                ObjModel.Id = Id;

                ObjModel.Address = ListAddress[0].Address;

                ObjModel.UserId = ListAddress[0].UserId;

                ObjModel.Name = ListAddress[0].Name;

                ObjModel.Mobile = ListAddress[0].Mobile;

                ObjModel.Pincode = ListAddress[0].Pincode;

                ObjModel.Locality = ListAddress[0].Locality;

                ObjModel.CityId = ListAddress[0].CityId;

                ObjModel.StateId = ListAddress[0].StateId;

                ObjModel.Landmark = ListAddress[0].Landmark;

                ObjModel.AlternatePhone = ListAddress[0].AlternatePhone;

                ObjModel.CityName = ListAddress[0].CityName;

                ObjModel.StateName = ListAddress[0].StateName;
            }



            return(View("AddAddress", ObjModel));
        }
Beispiel #6
0
        public JsonResult AddressesListJson(AddressModel ObjModel)

        {
            List <AddressModel> ListUserAddress;

            ListUserAddress = GetUserAddress(null);
            bindCountryStateCity();
            string Response = "";

            if (ModelState.IsValid)
            {
                if (!CommonFile.IsUserAuthenticate(this.ControllerContext.HttpContext))
                {
                    Response = "{\"Response\":\"" + "Not Authorize" + "\"}";
                }
                LoginModel MdUser = Services.GetLoginUser(this.ControllerContext.HttpContext, _JwtTokenManager);
                if (MdUser.Id != 0)
                {
                    ObjModel.UserId = Convert.ToInt64(MdUser.Id);
                }
                if (ObjModel.Id != 0)
                {
                    ObjModel.Operation = "update";
                }
                else
                {
                    ObjModel.Operation = "insert";
                }

                var           _request    = JsonConvert.SerializeObject(ObjModel);
                ResponseModel ObjResponse = CommonFile.GetApiResponse(Constant.ApiSaveAddress, _request);
                if (String.IsNullOrWhiteSpace(ObjResponse.Response))

                {
                    Response = "{\"Response\":\"" + "Error ! Unable to Submit Address" + "\"}";
                }

                if (ObjResponse.Response.Equals("Save Address"))
                {
                    Response = "{\"Response\":\"" + "Address Save" + "\"}";
                }
            }
            else
            {
                Response = "{\"Response\":\"" + "Please Fill Some Required Filed" + "\"}";
            }
            return(Json(Response));
        }
Beispiel #7
0
        public ActionResult AddressesList()

        {
            AddressModel ObjModel = new AddressModel();

            if (!CommonFile.IsUserAuthenticate(this.ControllerContext.HttpContext))

            {
                return(RedirectToAction("Index", "Login"));
            }

            List <AddressModel> ListUserAddress;

            ListUserAddress = GetUserAddress(null);

            ViewBag.UserAddress = ListUserAddress;



            return(View(ObjModel));
        }
Beispiel #8
0
        public ActionResult EditProduct(long Id)
        {
            if (!CommonFile.IsUserAuthenticate(this.ControllerContext.HttpContext))
            {
                return(RedirectToAction("Index", "Login"));
            }
            //var ProductCatList = CommonFile.GetProductCategory();
            //ViewBag.ProductCatList = new SelectList(ProductCatList, "Id", "Name");
            preRequistProduct(Id);
            List <ProductModel> Product  = GetProduct(Id);
            ProductModel        objModel = new ProductModel();

            if (Product != null && Product.Count() > 0)
            {
                objModel.Id            = Id;
                objModel.ProductName   = Product[0].ProductName;
                objModel.ProductCatId  = Product[0].ProductCatId;
                objModel.ProductImage  = Product[0].ProductImage;
                objModel.SellingPrice  = Product[0].SellingPrice;
                objModel.DiscountPrice = Product[0].DiscountPrice;
                objModel.BusinessId    = Product[0].BusinessId;
                objModel.UserId        = Product[0].UserId;
                objModel.Description   = Product[0].Description;
                objModel.ProductImages = Product[0].ProductImages;
                List <ProductImages> ListProductImages = new List <ProductImages>();
                if (!String.IsNullOrEmpty(objModel.ProductImages))
                {
                    String[] ProductImages = objModel.ProductImages.Split(',');
                    ListProductImages     = GetSelectedProductImages(ProductImages, objModel.ProductImage);
                    EditProductImageList  = ListProductImages;
                    ViewBag.ProductImages = ListProductImages;
                }
                else
                {
                    // String[] ProductImages = new String [0];
                    ViewBag.ProductImages = ListProductImages;
                }
            }
            return(View("Product", objModel));
        }
        public ActionResult PersonalProfile()
        {
            if (!CommonFile.IsUserAuthenticate(this.ControllerContext.HttpContext))
            {
                return(RedirectToAction("Index", "Login"));
            }
            ListInterest = GetAllInterest();
            var InterestCategoryList = GetInterestCategory();

            ViewBag.InterestCategoryList = new SelectList(InterestCategoryList, "Id", "Name");

            List <InterestCategoryModel> CatwiseInterest = new List <InterestCategoryModel>();

            ViewBag.CatwiseInterestList = new SelectList(CatwiseInterest, "Id", "Name");


            var listProfession = CommonFile.GetProfession();

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

            List <InterestModel> ListInterestUser = GetCateWiseInterestEdit();

            ViewBag.ListInterestUser = new SelectList(ListInterestUser, "InterestId", "InterestName");


            bindCountryStateCity();
            UserProfileModel        objModel    = new UserProfileModel();
            List <UserProfileModel> UserProfile = GetUserProfile();

            if (UserProfile == null || UserProfile.Count() == 0)
            {
                LoginModel MdUser = Services.GetLoginUser(this.ControllerContext.HttpContext, _JwtTokenManager);

                if (MdUser.Id != 0)
                {
                    objModel.FirstName = MdUser.Name;
                    objModel.UserId    = Convert.ToInt64(MdUser.Id);
                    if (!String.IsNullOrEmpty(MdUser.EmailId))
                    {
                        objModel.EmailId = MdUser.EmailId;
                    }
                    if (!String.IsNullOrWhiteSpace(MdUser.Mobile))
                    {
                        objModel.Phone = MdUser.Mobile;
                    }
                }
                objModel.DOB = DateTime.ParseExact(DateTime.Now.ToString("dd/MM/yyyy"), "dd/MM/yyyy", null);
                string[] ArrUserAddress = new string[0];
                ViewBag.UserAddress = ArrUserAddress;
            }
            else if (UserProfile != null && UserProfile.Count() > 0)
            {
                objModel.FirstName           = UserProfile[0].FirstName;
                objModel.LastName            = UserProfile[0].LastName;
                objModel.Location            = UserProfile[0].Location;
                objModel.DOB                 = UserProfile[0].DOB;
                objModel.ProfessionalCatId   = UserProfile[0].ProfessionalCatId;
                objModel.Pincode             = UserProfile[0].Pincode;
                objModel.EmailId             = UserProfile[0].EmailId;
                objModel.Description         = UserProfile[0].Description;
                objModel.Phone               = UserProfile[0].Phone;
                objModel.CountryId           = UserProfile[0].CountryId;
                objModel.Title               = UserProfile[0].Title;
                objModel.ProfessionalKeyword = UserProfile[0].ProfessionalKeyword;
                objModel.ProfileImage        = UserProfile[0].ProfileImage;
                objModel.OfficeAddress       = UserProfile[0].OfficeAddress;
                objModel.OtherAddress        = UserProfile[0].OtherAddress;
                objModel.Phone               = UserProfile[0].Phone;
                objModel.InterestCatId       = UserProfile[0].InterestCatId;
                objModel.CityId              = UserProfile[0].CityId;
                if (!string.IsNullOrWhiteSpace(UserProfile[0].StrUserInterestIds))
                {
                    int[] userInterest = Array.ConvertAll(UserProfile[0].StrUserInterestIds.Split(','), int.Parse);
                    UserProfile[0].UserInterestIds = userInterest;
                    objModel.UserInterestIds       = UserProfile[0].UserInterestIds;
                }
                else
                {
                    int[] userInterest = new int[0];
                    UserProfile[0].UserInterestIds = userInterest;
                    objModel.UserInterestIds       = UserProfile[0].UserInterestIds;
                }
                if (!string.IsNullOrWhiteSpace(UserProfile[0].StrUserAddress))
                {
                    string[] ArrUserAddress = UserProfile[0].StrUserAddress.Split('^');
                    ViewBag.UserAddress = ArrUserAddress;
                }
                else
                {
                    string[] ArrUserAddress = new string[0];
                    ViewBag.UserAddress = ArrUserAddress;
                }
            }
            else
            {
                string[] ArrUserAddress = new string[0];
                ViewBag.UserAddress = ArrUserAddress;
            }
            return(View(objModel));
        }