public virtual JsonResult ExportOrders([FromBody] OneCAuth model) { if (model == null) { return(Json(new OneCResponse() { Success = false, Message = "JSON format is incorrect." })); } var response = IsLogin(model?.Username, model?.Email, model?.Password); if (response.Success) { var customer = _customerSettings.UsernamesEnabled ? _customerService.GetCustomerByUsername(model.Username) : _customerService.GetCustomerByEmail(model.Email); //activity log _customerActivityService.InsertActivity(customer, "PublicStore.1C.ExportOrders.Login", "1C Exporting orders begin."); var orders = _exportManager.ExportOrdersToOneC(); response.Total = orders.Item1; if (orders.Item2.Count() > 0) { response.Data = orders.Item2; } else { response.Success = false; response.Message = "Does not have any order."; } //activiti log _customerActivityService.InsertActivity(customer, "PublicStore.1C.ExportOrders.LogOut", "1C Exporting orders end."); } return(Json(response)); }