public DashboardVo GetUserDashboard(UserVo userVo, string KeyName) { DashboardVo dashboardVo = null; DashboardDao dashboardDao = new DashboardDao(); try { dashboardVo = dashboardDao.GetUserDashboard(userVo, KeyName); } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "DashboardBo.cs:GetUserDashboard()"); object[] objects = new object[2]; objects[0] = userVo; objects[1] = KeyName; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } return(dashboardVo); }
public bool UpdateUserDashboard(DashboardVo dashboardVo) { bool Result = false; DashboardDao dashboardDao = new DashboardDao(); try { Result = dashboardDao.UpdateUserDashboard(dashboardVo); } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "DashboardBo.cs:UpdateUserDashboard()"); object[] objects = new object[2]; objects[0] = dashboardVo.KeyName; objects[1] = dashboardVo.UserId; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } return(Result); }
public object Do_GetHomePageData(BaseApi baseApi) { GetHomePageParam getHomePageParam = JsonConvert.DeserializeObject <GetHomePageParam>(baseApi.param.ToString()); if (getHomePageParam == null) { throw new ApiException(CodeMessage.InvalidParam, "InvalidParam"); } //HomePageData homePageData = Utils.GetCache<HomePageData>(getHomePageParam); //if (homePageData == null) //{ DashboardDao dashboardDao = new DashboardDao(); string shopId = getHomePageParam.shopId; PartSalesHP partSalesHP = dashboardDao.HomePageGetPartSalesHP(shopId); SalesTrendDataHP salesTrendData = dashboardDao.HomePageGetSalesTrendData(shopId); SalesShareDataHP SalesShareData = dashboardDao.HomePageGetSalesShareData(shopId); HomePageData homePageData = new HomePageData(); homePageData.partSales = partSalesHP; homePageData.salesTrendData = salesTrendData; homePageData.SalesShareData = SalesShareData; // Utils.SetCache(homePageData, 0, 1, 0); //} return(homePageData); }
public CampaignBusiness(MardisContext mardisContext) : base(mardisContext) { _campaignDao = new CampaignDao(mardisContext); _sequenceBusiness = new SequenceBusiness(mardisContext); _customerDao = new CustomerDao(mardisContext); _taskCampaignDao = new TaskCampaignDao(mardisContext); _statusTaskDao = new StatusTaskDao(mardisContext); _campaignServicesDao = new CampaignServicesDao(mardisContext); _serviceDao = new ServiceDao(mardisContext); _branchDao = new BranchDao(mardisContext); _userCanpaignDao = new UserCanpaignDao(mardisContext); _dashboardDao = new DashboardDao(mardisContext); _personDao = new PersonDao(mardisContext); }
public IActionResult GetCondominiums([FromServices] DashboardDao dashboardDao) { try { var dashboard = dashboardDao.DashboardInfo(); return(IsAValidOperation() ? RequestResponse(HttpStatusCode.OK, result: dashboard) : RequestResponse(HttpStatusCode.NotFound, "kipercondominio/api/v1/dashboard", isError: true)); } catch (Exception ex) { var error = JsonConvert.SerializeObject(ex); _logger.LogError(error); return(RequestResponse(HttpStatusCode.BadRequest, isError: true, result: "Ocorreu um erro ao carregar o dashboard")); } }
public object Do_GetTradeData(BaseApi baseApi) { GetTradeParam getTradeParam = JsonConvert.DeserializeObject <GetTradeParam>(baseApi.param.ToString()); if (getTradeParam == null) { throw new ApiException(CodeMessage.InvalidParam, "InvalidParam"); } //TradeData tradeData = Utils.GetCache<TradeData>(getTradeParam); //if (tradeData == null) //{ DashboardDao dashboardDao = new DashboardDao(); string shopId = getTradeParam.shopId; Shops shops = dashboardDao.TradeGetShops(); PartSales partSales = new PartSales { partSalesDay = dashboardDao.TradeGetPartSalesDay(shopId), monthGroups = dashboardDao.TradeGetMonthGroups(shopId) }; SalesTrendDataHP salesTrendData = dashboardDao.TradeGetSalesTrendData(shopId); TradeData tradeData = new TradeData(); tradeData.shops = shops; tradeData.partSales = partSales; tradeData.salesTrendData = salesTrendData; // Utils.SetCache(tradeData, 0, 1, 0); //} return(tradeData); }
public DashboardRepositorio() { this._validation = new DashboardValidation(); this._dao = new DashboardDao(); }
public ActionResult GetGraficoVendas(string inicio, string fim) { Dashboard dash = new DashboardDao().GetDashboardVendas(inicio, fim); return(PartialView("PvScriptGraficoVendas", dash)); }
public object Do_GetOfflineShopData(BaseApi baseApi) { GetOfflineShopDataParam getOfflineShopDataParam = JsonConvert.DeserializeObject <GetOfflineShopDataParam>(baseApi.param.ToString()); if (getOfflineShopDataParam == null) { throw new ApiException(CodeMessage.InvalidParam, "InvalidParam"); } //OfflineData offlineData = Utils.GetCache<OfflineData>(getOfflineShopDataParam); //if (offlineData == null) //{ DashboardDao dashboardDao = new DashboardDao(); Shops shops = dashboardDao.OfflineGetShops(); string shopId = getOfflineShopDataParam.shopId; PartSales partSales = new PartSales { marketingRate = dashboardDao.OfflineGetMarketingRate(shopId), dailyAverage = dashboardDao.OfflineGetDailyAverage(shopId), partSalesDay = dashboardDao.OfflineGetPartSalesDay(shopId), monthGroups = dashboardDao.OfflineGetMonthGroups(shopId) }; Proportion proportion = new Proportion { proportionLegend = dashboardDao.OfflineGetProportionLegend(), proportionValues = dashboardDao.OfflineGetProportionValues() }; SalesTrendData salesTrendData = new SalesTrendData { list = dashboardDao.OfflineGetSalesTrendList(shopId) }; OrderTrendData orderTrendData = new OrderTrendData { list = dashboardDao.OfflineGetOrderTrendList(shopId) }; BestSellerGoodsData bestSellerGoodsData = new BestSellerGoodsData { list = dashboardDao.OfflineGetBestSellerGoodsList(shopId) }; LowSellerGoodsData lowSellerGoodsData = new LowSellerGoodsData { list = dashboardDao.OfflineGetLowSellerGoodsList(shopId) }; AccountsReceivableTRateData accountsReceivableTRateData = new AccountsReceivableTRateData { list = dashboardDao.OnlineGetAccountsReceivableTRateList(shopId) }; MarketingRateData marketingRateData = new MarketingRateData { list = dashboardDao.OfflineGetMarketingDayList(shopId) }; StockTRateData stockTRateData = new StockTRateData { list = dashboardDao.OfflineGetStockTMonthList(shopId) }; OfflineData offlineData = new OfflineData(); offlineData.accountsReceivableTRateData = accountsReceivableTRateData; offlineData.bestSellerGoodsData = bestSellerGoodsData; offlineData.lowSellerGoodsData = lowSellerGoodsData; offlineData.orderTrendData = orderTrendData; offlineData.partSales = partSales; offlineData.proportion = proportion; offlineData.salesTrendData = salesTrendData; offlineData.shops = shops; offlineData.marketingRateData = marketingRateData; offlineData.stockTRateData = stockTRateData; offlineData.Unique = getOfflineShopDataParam.GetUnique(); // Utils.SetCache(offlineData, 0, 1, 0); //} return(offlineData); }
public object Do_GetOnlineShopData(BaseApi baseApi) { GetOnlineShopDataParam getOnlineShopDataParam = JsonConvert.DeserializeObject <GetOnlineShopDataParam>(baseApi.param.ToString()); if (getOnlineShopDataParam == null) { throw new ApiException(CodeMessage.InvalidParam, "InvalidParam"); } OnlineData onlineData = Utils.GetCache <OnlineData>(getOnlineShopDataParam); if (onlineData == null) { string shopId = getOnlineShopDataParam.shopId; DashboardDao dashboardDao = new DashboardDao(); Shops shops = dashboardDao.OnlineGetShops(); PartSales partSales = new PartSales { dailyAverage = dashboardDao.OnlineGetDailyAverage(shopId), partSalesDay = dashboardDao.OnlineGetPartSalesDay(shopId), monthGroups = dashboardDao.OnlineGetMonthGroups(shopId) }; Proportion proportion = new Proportion { proportionLegend = dashboardDao.OnlineGetProportionLegend(), proportionValues = dashboardDao.OnlineGetProportionValues() }; SalesTrendData salesTrendData = new SalesTrendData { list = dashboardDao.OnlineGetSalesTrendList(shopId) }; OrderTrendData orderTrendData = new OrderTrendData { list = dashboardDao.OnlineGetOrderTrendList(shopId) }; BestSellerGoodsData bestSellerGoodsData = new BestSellerGoodsData { list = dashboardDao.OnlineGetBestSellerGoodsList(shopId) }; LowSellerGoodsData lowSellerGoodsData = new LowSellerGoodsData { list = dashboardDao.OnlineGetLowSellerGoodsList(shopId) }; AccountsReceivableTRateData accountsReceivableTRateData = new AccountsReceivableTRateData { list = dashboardDao.OnlineGetAccountsReceivableTRateList(shopId) }; onlineData = new OnlineData { accountsReceivableTRateData = accountsReceivableTRateData, bestSellerGoodsData = bestSellerGoodsData, lowSellerGoodsData = lowSellerGoodsData, orderTrendData = orderTrendData, partSales = partSales, proportion = proportion, salesTrendData = salesTrendData, shops = shops }; onlineData.Unique = getOnlineShopDataParam.GetUnique(); Utils.SetCache(onlineData, 0, 1, 0); } return(onlineData); }