public ActionResult DeleteEduProduct(int?Id) { var result = new EduProductBO().DeleteEduProduct(new EduProduct { Id = Id.Value }); var list = new EduProductBO().GetList(); return(View("EduProductList", list.AsEnumerable())); }
public RedirectToRouteResult SaveEduProduct(EduProduct eduProduct) { eduProduct.ProductDescription = eduProduct.ProductName; eduProduct.CreatedBy = USER_ID; eduProduct.CreatedOn = UTILITY.SINGAPORETIME; eduProduct.ModifiedBy = USER_ID; eduProduct.ModifiedOn = UTILITY.SINGAPORETIME; if (!IsEduProductExists(eduProduct.ProductName)) { var result = new EduProductBO().SaveEduProduct(eduProduct); } return(RedirectToAction("EduProductList")); }
public PartialViewResult Course(int?Id) { ViewData["ProductData"] = new EduProductBO().GetList(); ViewData["CountryData"] = new BranchBO().GetList(); if (!Id.HasValue) { ViewBag.Title = "New Course"; return(PartialView(new Course { Id = -1, IsActive = true })); } else { ViewBag.Title = "Update Course"; return(PartialView(new CourseBO().GetCourse(new Course { Id = Id.Value }))); } }
private List <Revenue> GetList(short country, int year) { List <Revenue> RevenueList = dbContext.Revenues.Where(x => x.IsActive == true && x.Country == country && x.Year == year).ToList(); var productList = new EduProductBO().GetList().Where(x => x.IsActive == true).ToList(); ViewData["CountryData"] = new BranchBO().GetList().Where(x => x.IsActive == true).ToList(); ViewData["CurrencyList"] = new LookupBO().GetList().Where(x => x.LookupCategory == "Currency").ToList(); var countryrow = ((List <Branch>)ViewData["CountryData"]).Where(x => x.IsActive == true && x.BranchID == country).FirstOrDefault(); var currencyCode = ((List <Lookup>)ViewData["CurrencyList"]).Where(x => x.LookupCategory == "Currency" && x.MappingCode == countryrow.BranchCode).FirstOrDefault(); foreach (EduProduct ep in productList) { if (RevenueList.Where(x => x.Product == ep.Id).Count() == 0) { RevenueList.Add(new Revenue() { Product = ep.Id, ProductName = ep.ProductName, RevenueId = -1, CurrencyCode = currencyCode == null ? "" : currencyCode.LookupCode }); } } return(RevenueList); }
public ViewResult EduProductList() { var list = new EduProductBO().GetList(); return(View("EduProductList", list.AsEnumerable())); }