public ActionResult SearchAllProduct() { TrSearchViewModel vm = new TrSearchViewModel(); if (Session["Language"] == null) { Session["Language"] = ConfigurationManager.AppSettings["Language"]; } string language = Session["Language"].ToString(); vm.Products = ProductBL.FindAllProduct(language); return(PartialView("_PartialTransactionSearch", vm)); }
private ActionResult ProductByCat(string argument, TrSearchViewModel vmodel, string language) { //search if cat have child cat var children = SearchBL.FindCatsChildList(argument, language); if (children.Count() == 0) { vmodel.Products = SearchBL.FindProductListByIdCat(argument, language); } else { vmodel.CatsChild = children; } return(PartialView("_PartialTransactionSearch", vmodel)); }
public ActionResult SearchProduct(string product) { TrSearchViewModel vm = new TrSearchViewModel(); try { if (ModelState.IsValid) { if (Session["Language"] == null) { Session["Language"] = ConfigurationManager.AppSettings["Language"]; } string language = Session["Language"].ToString(); if (int.TryParse(product, out int codeP)) { vm.Products = ProductBL.FindAllProductByCode(product, language); } else { vm.Products = ProductBL.FindAllProductByName(product, language); } } return(PartialView("_PartialTransactionSearch", vm)); } catch (InvalidOperationException ex) { //to do insert to log file var e1 = ex.GetBaseException(); // --> log var e4 = ex.Message; // --> log var e5 = ex.Source; // --> log var e8 = ex.GetType(); // --> log var e9 = ex.GetType().Name; // --> log ViewBag.ErrorSearch = "N° de produit invalide"; return(PartialView("_PartialTransactionSearch", vm)); } catch (Exception ex) { //to do insert to log file var e1 = ex.GetBaseException(); // --> log var e4 = ex.Message; // --> log var e5 = ex.Source; // --> log var e8 = ex.GetType(); // --> log var e9 = ex.GetType().Name; // --> log return(View("Error")); } }
public ActionResult SearchProduct(string product) { TrSearchViewModel vm = new TrSearchViewModel(); try { if (ModelState.IsValid) { if (int.TryParse(product, out int codeP)) { vm.Products = ProductBL.FindAllProductByCode(product); } else { //to do //vm.Products = TransactionBL.FindAllProductByName(product); } } return(PartialView("_PartialTransactionSearch", vm)); } catch (InvalidOperationException ex) { //to do insert to log file var e1 = ex.GetBaseException(); // --> log var e4 = ex.Message; // --> log var e5 = ex.Source; // --> log var e8 = ex.GetType(); // --> log var e9 = ex.GetType().Name; // --> log ViewBag.ErrorSearch = "N° de produit invalide"; return(PartialView("_PartialTransactionSearch", vm)); } catch (Exception ex) { //to do insert to log file var e1 = ex.GetBaseException(); // --> log var e4 = ex.Message; // --> log var e5 = ex.Source; // --> log var e8 = ex.GetType(); // --> log var e9 = ex.GetType().Name; // --> log return(View("Error")); } }
public ActionResult SearchBy(string method) { try { TrSearchViewModel vm = new TrSearchViewModel(); if (Session["Language"] == null) { Session["Language"] = ConfigurationManager.AppSettings["Language"]; } string language = Session["Language"].ToString(); string meth = method.ToLower(); switch (meth) { case "brand": return(SearchByBrand(vm)); case "hero": return(SearchByHero(vm)); case "age": return(SearchByAge(vm)); case "cat": return(SearchByCat(vm, language)); default: ViewBag.ticket = false; return(PartialView("_PartialTransactionSearch", vm)); } } catch (Exception ex) { //to do insert to log file var e1 = ex.GetBaseException(); // --> log var e4 = ex.Message; // --> log var e5 = ex.Source; // --> log var e8 = ex.GetType(); // --> log var e9 = ex.GetType().Name; // --> log return(View("Error")); } }
public ActionResult ProductBy(string method, string argument, TrSearchViewModel vmodel) { try { string meth = method.ToLower(); switch (meth) { case "brand": return(ProductByBrand(argument, vmodel)); case "hero": return(ProductByHero(argument, vmodel)); case "age": return(ProductByAge(argument, vmodel)); case "cat": return(ProductByCat(argument, vmodel)); default: ViewBag.ticket = false; return(PartialView("_PartialTransactionSearch", vmodel)); } } catch (Exception ex) { //to do insert to log file var e1 = ex.GetBaseException(); // --> log var e4 = ex.Message; // --> log var e5 = ex.Source; // --> log var e8 = ex.GetType(); // --> log var e9 = ex.GetType().Name; // --> log return(View("Error")); } }
private ActionResult ProductByAge(string argument, TrSearchViewModel vmodel, string language) { vmodel.Products = SearchBL.FindProductListByIdAge(argument, language); return(PartialView("_PartialTransactionSearch", vmodel)); }
private ActionResult SearchByBrand(TrSearchViewModel vm) { vm.Brands = SearchBL.FindBrandsList(); return(PartialView("_PartialTransactionSearch", vm)); }
private ActionResult SearchByHero(TrSearchViewModel vm) { vm.Heros = SearchBL.FindHerosList(); return(PartialView("_PartialTransactionSearch", vm)); }
private ActionResult SearchByAge(TrSearchViewModel vm) { vm.Ages = SearchBL.FindAgesList(); return(PartialView("_PartialTransactionSearch", vm)); }
private ActionResult SearchByCat(TrSearchViewModel vm, string language) { vm.Cats = SearchBL.FindCatsParentList(language); return(PartialView("_PartialTransactionSearch", vm)); }
private ActionResult ProductByCat(string argument, TrSearchViewModel vmodel) { vmodel.Products = SearchBL.FindProductListByIdCat(argument); return(PartialView("_PartialTransactionSearch", vmodel)); }