public IActionResult SalesReport(int daysAgo) { var APIStores = new StoreApi(new Configuration { BasePath = "https://localhost:44368/" }); var stores = APIStores.ApiStoreGet(); var APIOrders = new OrderApi(new Configuration { BasePath = "https://localhost:44368/" }); var orders = APIOrders.ApiOrderGet(); List <SalesReport> summary = orders.Where(sales => (DateTime.Now - (DateTime)sales.TimeStamp).TotalDays <= daysAgo) .GroupBy(sales1 => sales1.Store).Select(sales2 => new SalesReport { Item = sales2.First().Store.Name, Quantity = sales2.Count(), Revenue = sales2.Sum(sales => (double)sales.PriceTotal), Pizzas = sales2.SelectMany(group => group.Pizza).GroupBy(pizza => pizza.Pizza).Select(pizzaGroup => new SalesReport { Item = pizzaGroup.First().Name, Quantity = pizzaGroup.Count(), Revenue = pizzaGroup.Sum(sales => (double)sales.Price), }).OrderBy(report => report.Item) }).ToList(); return(View(summary)); }
public CreateOrderAction(OrderApi orderApi, CustomerApi customerApi, ProductApi productApi, OrderLineApi orderLineApi) { _orderApi = orderApi; _customerApi = customerApi; _productApi = productApi; _orderLineApi = orderLineApi; }
/// <summary> /// 装载格口 /// </summary> /// <param name="orderApi"></param> /// <returns></returns> public LatticeInfo LoadLattice(OrderApi orderApi) { var latticeInfo = SlaveInfo.LatticeInfo.Where(o => string.IsNullOrWhiteSpace(o.OrderNo)) .OrderBy(o => Convert.ToInt16(o.LatticeNo)) .FirstOrDefault(); if (latticeInfo != null) { latticeInfo.OrderNo = orderApi.OrderNo; orderApi.ProductApi.ForEach(o => { latticeInfo.Product.Add(new Product() { BarCode = o.BarCode, ProductName = o.ProductName, PutNum = 0, WaitNum = o.Num, ProductCode = o.ProductCode, PropertyCode = o.PropertyCode, Feature = o.Feature }); }); } return(latticeInfo); }
public SyncController( StateRepository stateRepository, OneTimeJobScheduler oneTimeJobService, RecurringJobScheduler recurringJobService, JobMonitoringService jobStatusService, ExecutionLogService logRepository, SyncInventoryRepository syncInventoryRepository, SettingsRepository settingsRepository, ShopifyUrlService shopifyUrlService, ConfigStatusService configStatusService, InstanceContext instanceContext, AcumaticaUrlService acumaticaUrlService, OrderApi shopifyOrderApi) { _stateRepository = stateRepository; _oneTimeJobService = oneTimeJobService; _recurringJobService = recurringJobService; _jobStatusService = jobStatusService; _logRepository = logRepository; _syncInventoryRepository = syncInventoryRepository; _shopifyUrlService = shopifyUrlService; _shopifyOrderApi = shopifyOrderApi; _instanceContext = instanceContext; _acumaticaUrlService = acumaticaUrlService; _configStatusService = configStatusService; _settingsRepository = settingsRepository; }
public IActionResult GetOrdersByCustomer(string Name) { if (Name is null) { return(BadRequest("Customer field was empty or null")); } var APICustomer = new CustomerApi(new Configuration { BasePath = "https://localhost:44368/" }); var customers = APICustomer.ApiCustomerGet(); var foundCustomer = customers.FirstOrDefault(cust => cust.Name.Equals(Name)); if (foundCustomer is not null) { var APIOrder = new OrderApi(new Configuration { BasePath = "https://localhost:44368/" }); var orders = APIOrder.ApiOrderGet(); List <Order> customerOrders = orders.Where( order => order.Customer.Id.Equals(foundCustomer.Id)).ToList(); return(View(customerOrders)); } ViewBag.ErrorMessage = "This user has no previous orders."; return(View("ViewCustomerOrders")); }
public ActionResult Order([FromBody] OrderApi orderApi) { if (orderApi == null) { return(Json(new ResultsJson(new Message(CodeMessage.PostNull, "PostNull"), null))); } return(Json(Global.BUSS.BussResults(this, orderApi))); }
protected void Display_View() { pnl_viewall.Visible = false; List<OrderData> orderList = new List<OrderData>(); List<AddressData> aAddreses = new List<AddressData>(); List<Ektron.Cms.Commerce.Basket> basketList; OrderApi orderApi = new OrderApi(); BasketApi basketApi = new BasketApi(); // customer cCustomer = CustomerManager.GetItem(this.m_iID); m_iCustomerId = cCustomer.Id; this.ltr_id.Text = cCustomer.Id.ToString(); this.ltr_uname.Text = cCustomer.UserName; this.ltr_fname.Text = cCustomer.FirstName; this.ltr_lname.Text = cCustomer.LastName; this.ltr_dname.Text = cCustomer.DisplayName; this.ltr_ordertotal.Text = cCustomer.TotalOrders.ToString(); this.ltr_orderval.Text = defaultCurrency.ISOCurrencySymbol + EkFunctions.FormatCurrency(cCustomer.TotalOrderValue, defaultCurrency.CultureCode); this.ltr_pervalue.Text = defaultCurrency.ISOCurrencySymbol + EkFunctions.FormatCurrency(cCustomer.AverageOrderValue, defaultCurrency.CultureCode); // customer // orders Criteria<OrderProperty> orderCriteria = new Criteria<OrderProperty>(); orderCriteria.AddFilter(OrderProperty.CustomerId, CriteriaFilterOperator.EqualTo, m_iID); orderList = orderApi.GetList(orderCriteria); if (orderList.Count == 0) { ltr_orders.Text = this.GetMessage("lbl no orders"); } dg_orders.DataSource = orderList; dg_orders.DataBind(); // orders // addresses aAddreses = AddressManager.GetList(m_iID); if (aAddreses.Count == 0) { ltr_address.Text = this.GetMessage("lbl no addresses"); } dg_address.DataSource = aAddreses; dg_address.DataBind(); // addresses // baskets if (this.m_iID > 0) { basketList = basketApi.GetList(this.m_iID); if (basketList.Count == 0) { ltr_baskets.Text = this.GetMessage("lbl no baskets"); } dg_baskets.DataSource = basketList; dg_baskets.DataBind(); } }
public ActionResult Order([FromBody] OrderApi orderApi) { if (orderApi == null) { return(Json(new ResultsJson(new Message(CodeMessage.PostNull, "PostNull"), null))); } return(Json(Global.BUSS.BussResults(ApiType.OrderApi, orderApi.token, orderApi.method, orderApi.param))); }
public IActionResult PlaceOrder() { var sessionOrder = Utils.GetCurrentOrder(HttpContext.Session); var API = new OrderApi(new Configuration { BasePath = "https://localhost:44368/" }); API.ApiOrderPost(sessionOrder); return(RedirectToAction("Index", "Home")); }
public ShopifyTransactionGet( ShopifyOrderRepository orderRepository, ShopifyJsonService shopifyJsonService, ExecutionLogService logService, OrderApi orderApi) { _shopifyJsonService = shopifyJsonService; _orderRepository = orderRepository; _logService = logService; _orderApi = orderApi; }
public IActionResult ManagerSeat() { //var client = new ApiClient(); var API = new OrderApi(new Configuration { BasePath = "https://localhost:44368/" }); var orders = API.ApiOrderGet(); //var orders = FEOrderClient.GetOrders(); return(View(orders)); }
public static Order GetOrderCall() { const string simpleKey = "109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00"; var api = new OrderApi(simpleKey); const string expansion = "item,summary"; const string orderId = "DEMO-0009104309"; OrderResponse res = api.GetOrder(orderId, expansion); return(res.Order); }
public OrdersController(OrderApi api = null) { if (_api == null) { _api = new OrderApi(); } else { _api = api; } }
public ShopifyDataFeeder( InstanceContext connection, OrderApi orderApi, CustomerApi customerApi, IPushLogger logger) { _connection = connection; _orderApi = orderApi; _customerApi = customerApi; _logger = logger; }
public ShopifyJsonService( OrderApi orderApi, ProductApi productApi, InventoryApi inventoryApi, CustomerApi customerApi, ProcessPersistContext dataContext) { _orderApi = orderApi; _productApi = productApi; _inventoryApi = inventoryApi; _customerApi = customerApi; _dataContext = dataContext; }
public Gateway(ClientContext _context) { context = _context; authApi = new AuthenticationApi(context.Config); orderApi = new OrderApi(context.Config); payApi = new PaymentApi(context.Config); verifyApi = new VerificationApi(context.Config); currencyApi = new CurrencyConversionApi(context.Config); fraudApi = new FraudDetectApi(context.Config); paySchedulesApi = new PaymentSchedulesApi(context.Config); payTokenApi = new PaymentTokenApi(context.Config); payUrlApi = new PaymentURLApi(context.Config); infoApi = new InformationLookupApi(context.Config); }
public void Util_BindData() { DateTime firstItemDate = DateTime.Now; List<List<int>> dataset = new List<List<int>>(); List<string> labels = new List<string>(); OrderApi orderApi = new OrderApi(); OrderReportData report = new OrderReportData(); Criteria<OrderProperty> orderCriteria = new Criteria<OrderProperty>(); orderCriteria.PagingInfo = new PagingInfo(orderApi.RequestInformationRef.PagingSize); orderCriteria = Util_GetDates(orderCriteria); report = orderApi.GetReport(orderCriteria); dataset.Add(Util_GetDateValues(report)); labels = Util_GetDateLabels(report); TrendTimeLineChart.LoadSplitData(StartDate, StartDate, labels.ToArray(), dataset.ToArray()); }
// uncomment to run. C# projects can only have one main. // public static void Main() // { // var result = AdjustOrderTotalCall(); // Console.WriteLine($"Result of OrderAPI.AdjustOrderTotal was {result}"); // } // Comments about AdjustOrderTotal public static bool AdjustOrderTotalCall() { const string simpleKey = "109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00"; var api = new OrderApi(simpleKey); // this order's original subtotal was around $314.93 and a quantity of 7 items. // We'll reduce the price by a multiplier of one item, although that is not a requirement. // The new total must be less than the current and greater than zero. // If the result is false, the order was still updated, but the target was not achieved. // This will happen if the algorithm reaches the maximum iteration and is still a few pennies off. var orderId = "DEMO-0009104402"; var newTotal = "217.93"; // notice this is a string BaseResponse result = api.AdjustOrderTotal(orderId, newTotal); return(result.Success.HasValue && result.Success.Value); }
protected void Page_Load(object sender, EventArgs e) { if (!IsCommerceAdmin) return; long orderId = (Request.QueryString["id"] != null ? Convert.ToInt64(Request.QueryString["id"]) : 0); OrderApi orderAPI = new OrderApi(); OrderData order = orderAPI.GetItem(orderId); string type = (Request.QueryString["type"] != null ? Request.QueryString["type"] : "pdf"); Ektron.Cms.Common.Export.ExportManager exportManager = new Ektron.Cms.Common.Export.ExportManager(); Response.Clear(); switch (type) { case "csv": exportManager.SetProvider("CSVExportProvider"); Response.AddHeader("Content-Disposition", "attachment;filename=order.csv"); Response.ContentType = "text/csv"; break; case "xls": exportManager.SetProvider("XLSExportProvider"); Response.AddHeader("Content-Disposition", "attachment;filename=order.xls"); Response.ContentType = "application/ms-excel"; break; default: exportManager.SetProvider("PDFExportProvider"); Response.AddHeader("Content-Disposition", "attachment;filename=order.pdf"); Response.ContentType = "application/pdf"; break; } Response.BinaryWrite(exportManager.ExportToFile(order)); Response.End(); }
public IActionResult SelectStore() { var sessionOrder = Utils.GetCurrentOrder(HttpContext.Session); var API = new OrderApi(new Configuration { BasePath = "https://localhost:44368/" }); var orders = API.ApiOrderGet(); var API2 = new StoreApi(new Configuration { BasePath = "https://localhost:44368/" }); var stores = API2.ApiStoreGet(); List <Order> previousOrders = orders.Where( order => order.Customer.Name.Equals(sessionOrder.Customer.Name)).OrderByDescending(order => order.TimeStamp).ToList(); List <AStore> storesToDisplay = new List <AStore>(); #if !DEBUG if (previousOrders.Any() && timeSinceOrder(previousOrders.First()).TotalHours < 2) { return(BadRequest("At least 2 hours must pass since your last order before you can place another.")); } foreach (var store in stores) { var lastOrderFromStore = previousOrders.FirstOrDefault(order => order.Store.Name.Equals(store.Name)); if (lastOrderFromStore is null || timeSinceOrder(lastOrderFromStore).TotalHours >= 24) { storesToDisplay.Add(store); } } #else storesToDisplay = stores; #endif if (storesToDisplay.Count == 0) { return(BadRequest("There is a 24 hour waiting period for making repeat orders at each store. All stores are currently under this waiting period.")); } ViewBag.Stores = new SelectList(storesToDisplay.ToList(), "Id", "Name"); return(View(new AStore())); }
private void BtnValidar_Click(object sender, EventArgs e) { OrderApi currentOrder = dgOrders.CurrentItem as OrderApi; var json = JsonConvert.SerializeObject(currentOrder); try { WebClient webClient = new WebClient(); webClient.Headers[HttpRequestHeader.ContentType] = "application/json"; webClient.UploadString("http://localhost:56311/api/Orders/" + currentOrder.OrderId, "PUT", json); MessageBox.Show("Pedido enviado", "Ventas", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification); } catch (Exception ex) { MessageBox.Show(ex.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification); } }
public ShopifyOrderGet( ShopifyOrderRepository orderRepository, ShopifyBatchRepository batchRepository, SettingsRepository settingsRepository, ShopifyCustomerGet shopifyCustomerPull, ShopifyTransactionGet shopifyTransactionGet, JobMonitoringService jobMonitoringService, ExecutionLogService executionLogService, ShopifyJsonService shopifyJsonService, OrderApi orderApi) { _orderRepository = orderRepository; _batchRepository = batchRepository; _settingsRepository = settingsRepository; _shopifyCustomerPull = shopifyCustomerPull; _shopifyTransactionGet = shopifyTransactionGet; _jobMonitoringService = jobMonitoringService; _executionLogService = executionLogService; _shopifyJsonService = shopifyJsonService; _orderApi = orderApi; }
public ShopifyManager( ShopifyReferenceGet shopifyReferenceGet, ShopifyInventoryGet shopifyInventoryPull, ShopifyCustomerGet shopifyCustomerPull, ShopifyOrderGet shopifyOrderPull, ShopifyTransactionGet shopifyTransactionPull, ExecutionLogService executionLogService, StateRepository stateRepository, IPushLogger logger, OrderApi orderApi) { _shopifyReferenceGet = shopifyReferenceGet; _shopifyInventoryPull = shopifyInventoryPull; _shopifyCustomerPull = shopifyCustomerPull; _shopifyOrderPull = shopifyOrderPull; _shopifyTransactionPull = shopifyTransactionPull; _executionLogService = executionLogService; _stateRepository = stateRepository; _logger = logger; _orderApi = orderApi; }
public void Util_BindData() { DateTime firstItemDate = DateTime.Now; List<List<int>> dataset = new List<List<int>>(); List<string> labels = new List<string>(); OrderApi orderApi = new OrderApi(); OrderReportData report = new OrderReportData(); Criteria<OrderProperty> orderCriteria = new Criteria<OrderProperty>(); orderCriteria.PagingInfo = new PagingInfo(orderApi.RequestInformationRef.PagingSize); orderCriteria = Util_GetDates(orderCriteria); report = orderApi.GetReport(orderCriteria); ltr_count.Text = report.TotalOrders.ToString() + " " + GetMessage("lbl total orders with a value of") + " " + orderApi.RequestInformationRef.CommerceSettings.CurrencyAlphaISO + orderApi.RequestInformationRef.CommerceSettings.CurrencySymbol + report.Dates.OrderValue(orderApi.RequestInformationRef.CommerceSettings.CurrencyId); dataset.Add(Util_GetDateValues(report)); labels = Util_GetDateLabels(report); TrendTimeLineChart.LoadSplitData(StartDate, StartDate, labels.ToArray(), dataset.ToArray()); }
/// <summary> /// OandaApiConnection constuctor /// Sets up the configuration and the datetime format /// </summary> /// <param name="connectionType">Type of the connection</param> /// <param name="accessToken">Access token for the connection</param> /// <param name="dateTimeFormat">Date time format to use for the connection</param> public OandaApiConnection(OandaConnectionType connectionType, string accessToken, DateTimeFormat dateTimeFormat = DateTimeFormat.RFC3339) { // Init configuration Configuration = new Configuration() { UserAgent = $"OandaDotnetSdk/{Assembly.GetExecutingAssembly().GetName().Version}", BasePath = connectionType.ToBasePath(), AccessToken = accessToken }; // Init date time format DateTimeFormat = dateTimeFormat; // Init actual Oanda API connections from the GeriRemenyi.Oanda.V20.Client AccountApi = new AccountApi(Configuration); InstrumentApi = new InstrumentApi(Configuration); OrderApi = new OrderApi(Configuration); TradeApi = new TradeApi(Configuration); PositionApi = new PositionApi(Configuration); TransactionApi = new TransactionApi(Configuration); PricingApi = new PricingApi(Configuration); // Init object caches _accountsCache = new Dictionary <string, IAccount>(); _instrumentCache = new Dictionary <InstrumentName, IInstrument>(); // Fire a really small request synchronously to check that the inited connection is OK // Also fill the available accounts based on this try { Accounts = AccountApi.GetAccounts().Accounts; } catch { throw new ConnectionInitializationException($"Unable to connect to {Configuration.BasePath} with the given token"); } }
public IHttpActionResult PutOrder(int id, OrderApi orderApi) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != orderApi.OrderId) { return(BadRequest()); } //db.Entry(orderApi).State = EntityState.Modified; try { Order order = db.Orders.FirstOrDefault(x => x.OrderId == orderApi.OrderId); if (order.Status == Status.Solicitado || order.Status == Status.En_Pausa) { order.Status = Status.En_Revision; foreach (var concept in order.Concepts) { if (concept.Product.Comprado - concept.Product.Vendido < concept.Cantidad) { order.Status = Status.En_Pausa; break; } } if (order.Status == Status.En_Revision) { order.Status = Status.En_Armado; foreach (var concept in order.Concepts) { concept.Product.Vendido += concept.Cantidad; } } } else if (order.Status == Status.En_Armado) { order.Status = Status.En_Ruta; } db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!OrderExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public static void InsertOrderCall() { const string simpleKey = "109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00"; var api = new OrderApi(simpleKey); }
protected void Display_ViewOnHold() { List<OrderData> orderList = new List<OrderData>(); OrderApi orderApi = new OrderApi(); Criteria<OrderProperty> orderCriteria = new Criteria<OrderProperty>(); bool Toggle = true; orderCriteria.PagingInfo.RecordsPerPage = m_refContentApi.RequestInformationRef.PagingSize; orderCriteria.PagingInfo.CurrentPage = _currentPageNumber; orderList = orderApi.GetOnHoldOrderList(orderCriteria.PagingInfo); TotalPagesNumber = System.Convert.ToInt32(orderCriteria.PagingInfo.TotalPages); PagingInfo(TotalPagesNumber, Toggle); dg_orders.DataSource = orderList; dg_orders.DataBind(); }
public OrderRequests() { _api = new OrderApi(this.Client); }
public static void UpdateAccountsReceivableRetryConfigCall() { const string simpleKey = "109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00"; var api = new OrderApi(simpleKey); }
public ShowDetailedOrdersAction(DetailedOrderApi detailedOrderApi, OrderApi orderApi) { _detailedOrderApi = detailedOrderApi; _orderApi = orderApi; }
public PreparedOrderLineAction(OrderApi orderApi, OrderLineApi orderLineApi) { _orderLineApi = orderLineApi; _orderApi = orderApi; // _orderDto= new OrderDto(); }
protected override void Page_Load(object sender, System.EventArgs e) { try { base.Page_Load(sender, e); orderApi = new OrderApi(); Util_RegisterResources(); defaultCurrency = (new CurrencyApi()).GetItem(m_refContentApi.RequestInformationRef.CommerceSettings.DefaultCurrencyId); System.Web.HttpCookie siteCookie = CommonApi.GetEcmCookie(); if (siteCookie["SiteCurrency"] != defaultCurrency.Id.ToString()) { defaultCurrency.Id = Convert.ToInt32(siteCookie["SiteCurrency"]); CurrencyApi m_refCurrencyApi = new CurrencyApi(); defaultCurrency = m_refCurrencyApi.GetItem(defaultCurrency.Id); } m_refMsg = m_refContentApi.EkMsgRef; CustomerManager = new Customer(m_refContentApi.RequestInformationRef); Util_CheckAccess(); if (!string.IsNullOrEmpty(Request.QueryString["folder"])) { m_FolderId = Convert.ToInt64(Request.QueryString["folder"]); } Display_Commerce(); Util_SetLabels(); } catch (Exception ex) { Utilities.ShowError(ex.Message); } }
protected override void Page_Load(object sender, System.EventArgs e) { try { base.Page_Load(sender, e); if (!Utilities.ValidateUserLogin()) { return; } if (!Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refContentApi.RequestInformationRef, Ektron.Cms.DataIO.LicenseManager.Feature.eCommerce)) { throw (new Exception(GetMessage("feature locked error"))); } dg_orders.Columns[0].HeaderText = this.GetMessage("generic id"); dg_orders.Columns[1].HeaderText = this.GetMessage("lbl attr date"); dg_orders.Columns[2].HeaderText = this.GetMessage("lbl site"); dg_orders.Columns[3].HeaderText = this.GetMessage("lbl search status"); dg_orders.Columns[4].HeaderText = this.GetMessage("lbl customer"); dg_orders.Columns[5].HeaderText = this.GetMessage("lbl order value"); orderApi = new OrderApi(); defaultCurrency = (new CurrencyApi()).GetItem(m_refContentApi.RequestInformationRef.CommerceSettings.DefaultCurrencyId); CustomerManager = new Customer(m_refContentApi.RequestInformationRef); Util_CheckAccess(); Util_RegisterResources(); Util_SetServerJSVariable(); switch (this.m_sPageAction) { //case "editaddress": // if (Request.QueryString["addressType"] != "") // { // addressType = Request.QueryString["addressType"]; // } // RegionManager = new RegionApi(); // CountryManager = new CountryApi(); // if (Page.IsPostBack && isCPostData.Value == "") // { // Process_EditAddress(); // } // else // { // Display_ViewAddress(true); // } // break; case "vieworder": if (Page.IsPostBack && Request.Form["hdn_code"] == "2") { Process_Capture(); } else if (Page.IsPostBack && Request.Form["hdn_code"] == "3") { Process_Fraud(); } else if (Page.IsPostBack && Request.Form["hdn_code"] == "4") { Process_CancelOrder(); } else if (Page.IsPostBack && Request.Form["hdn_code"] == "5") { Process_CallOrderEvent(); } else { Display_ViewOrder(null); } break; case "showpayment": if (Page.IsPostBack && Request.Form["hdn_code"] == "2") { Process_Capture(); } else if (Page.IsPostBack && Request.Form["hdn_code"] == "7") { Process_CaptureAndSettle(); } else if (Page.IsPostBack && Request.Form["hdn_code"] == "8") { Process_Settle(); } else { Display_ViewPayment(); } break; case "editnotes": if (Page.IsPostBack && Request.Form["hdn_code"] == "6") { Process_EditNotes(); } else { Display_ViewNotes(); } break; case "trackingnumber": if (Page.IsPostBack) { Process_TrackingNumber(); } else { Display_TrackingNumber(); } break; case "mostrecent": if (Page.IsPostBack == false) { Display_MostRecent(); } break; case "bydates": if (Page.IsPostBack == false) { Display_ByDates(); } break; case "byproduct": if (Page.IsPostBack == false) { Display_ByProduct(); } break; case "bycustomer": if (Page.IsPostBack == false) { Display_ByCustomer(); } break; case "custom": Display_ViewCustom(); break; case "onhold": if (Page.IsPostBack == false) { Display_ViewOnHold(); } break; case "delete": if (Page.IsPostBack == false) { if (bCommerceAdmin) { if (!string.IsNullOrEmpty(Request.QueryString["orderid"]) && Convert.ToInt64(Request.QueryString["orderid"]) > 0) { orderApi.DeleteOrder(Convert.ToInt64(Request.QueryString["orderid"])); Display_ViewAll(); } } else { throw (new Exception(GetMessage("err not role commerce-admin"))); } } break; default: // "viewall" if (Page.IsPostBack == false) { Display_ViewAll(); } break; } Util_SetLabels(); Util_SetJS(); } catch (Exception ex) { Utilities.ShowError(ex.Message); } }
protected void Display_MostRecent() { List<OrderData> orderList = new List<OrderData>(); OrderApi orderApi = new OrderApi(); orderList = orderApi.GetList(new Criteria<OrderProperty>()); dg_orders.DataSource = orderList; dg_orders.DataBind(); }
public void Init() { instance = new OrderApi(new TestConfig()); }
protected void Display_OnHold() { List<OrderData> orderList = new List<OrderData>(); OrderApi orderApi = new OrderApi(); orderList = orderApi.GetOnHoldOrderList(new PagingInfo()); dg_orders.DataSource = orderList; dg_orders.DataBind(); }
public void Init() { instance = new OrderApi(); }
protected void Display_ViewOrder() { OrderApi orderApi = new OrderApi(); order = orderApi.GetItem(this.m_iID); this.ltr_id.Text = order.Id.ToString(); this.ltr_customer.Text = Util_ShowCustomer(order.Customer); this.ltr_created.Text = Util_ShowDate(order.DateCreated); this.ltr_completed.Text = Util_ShowDate(order.DateCompleted); this.ltr_required.Text = Util_ShowDate(order.DateRequired); this.ltr_orderstatus.Text = System.Enum.GetName(typeof(EkEnumeration.OrderStatus), order.Status); this.ltr_ordertotal.Text = FormatCurrency(order.OrderTotal, ""); this.ltr_pipelinestage.Text = order.StageName; this.dg_orderparts.DataSource = order.Parts; this.dg_orderparts.DataBind(); this.dg_orderlines.DataSource = order.Parts[0].Lines; this.dg_orderlines.DataBind(); }
public static void ResendShipmentConfirmationCall() { const string simpleKey = "109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00"; var api = new OrderApi(simpleKey); }
protected void Display_ByDates() { DateTime startDate = Convert.ToDateTime(Request.QueryString["startdate"]); DateTime endDate = Convert.ToDateTime(Request.QueryString["enddate"]); List<OrderData> orderList = new List<OrderData>(); OrderApi orderApi = new OrderApi(); orderList = orderApi.GetList(startDate, endDate, new PagingInfo()); dg_orders.DataSource = orderList; dg_orders.DataBind(); }