コード例 #1
0
 public void CreateOrEdit(int countryId, int month, int year, decimal plannedValue, decimal soldValue)
 {
     var monthlyReport = new MonthlyReport();
     monthlyReport.CountryId = countryId;
     monthlyReport.Month = month;
     monthlyReport.Year = year;
     monthlyReport.PlannedValue = plannedValue;
     monthlyReport.SoldValue = soldValue;
     _monthlyReportHandler.CreateOrEdit(monthlyReport);
 }
コード例 #2
0
 public void CreateOrEdit(MonthlyReport monthlyReport)
 {
     var monthlyReportToEdit = GetMonthlyReport(monthlyReport.CountryId, monthlyReport.Month, monthlyReport.Year);
     if (monthlyReportToEdit == null)
     {
         CreateMonthlyReportItem(monthlyReport);
     }
     else
     {
         monthlyReportToEdit.PlannedValue = monthlyReport.PlannedValue;
         monthlyReportToEdit.SoldValue = monthlyReport.SoldValue;
         _db.SaveChanges();
     }
 }
コード例 #3
0
 public MonthlyReportViewModel GetMonthlyReport(int countryId, int month, int year)
 {
     var monthlyReport = _monthlyReportHandler.GetMonthlyReport(countryId, month, year);
     if (monthlyReport == null) monthlyReport = new MonthlyReport();
     monthlyReport.CountryId = countryId;
     monthlyReport.Month = month;
     monthlyReport.Year = year;
     var monthlyBrandReportViewModel = new MonthlyReportViewModel()
     {
         MonthlyReport = monthlyReport,
         Month = month,
         Year = year,
         CountryId = countryId,
         Months = _dropDownHelper.GetMonthsListForDropDown(),
         Years = _dropDownHelper.GetYearsListForDropDown(),
         Countries = _dropDownHelper.GetCountriesListForDropDown(_countryManager.GetAllCountries())
     };
     return monthlyBrandReportViewModel;
 }
コード例 #4
0
 private void CreateMonthlyReportItem(MonthlyReport monthlyReport)
 {
     _db.MonthlyReports.Add(monthlyReport);
     _db.SaveChanges();
 }
コード例 #5
0
 public void CreateOrEdit(MonthlyReport monthlyReport)
 {
     _monthlyReportRepository.CreateOrEdit(monthlyReport);
 }