public ActionResult AddProduct() { if (Session["UserID"] == null) { return(RedirectToAction("AdminLogin", "AdminLogin")); } else { ProductViewModel pwm = new ProductViewModel(); List <SelectListItem> CatList = new List <SelectListItem>(); List <SelectListItem> BrandList = new List <SelectListItem>(); foreach (Category item in cr.List().ProcessResult) { CatList.Add(new SelectListItem { Value = item.CategoryId.ToString(), Text = item.CategoryName }); } foreach (Brand item in br.List().ProcessResult) { BrandList.Add(new SelectListItem { Value = item.BrandId.ToString(), Text = item.BrandName }); } pwm.BrandList = BrandList; pwm.CategoryList = CatList; pwm.Product = null; return(View(pwm)); } }
public ActionResult List(string mesaj) { //ViewBag.CurrentUser = User.Identity.Name; result.resultList = cr.List(); ViewBag.Mesaj = mesaj; return(View(result.resultList.ProcessResult)); }
public ActionResult List(string mesaj) { if (Session["UserID"] == null) { return(RedirectToAction("AdminLogin", "AdminLogin")); } else { result.resultList = cr.List(); ViewBag.Mesaj = mesaj; return(View(result.resultList.ProcessResult)); } }
public ActionResult AddProduct() { ProductViewModel pwm = new ProductViewModel(); List <SelectListItem> CatList = new List <SelectListItem>(); List <SelectListItem> BrandList = new List <SelectListItem>(); foreach (Category item in cr.List().ProcessResult) { CatList.Add(new SelectListItem { Value = item.CategoryId.ToString(), Text = item.CategoryName }); } foreach (Brand item in br.List().ProcessResult) { BrandList.Add(new SelectListItem { Value = item.BrandId.ToString(), Text = item.BrandName }); } pwm.BrandList = BrandList; pwm.CategoryList = CatList; pwm.Product = null; return(View(pwm)); }
// GET: Admin/Category public ActionResult List(string message, Guid?id) { result.resultList = cr.List(); if (message != null) { ViewBag.Message = String.Format("{0} nolu kaydin guncelleme islemi {1}", id, message); } else { ViewBag.Message = ""; } return(View(result.resultList.ProccessResult)); }
//edit ve add sayfasında product a göre combobox üzerinde brand ve category gösterimi public void BrandCatList(List <SelectListItem> cat, List <SelectListItem> brand, Guid c, int b) { foreach (Category item in cr.List().ProccessResult) { cat.Add(new SelectListItem { Value = item.CategoryID.ToString(), Text = item.CategoryName, Selected = (item.CategoryID == c)?true:false, }); } foreach (Brand item in br.List().ProccessResult) { brand.Add(new SelectListItem { Value = item.BrandID.ToString(), Text = item.BrandName, Selected = (item.BrandID == b)?true:false, }); } }
public ActionResult List(string mesaj) { result.resultList = cr.List(); ViewBag.Mesaj = mesaj; return(View(result.resultList.ProcessResult)); }
// GET: Admin/Category public ActionResult List() { return(View(cr.List().ProccessResult)); }