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!!!")); }
public ApiResponse <bool> LogOff() { var deviceNo = GetDeviceNo(); var isLogOff = _customerServices.CustomerLogOff(deviceNo); return(ApiUtility.ApiSuccess <bool>(isLogOff, isLogOff ? "Logoff successfully" : "Failed !!!")); }
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")); }
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")); }
public ApiResponse <CartItemSummary> ShowCartItems(string couponCode = "") { var deviceNo = GetDeviceNo(); var items = _productServices.ShowCartItems(deviceNo); return(ApiUtility.ApiSuccess <CartItemSummary>(items, "Item(s) found")); }
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 !!!")); }
public ApiResponse <List <WishListItem> > ShowWishListItems() { var deviceNo = GetDeviceNo(); var items = _productServices.ShowWishListItems(deviceNo); return(ApiUtility.ApiSuccess <List <WishListItem> >(items, "Wishlist item(s) found.")); }
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!!!")); }
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")); }
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 !!!")); }
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)); } }
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")); } }
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 !!!")); }
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")); } }
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 !!!")); } }
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 !!!")); } }
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 !!!")); }
public ApiResponse <bool> CheckConnection() { return(ApiUtility.ApiSuccess <bool>(true, "Checked")); }
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 !!!")); }
public ApiResponse <List <BannerModel> > GetBanners() { var banners = _bannerServices.GetAllBanners(); return(ApiUtility.ApiSuccess <List <BannerModel> >(banners, "Banners listing successfully")); }
public ApiResponse <List <ProductBasicModel> > GetProductSuggestions() { var products = _productServices.GetProductSuggestions(); return(ApiUtility.ApiSuccess <List <ProductBasicModel> >(products, "Data Found")); }
public ApiResponse <List <RootCategoryModel> > GetRootCategories() { var categories = _productServices.GetRootCategories(); return(ApiUtility.ApiSuccess <List <RootCategoryModel> >(categories, "Categories get successfully")); }
public ApiResponse <ProductDetailsModel> GetProductdetails(int productId, CurrencyTypeName CurrencyName) { var product = _productServices.GetProductDetails(productId, CurrencyName); return(ApiUtility.ApiSuccess <ProductDetailsModel>(product, "Product details get successfully")); }