public List <Product> GetProducts() { List <Product> products = new List <Product>(); products = _productProvider.Get().ToList(); return(products); }
public List <Category> GetCategories() { List <Category> categories = new List <Category>(); categories = _categoryProvider.Get().ToList(); return(categories); }
public void SaveOpeningStocks(List <OpeningStock> Stocks) { var ss = _openingAndStockAdjustmentProvider.Get(); foreach (OpeningStock stock in Stocks) { if (stock.ProductCode != null) { _openingAndStockAdjustmentProvider.Insert(stock); } } }
public List <Tax> GetTax() { List <Tax> taxs = new List <Tax>(); taxs = _taxProvider.Get().ToList(); return(taxs); }
public List <Repack> GetRepackByBulkId(int companyId, int?branchId, int bulkCode) { List <Repack> repacks = new List <Repack>(); repacks = _repackItemProvider.Get().Where(x => x.BulkCode == bulkCode).ToList(); return(repacks); }
public void SaveShippingAddress(string countryCode, string state) { ICustomerManager <CustomerInfo> customerManager = Sitecore.Ecommerce.Context.Entity.Resolve <ICustomerManager <CustomerInfo> >(); IEntityProvider <Country> countryProvider = Sitecore.Ecommerce.Context.Entity.Resolve <IEntityProvider <Country> >(); Country country = countryProvider.Get(countryCode); if (country != null) { customerManager.CurrentUser.ShippingAddress.Country = country; customerManager.CurrentUser.BillingAddress.Country = country; } customerManager.CurrentUser.ShippingAddress.State = state; customerManager.CurrentUser.BillingAddress.State = state; customerManager.CurrentUser.ShippingAddress.City = string.Empty; customerManager.CurrentUser.BillingAddress.City = string.Empty; }
/// <summary> Updates the customer information in both Sitecore and in session </summary> /// <param name="formid"> The formid. </param> /// <param name="fields">The fields.</param> /// <param name="data">The data.</param> public void Execute(ID formid, AdaptedResultList fields, params object[] data) { if (StaticSettings.MasterDatabase == null) { Log.Warn("'Create Item' action : master database is unavailable", this); } NameValueCollection form = new NameValueCollection(); ActionHelper.FillFormData(form, fields, this.ProcessField); ICustomerManager <CustomerInfo> customerManager = Context.Entity.Resolve <ICustomerManager <CustomerInfo> >(); CustomerInfo customerInfo = customerManager.GetCustomerInfo(customerManager.CurrentUser.NickName); if (customerInfo == null) { return; } customerInfo.CustomerId = customerManager.CurrentUser.CustomerId; customerInfo.BillingAddress.Name = form["Name"]; customerInfo.BillingAddress.Address = form["Address"]; customerInfo.BillingAddress.Zip = form["Zip"]; customerInfo.BillingAddress.City = form["City"]; customerInfo.BillingAddress.State = form["State"]; if (!string.IsNullOrEmpty(form["Country"])) { IEntityProvider <Country> countryProvider = Context.Entity.Resolve <IEntityProvider <Country> >(); customerInfo.BillingAddress.Country = countryProvider.Get(form["Country"]); } foreach (string key in form.AllKeys) { customerInfo[key] = form[key]; } EntityHelper entityHepler = Context.Entity.Resolve <EntityHelper>(); AddressInfo targetAddressInfo = customerInfo.ShippingAddress; entityHepler.CopyPropertiesValues(customerInfo.BillingAddress, ref targetAddressInfo); customerManager.CurrentUser = customerInfo; customerManager.UpdateCustomerProfile(customerInfo); }
public void PaymentMethodChanged(string paymentMethodCode) { Assert.ArgumentNotNullOrEmpty(paymentMethodCode, "paymentMethodCode"); IEntityProvider <PaymentSystem> provider = Sitecore.Ecommerce.Context.Entity.Resolve <IEntityProvider <PaymentSystem> >(); PaymentSystem paymentMethod = provider.Get(paymentMethodCode); ShoppingCart shoppingCart = Sitecore.Ecommerce.Context.Entity.GetInstance <ShoppingCart>(); shoppingCart.PaymentSystem = paymentMethod; try { Tracker.StartTracking(); AnalyticsUtil.CheckoutPaymentMethodSelected(paymentMethod.Title, paymentMethod.Code); } catch (Exception ex) { LogException(ex); } Sitecore.Ecommerce.Context.Entity.SetInstance(shoppingCart); }
/// <summary> /// Adds CustomerInfo, Shippingdetails and Billingdetails into the ShoppingCart instance /// Also updates the CustomerInfo session /// </summary> /// <param name="formid">The formid.</param> /// <param name="fields">The fields.</param> /// <param name="data">The data.</param> /// <exception cref="ValidatorException">Throws <c>ValidatorException</c> in a customer is already exists.</exception> public void Execute(ID formid, AdaptedResultList fields, params object[] data) { AnalyticsUtil.CheckoutNext(); NameValueCollection orderInfo = new NameValueCollection(); ActionHelper.FillFormData(orderInfo, fields, this.FillOrderInfo); bool isNewUser = false; ICustomerManager <CustomerInfo> customerManager = Context.Entity.Resolve <ICustomerManager <CustomerInfo> >(); CustomerInfo customerInfo; if (orderInfo["HideCreateUserSection"] == "1" && !string.IsNullOrEmpty(orderInfo["Password"]) && !Sitecore.Context.User.IsAuthenticated) { try { string fullNickName = Sitecore.Context.Domain.GetFullName(orderInfo["Email"]); customerInfo = customerManager.CreateCustomerAccount(fullNickName, orderInfo["Password"], orderInfo["Email"]); } catch (MembershipCreateUserException ex) { Log.Error("Unable to create a customer account.", ex, this); throw new ValidatorException(ex.Message, ex); } isNewUser = true; } else { customerInfo = customerManager.CurrentUser; } Assert.IsNotNull(customerInfo, "Cannot create user"); foreach (string key in orderInfo.AllKeys) { customerInfo[key] = orderInfo[key]; } customerInfo.BillingAddress.Name = orderInfo["Name"]; customerInfo.BillingAddress.Address = orderInfo["Address"]; customerInfo.BillingAddress.Zip = orderInfo["Zip"]; customerInfo.BillingAddress.City = orderInfo["City"]; customerInfo.BillingAddress.State = orderInfo["State"]; customerInfo.Email = orderInfo["Email"]; // Find country. if (!string.IsNullOrEmpty(orderInfo["Country"])) { IEntityProvider <Country> countryProvider = Context.Entity.Resolve <IEntityProvider <Country> >(); customerInfo.BillingAddress.Country = countryProvider.Get(orderInfo["Country"]); } // If shipping checkbox is checked if (orderInfo["HideThisSection"] == "1") { customerInfo.ShippingAddress.Name = orderInfo["ShippingName"]; customerInfo.ShippingAddress.Address = orderInfo["ShippingAddress"]; customerInfo.ShippingAddress.Zip = orderInfo["ShippingZip"]; customerInfo.ShippingAddress.City = orderInfo["ShippingCity"]; customerInfo.ShippingAddress.State = orderInfo["ShippingState"]; if (!string.IsNullOrEmpty(orderInfo["ShippingCountry"])) { IEntityProvider <Country> countryProvider = Context.Entity.Resolve <IEntityProvider <Country> >(); customerInfo.ShippingAddress.Country = countryProvider.Get(orderInfo["ShippingCountry"]); } } else { EntityHelper entityHepler = Context.Entity.Resolve <EntityHelper>(); AddressInfo targetAddressInfo = customerInfo.ShippingAddress; entityHepler.CopyPropertiesValues(customerInfo.BillingAddress, ref targetAddressInfo); } ShoppingCart shoppingCart = Context.Entity.GetInstance <ShoppingCart>(); shoppingCart.CustomerInfo = customerInfo; IEntityProvider <NotificationOption> notificationProvider = Context.Entity.Resolve <IEntityProvider <NotificationOption> >(); Assert.IsNotNull(notificationProvider, "Notification options provider is null"); shoppingCart.NotificationOption = notificationProvider.Get("Email"); shoppingCart.NotificationOptionValue = orderInfo["Email"]; if (isNewUser) { customerManager.UpdateCustomerProfile(customerInfo); } customerManager.CurrentUser = customerInfo; Context.Entity.SetInstance(shoppingCart); // Indicates that the form has been filled out and that it should be initialized if the user returnes to this page. ICheckOut checkOut = Context.Entity.GetInstance <ICheckOut>(); if (checkOut is CheckOut) { ((CheckOut)checkOut).HasOtherShippingAddressBeenChecked = orderInfo["HideThisSection"] == "1"; } Context.Entity.SetInstance(checkOut); ItemUtil.RedirectToNavigationLink(NavigationLinkNext, false); }
public List <SystemConfiguration> GetSystemConfiguration() { return(_systemConfigurationProvider.Get().ToList()); }
public MasterLabelSetting GetMasaterLabelSetting() { return(_masterLabelSettingProvider.Get().FirstOrDefault()); }
public List <PaymentToSupplier> GetPaymentsByPaymentTypeAndInvoiceNo(int companyId, int?branchId, int invoiceNo, int purchaseType) { return(_paymentToSupplierProvider.Get().Where(supplier => supplier.CompanyCode == companyId && supplier.BranchCode == branchId && supplier.InvoiceNo == invoiceNo && supplier.PurchaseType == purchaseType).ToList()); }
public List <PurchaseReturn> GetPurchaseReturns() { return(_purchaseReturnProvider.Get().ToList()); }
public List <PurchaseOrder> GetPurchases() { return(_purchaseProvider.Get().ToList()); }
private void GetAirfieldAndAircraft(Flight flight) { flight.Airfield = _airfieldProvider.Get(flight.AirfieldId); flight.Aircraft = _aircraftProvider.Get(flight.AircraftId); }
public CarWorkshop Get(int id) => carWorkshopService.Get(id).AsCustomerView();
public OfferDetail GetOfferDetail(int?id) { return(_OfferDetailProvider.Get().Where(item => item.Id == id).FirstOrDefault()); }
public List <Wastage> GetWastage() { //List<Wastage> wastages = new List<Wastage>(); return(_wastageProvider.Get().ToList()); //return this._wastageProvider.Get().ToList(); }
public void DeletePurchase(PurchaseOrder purchase) { this._stockProvider.Delete(_stockProvider.Get().ToList().Where(item => item.PurchaseOrderId == purchase.Id).FirstOrDefault()); this._purchaseProvider.Delete(purchase); }
public object Get(int id) => userService.Get(id).AsCustomerView();
public List <Purchase> GetDirectPurchases() { return(_directPurchaseProvider.Get().ToList()); }
public List <StockAdjustment> GetStockAdjustments() { return(_stockAdjustmentProvider.Get().ToList()); }
public List <Supplier> GetSuppliersByCompanyAndBrach(int companyId, int?branchId) { return(_supplierProvider.Get().Where(supplier => supplier.CompanyCode == companyId && supplier.BranchCode == branchId).ToList()); }
public List <LabelSetting> GetLabel() { return(_labelSettingProvider.Get().ToList()); }
/// <summary> /// Submits the specified formid. /// </summary> /// <param name="formid">The formid.</param> /// <param name="fields">The fields.</param> /// <param name="data">The data.</param> public void Execute(ID formid, AdaptedResultList fields, params object[] data) { if (StaticSettings.MasterDatabase == null) { Log.Warn("'Create Item' action : master database is unavailable", this); } NameValueCollection form = new NameValueCollection(); ActionHelper.FillFormData(form, fields, this.ProcessField); // If username and password was given, create a user. if (string.IsNullOrEmpty(form["Email"]) || string.IsNullOrEmpty(form["Password"])) { return; } string name = form["Email"].Trim(); string password = form["Password"]; string email = form["Email"]; string fullNickName = Sitecore.Context.Domain.GetFullName(name); ICustomerManager <CustomerInfo> customerManager = Context.Entity.Resolve <ICustomerManager <CustomerInfo> >(); CustomerInfo customerInfo = customerManager.CreateCustomerAccount(fullNickName, password, email); if (customerInfo == null) { AnalyticsUtil.AuthentificationAccountCreationFailed(); return; } foreach (string key in form.AllKeys) { customerInfo[key] = form[key]; } customerInfo.BillingAddress.Name = form["Name"]; customerInfo.BillingAddress.Address = form["Address"]; customerInfo.BillingAddress.Zip = form["Zip"]; customerInfo.BillingAddress.City = form["City"]; customerInfo.BillingAddress.State = form["State"]; if (!string.IsNullOrEmpty(form["Country"])) { IEntityProvider <Country> countryProvider = Context.Entity.Resolve <IEntityProvider <Country> >(); customerInfo.BillingAddress.Country = countryProvider.Get(form["Country"]); } if (form["HideThisSection"] == "1") { customerInfo.ShippingAddress.Name = form["Name"]; customerInfo.ShippingAddress.Address = form["Address"]; customerInfo.ShippingAddress.Zip = form["Zip"]; customerInfo.ShippingAddress.City = form["City"]; customerInfo.ShippingAddress.State = form["State"]; if (!string.IsNullOrEmpty(form["ShippingCountry"])) { IEntityProvider <Country> countryProvider = Context.Entity.Resolve <IEntityProvider <Country> >(); customerInfo.ShippingAddress.Country = countryProvider.Get(form["ShippingCountry"]); } } else { EntityHelper entityHepler = Context.Entity.Resolve <EntityHelper>(); AddressInfo targetAddressInfo = customerInfo.ShippingAddress; entityHepler.CopyPropertiesValues(customerInfo.BillingAddress, ref targetAddressInfo); } customerManager.UpdateCustomerProfile(customerInfo); customerManager.CurrentUser = customerInfo; AnalyticsUtil.AuthentificationAccountCreated(); }
public List <ProductLabelSetting> GetProductLabelSettings(int masterLabelId) { return(_productLabelSettingProvider.Get().Where(x => x.MasterLabelSettingCode == masterLabelId).ToList()); }