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); }
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(); } }
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; }
private void CreateMonthlyReportItem(MonthlyReport monthlyReport) { _db.MonthlyReports.Add(monthlyReport); _db.SaveChanges(); }
public void CreateOrEdit(MonthlyReport monthlyReport) { _monthlyReportRepository.CreateOrEdit(monthlyReport); }