public ActionResult DistributionChannels() { pbs_basic_DistributionChannels pbsBasicDistributionChannels = new pbs_basic_DistributionChannels(); pbs_basic_DistributionChannelsService pbsBasicDistributionChannelsService = new pbs_basic_DistributionChannelsService(); ResultInfo <pbs_basic_DistributionChannels> resultinfo = pbsBasicDistributionChannelsService.GetDCModelById(1); if (resultinfo.Result && resultinfo.Data != null) { pbsBasicDistributionChannels = resultinfo.Data; } ViewData["DistributionChannels"] = pbsBasicDistributionChannels; return(View()); }
// GET: SaleReport public ActionResult SaleMemberReportList() { pbs_basic_DistributionChannels pbsBasicDistributionChannels = new pbs_basic_DistributionChannels(); pbs_basic_DistributionChannelsService pbsBasicDistributionChannelsService = new pbs_basic_DistributionChannelsService(); ResultInfo <pbs_basic_DistributionChannels> resultinfoDC = pbsBasicDistributionChannelsService.GetDCModelById(1); if (resultinfoDC.Result && resultinfoDC.Data != null) { pbsBasicDistributionChannels = resultinfoDC.Data; } List <SaleMemberReportSQL> saleMemberReportSqlList = new List <SaleMemberReportSQL>(); pbs_basic_OrderService pbsBasicOrderService = new pbs_basic_OrderService(); ResultInfo <List <SaleMemberReportSQL> > resultinfoSQL = pbsBasicOrderService.GetSaleMemberReportSQLList(); if (resultinfoSQL.Result && resultinfoSQL.Data != null) { saleMemberReportSqlList = resultinfoSQL.Data; } List <SaleMemberReport> saleMemberReportList = new List <SaleMemberReport>(); if (saleMemberReportSqlList != null && saleMemberReportSqlList.Count > 0) { foreach (var item in saleMemberReportSqlList) { SaleMemberReport sr = new SaleMemberReport(); sr.GoodsName = item.GoodsName; sr.OrderPrice = item.SellingPrice; sr.OrderCost = item.GoodsCost; sr.ActivityGrossProfit = item.SellingPrice - item.GoodsCost; sr.DC1 = sr.ActivityGrossProfit * pbsBasicDistributionChannels.DC1 * 0.01m; sr.DC2 = sr.ActivityGrossProfit * pbsBasicDistributionChannels.DC2 * 0.01m; sr.DC3 = sr.ActivityGrossProfit * pbsBasicDistributionChannels.DC3 * 0.01m; sr.SurplusProfit = sr.ActivityGrossProfit - sr.ActivityGrossProfit * (pbsBasicDistributionChannels.DC1 + pbsBasicDistributionChannels.DC2 + pbsBasicDistributionChannels.DC3) * 0.01m; sr.PayCount = item.OrderCount; sr.ResponsiblePersonProfit = item.ResponsiblePersonProfit; sr.FinalGrossProfit = sr.SurplusProfit * sr.PayCount - sr.ResponsiblePersonProfit; saleMemberReportList.Add(sr); } } ViewData["SaleMemberReportList"] = saleMemberReportList; return(View()); }