// GET: Categories/Delete/5 public ActionResult Delete(int id) { try { using (ContextBll ctx = new ContextBll()) { ctx.DeleteCategories(id); } } catch (Exception ex) { ViewBag.Exception = ex; return(View("Error")); } return(RedirectToAction("Index")); }
public ActionResult Create(ProductsCategoriesmolels collection) { try { using (ContextBll ctx = new ContextBll()) { int catid = ctx.CreateCategories(collection.CategoryID, collection.Categorie); ctx.CreateProduct(collection.ProductsID, catid, collection.SellerID, collection.Name, collection.Descrption, collection.ReservePrice, collection.WinningofferID, collection.Comments, collection.Photos, collection.Categorie, "sellerName", "sellerName"); } // TODO: Add insert logic return(RedirectToAction("Index", "Products")); } catch (Exception EX) { return(View()); } }
public ActionResult Delete(int id, BusinessLogicLayer.CategorieBLL collection) { try { using (ContextBll ctx = new ContextBll()) { ctx.DeleteCategories(id); } return(RedirectToAction("Index")); } catch (Exception Ex) { ViewBag.Exception = Ex; return(View("Error")); } }
List <SelectListItem> GetBuyersItems() { List <SelectListItem> ProposedReturnValue = new List <SelectListItem>(); using (ContextBll ctx = new ContextBll()) { List <UserBLL> users = ctx.GetUsers(0, 25); foreach (UserBLL r in users) { SelectListItem i = new SelectListItem(); i.Value = r.UserID.ToString(); i.Text = r.EmailAdderess; ProposedReturnValue.Add(i); } } return(ProposedReturnValue); }
List <SelectListItem> GetProductsItems() { List <SelectListItem> ProposedReturnValue = new List <SelectListItem>(); using (ContextBll ctx = new ContextBll()) { List <OfferBLL> roles = ctx.GetOffer(0, 25); foreach (OfferBLL r in roles) { SelectListItem i = new SelectListItem(); i.Value = r.ProductID.ToString(); i.Text = r.ProductName; ProposedReturnValue.Add(i); } } return(ProposedReturnValue); }
public ActionResult Edit(int id, BusinessLogicLayer.ProductBLL collection) { try { // TODO: Add insert logic here using (ContextBll ctx = new ContextBll()) { ctx.UpdateProduct(collection); } return(RedirectToAction("Index")); } catch (Exception Ex) { ViewBag.Exception = Ex; return(View("Error")); } }
List <SelectListItem> GetSellerItems() { List <SelectListItem> ProposedReturnValue = new List <SelectListItem>(); using (ContextBll ctx = new ContextBll()) { List <UserBLL> roles = ctx.GetUsers(0, 25); foreach (UserBLL r in roles) { SelectListItem i = new SelectListItem(); i.Value = r.UserID.ToString(); i.Text = r.Name; ProposedReturnValue.Add(i); } } return(ProposedReturnValue); }
public ActionResult Create(BusinessLogicLayer.CategorieBLL collection) { try { // TODO: Add insert logic here using (ContextBll ctx = new ContextBll()) { ctx.CreateCategories(collection); } return(RedirectToAction("Index")); } catch (Exception Ex) { ViewBag.Exception = Ex; return(View("Error")); } }
public ActionResult Delete(int id, BusinessLogicLayer.UserBLL collection) { try { // TODO: Add insert logic here using (ContextBll ctx = new ContextBll()) { ctx.DeleteUser(id); } return(RedirectToAction("Index")); } catch (Exception Ex) { ViewBag.Exception = Ex; return(View("Error")); } }
List <SelectListItem> GetRoleItems() { List <SelectListItem> ProposedReturnValue = new List <SelectListItem>(); using (ContextBll ctx = new ContextBll()) { List <RoleBLL> roles = ctx.GetRoles(0, 25); foreach (RoleBLL r in roles) { SelectListItem i = new SelectListItem(); i.Value = r.RoleID.ToString(); i.Text = r.Role; ProposedReturnValue.Add(i); } } return(ProposedReturnValue); }
public ActionResult Page(int PageNumber, int PageSize) { ViewBag.PageNumber = PageNumber; ViewBag.PageSize = PageSize; List <CategorieBLL> Model = new List <CategorieBLL>(); try { using (ContextBll ctx = new ContextBll()) { ViewBag.TotalCount = ctx.ObtainCategoriCount(); Model = ctx.GetCategorie(PageNumber * PageSize, PageSize); } return(View("Index", Model)); } catch (Exception ex) { ViewBag.Exception = ex; return(View("Error")); } }
// GET: Role/Edit/5 public ActionResult Edit(int id) { RoleBLL Role; try { using (ContextBll ctx = new ContextBll()) { Role = ctx.FindRoleByID(id); if (null == Role) { return(View("ItemNotFound")); // BKW make this view } } } catch (Exception ex) { ViewBag.Exception = ex; return(View("Error")); } return(View(Role)); }
public ActionResult Details(int id) { CategorieBLL categorie; try { using (ContextBll ctx = new ContextBll()) { categorie = ctx.FindCategorieByID(id); if (null == categorie) { return(View("ItemNotFound")); } } } catch (Exception ex) { ViewBag.Exception = ex; return(View("Error")); } return(View(categorie)); }
// GET: Offer/Details/5 public ActionResult Details(int id) { OfferBLL Offer; try { using (ContextBll ctx = new ContextBll()) { Offer = ctx.FindOfferByID(id); if (null == Offer) { return(View("ItemNotFound")); } } } catch (Exception ex) { ViewBag.Exception = ex; return(View("Error")); } return(View(Offer)); }
// GET: Role/Details/5 public ActionResult Details(int id) { UserBLL User; try { using (ContextBll ctx = new ContextBll()) { User = ctx.FindUserByID(id); if (null == User) { return(View("ItemNotFound")); // BKW make this view } } } catch (Exception ex) { ViewBag.Exception = ex; return(View("Error")); } return(View(User)); }
// GET: Products/Details/5 public ActionResult Details(int id) { ProductBLL product; try { using (ContextBll ctx = new ContextBll()) { product = ctx.FindProductByID(id); if (null == product) { return(View("ItemNotFound")); } } } catch (Exception ex) { ViewBag.Exception = ex; return(View("Error")); } return(View(product)); }
// GET: Products/Edit/5 public ActionResult Edit(int id) { ProductBLL Product; try { using (ContextBll ctx = new ContextBll()) { Product = ctx.FindProductByID(id); if (null == Product) { return(View("ItemNotFound")); } } } catch (Exception ex) { ViewBag.Exception = ex; return(View("Error")); } ViewBag.Product = GetCategorieItems(); return(View(Product)); }
public ActionResult Purchase(int id) { ProductBLL Product; try { using (ContextBll ctx = new ContextBll()) { Product = ctx.FindProductByID(id); if (null == Product) { return(View("ItemNotFound")); } } } catch (Exception ex) { ViewBag.Exception = ex; return(View("Error")); } return(View(new PurchaseModel(Product))); }
// GET: Offer/Edit/5 public ActionResult Edit(int id) { OfferBLL Offer; try { using (ContextBll ctx = new ContextBll()) { Offer = ctx.FindOfferByID(id); if (null == Offer) { return(View("ItemNotFound")); } } } catch (Exception ex) { ViewBag.Exception = ex; return(View("Error")); } ViewBag.Offer = GetProductsItems(); ViewBag.Offer = GetBuyersItems(); return(View(Offer)); }