Exemple #1
0
        public ApiResponse <bool> AddToWishList(int productId, CurrencyTypeName CurrencyName)
        {
            var deviceNo = GetDeviceNo();
            var isSave   = _productServices.AddToWishList(productId, CurrencyName, deviceNo);

            return(ApiUtility.ApiSuccess <bool>(isSave, isSave ? "Wishlist item added successfully" : "Failed!!!"));
        }
Exemple #2
0
        public ApiResponse <bool> LogOff()
        {
            var deviceNo = GetDeviceNo();
            var isLogOff = _customerServices.CustomerLogOff(deviceNo);

            return(ApiUtility.ApiSuccess <bool>(isLogOff, isLogOff ? "Logoff successfully" : "Failed !!!"));
        }
Exemple #3
0
        public ApiResponse <List <ProductSummaryModel> > GetFeaturedProducts(CurrencyTypeName currencyName)
        {
            var deviceNo = GetDeviceNo();
            var products = _productServices.GetFeaturedProducts(currencyName, deviceNo);

            return(ApiUtility.ApiSuccess <List <ProductSummaryModel> >(products, "Featured products listing successfully"));
        }
Exemple #4
0
        public ApiResponse <ProductDetailsSummaryModel> GetAllProducts(SearchProductModel search)
        {
            var deviceNo = GetDeviceNo();
            var products = _productServices.GetAllProducts(search, deviceNo);

            return(ApiUtility.ApiSuccess <ProductDetailsSummaryModel>(products, "Search products using filter successfully"));
        }
Exemple #5
0
        public ApiResponse <CartItemSummary> ShowCartItems(string couponCode = "")
        {
            var deviceNo = GetDeviceNo();
            var items    = _productServices.ShowCartItems(deviceNo);

            return(ApiUtility.ApiSuccess <CartItemSummary>(items, "Item(s) found"));
        }
Exemple #6
0
        public ApiResponse <bool> DeleteAddress(int id)
        {
            var deviceNo = GetDeviceNo();
            var isDelete = _customerServices.DeleteAddress(deviceNo, id);

            return(ApiUtility.ApiSuccess <bool>(isDelete, isDelete == true ? "Address deleted successfully" : "Failed !!!"));
        }
Exemple #7
0
        public ApiResponse <List <WishListItem> > ShowWishListItems()
        {
            var deviceNo = GetDeviceNo();
            var items    = _productServices.ShowWishListItems(deviceNo);

            return(ApiUtility.ApiSuccess <List <WishListItem> >(items, "Wishlist item(s) found."));
        }
Exemple #8
0
        public ApiResponse <bool> DeleteWishItem(int productId)
        {
            var deviceNo = GetDeviceNo();
            var isDelete = _productServices.RemoveFromWishList(productId, deviceNo);

            return(ApiUtility.ApiSuccess <bool>(isDelete, isDelete ? "Wishlist item deleted successfully" : "Failed!!!"));
        }
Exemple #9
0
        public ApiResponse <dynamic> LogIn(LogInModel logInModel)
        {
            var deviceNo        = GetDeviceNo();
            var customerSummary = new CustomerSummary();
            var isLogin         = _customerServices.CustomerLogIn(deviceNo.Trim(), logInModel.Password.Trim(), logInModel.Email.Trim());

            customerSummary = _customerServices.GetCustomerSummaryByEmail(logInModel.Email.Trim());
            return(ApiUtility.ApiSuccess <dynamic>(new { IsLogin = isLogin, CustomerSummary = customerSummary }, isLogin ? "Loging successfully" : "Failed !!! Incorrect Email or Password"));
        }
Exemple #10
0
        public ApiResponse <bool> AddToCart(int productId, CurrencyTypeName CurrencyName)
        {
            var deviceNo = GetDeviceNo();
            var isSave   = _productServices.AddToCart(productId, CurrencyName, deviceNo);

            if (isSave == true)
            {
                return(ApiUtility.ApiSuccess <bool>(isSave, "Item added to cart"));
            }
            return(ApiUtility.ApiSuccess <bool>(isSave, "Failed !!!"));
        }
Exemple #11
0
        public ApiResponse <CartItemSummary> DeleteCartItem(int productId, string cuponCode = "")
        {
            var deviceNo = GetDeviceNo();
            var isDelete = _productServices.RemoveFromCart(productId, deviceNo, cuponCode);

            if (isDelete.Item1 == true)
            {
                return(ApiUtility.ApiSuccess <CartItemSummary>(isDelete.Item2, "Item deleted successfully from cart"));
            }
            return(ApiUtility.ApiSuccess <CartItemSummary>(isDelete.Item2, "Failed !!!"));
        }
 public ApiResponse <bool> DeleteContact(int id)
 {
     try
     {
         var data = _contact.DeleteContact(id);
         return(ApiUtility.ApiSuccess <bool>(data));
     }
     catch (Exception ex)
     {
         return(ApiUtility.ApiError <bool>(ex));
     }
 }
 public ApiResponse <bool> EditContact(Contact contact)
 {
     try
     {
         var data = _contact.EditContact(contact);
         return(ApiUtility.ApiSuccess <bool>(data));
     }
     catch (Exception ex)
     {
         return(ApiUtility.ApiError <bool>(ex));
     }
 }
 public ApiResponse <List <Contact> > GetContacts(bool?status = null)
 {
     try
     {
         var data = _contact.GetContactes(status);
         return(ApiUtility.ApiSuccess <List <Contact> >(data));
     }
     catch (Exception ex)
     {
         return(ApiUtility.ApiError <List <Contact> >(ex));
     }
 }
 public ApiResponse <Contact> GetContactById(int id)
 {
     try
     {
         var data = _contact.GetContactById(id);
         return(ApiUtility.ApiSuccess <Contact>(data));
     }
     catch (Exception ex)
     {
         return(ApiUtility.ApiError <Contact>(ex));
     }
 }
Exemple #16
0
        public ApiResponse <dynamic> CheckCustomer(string email)
        {
            var customerSummary = _customerServices.GetCustomerSummaryByEmail(email.Trim());

            if (customerSummary != null)
            {
                return(ApiUtility.ApiSuccess <dynamic>(new { VerifiedCustomerFound = customerSummary.IsVerifiedCustomer, IsNewCustomer = false }, "This email already present for an existing customer"));
            }
            else
            {
                return(ApiUtility.ApiSuccess <dynamic>(new { VerifiedCustomerFound = false, IsNewCustomer = true }, "Not found any existing customer"));
            }
        }
Exemple #17
0
        public ApiResponse <bool> SendOtp(OtpBodyModel otpBodyModel)
        {
            var summary = _customerServices.GetCustomerSummaryByEmail(otpBodyModel.Email);
            var isSend  = _otpServicescs.SendOTP(new OtpDetailsModel
            {
                Email           = otpBodyModel.Email,
                Prupose         = otpBodyModel.IsForRegisterUser == true ? "Register" : otpBodyModel.IsForResetPassword == true ? "Reset" : "Default",
                CustomerName    = summary.CustomerName,
                RefCustomerGuid = summary.CustomerId
            });

            return(ApiUtility.ApiSuccess <bool>(isSend, isSend ? "OTP send successfully" : "Failed !!!"));
        }
Exemple #18
0
        public ApiResponse <bool> UserRegistration(CustomerBasicDetails customerBasicDetails)
        {
            var customerSummary = _customerServices.GetCustomerSummaryByEmail(customerBasicDetails.Email);

            if (customerSummary == null)
            {
                bool isAdded = _customerServices.AddCustomer(customerBasicDetails);
                return(ApiUtility.ApiSuccess <bool>(isAdded, isAdded ? "New customer added successfully" : "Failed !!!"));
            }
            else
            {
                return(ApiUtility.ApiSuccess <bool>(false, "Email already found"));
            }
        }
Exemple #19
0
        public ApiResponse <List <CustomerAddressDetails> > ShowAddresses()
        {
            var deviceNo = GetDeviceNo();
            var listData = _customerServices.GetAddresses(deviceNo);

            if (listData != null && listData.Count > 0)
            {
                return(ApiUtility.ApiSuccess <List <CustomerAddressDetails> >(listData, "all addresses get successfully"));
            }
            else
            {
                return(ApiUtility.ApiSuccess <List <CustomerAddressDetails> >(null, "Failed !!!"));
            }
        }
Exemple #20
0
        public ApiResponse <bool> SaveAddress(CustomerBillingAddress customerBillingAddress)
        {
            var deviceNo = GetDeviceNo();
            var isSaved  = _customerServices.SaveBillingAddress(customerBillingAddress, deviceNo);

            if (isSaved)
            {
                return(ApiUtility.ApiSuccess <bool>(isSaved, "New address added successfully"));
            }
            else
            {
                return(ApiUtility.ApiSuccess <bool>(false, "Failed !!!"));
            }
        }
Exemple #21
0
        public ApiResponse <bool> ChangePassword(CustomerChangePassword customerChangePassword)
        {
            var isSaved = false;

            if (customerChangePassword.IsForgetPassword == false)
            {
                var deviceNo = GetDeviceNo();
                isSaved = _customerServices.ChangeCustomerPassword(deviceNo, customerChangePassword.NewPassword, "");
            }
            else
            {
                isSaved = _customerServices.ChangeCustomerPassword("", customerChangePassword.NewPassword, customerChangePassword.Email);
            }
            return(ApiUtility.ApiSuccess <bool>(isSaved, isSaved ? "Password saved successfully" : "Failed !!!"));
        }
Exemple #22
0
 public ApiResponse <bool> CheckConnection()
 {
     return(ApiUtility.ApiSuccess <bool>(true, "Checked"));
 }
Exemple #23
0
        public ApiResponse <bool> VerifyOTP(dynamic otpDetails)
        {
            bool isVrified = _otpServicescs.VerifyOTP(otpDetails.OTP.Value, otpDetails.Email.Value);

            return(ApiUtility.ApiSuccess <bool>(isVrified, isVrified ? "OTP varified successfully" : "Failed !!!"));
        }
Exemple #24
0
        public ApiResponse <List <BannerModel> > GetBanners()
        {
            var banners = _bannerServices.GetAllBanners();

            return(ApiUtility.ApiSuccess <List <BannerModel> >(banners, "Banners listing successfully"));
        }
Exemple #25
0
        public ApiResponse <List <ProductBasicModel> > GetProductSuggestions()
        {
            var products = _productServices.GetProductSuggestions();

            return(ApiUtility.ApiSuccess <List <ProductBasicModel> >(products, "Data Found"));
        }
Exemple #26
0
        public ApiResponse <List <RootCategoryModel> > GetRootCategories()
        {
            var categories = _productServices.GetRootCategories();

            return(ApiUtility.ApiSuccess <List <RootCategoryModel> >(categories, "Categories get successfully"));
        }
Exemple #27
0
        public ApiResponse <ProductDetailsModel> GetProductdetails(int productId, CurrencyTypeName CurrencyName)
        {
            var product = _productServices.GetProductDetails(productId, CurrencyName);

            return(ApiUtility.ApiSuccess <ProductDetailsModel>(product, "Product details get successfully"));
        }