示例#1
0
        public int CreateCategories(CategorieBLL categorie)
        {
            int proposedReturnValue = -1;

            proposedReturnValue = _context.CreateCategorie(categorie.CategorieID, categorie.Categorie);
            return(proposedReturnValue);
        }
示例#2
0
        //Categorie
        public CategorieBLL FindCategorieByID(int categorieID)
        {
            CategorieBLL ProposedReturnValue = null;
            CategorieDal DataLayerObject     = _context.FindCategorieByID(categorieID);

            if (null != DataLayerObject)
            {
                ProposedReturnValue = new CategorieBLL(DataLayerObject);
            }
            return(ProposedReturnValue);
        }
示例#3
0
        public List <CategorieBLL> GetCategorie(int skip, int take)
        {
            List <CategorieBLL> ProposedReturnValue    = new List <CategorieBLL>();
            List <CategorieDal> ListOfDataLayerObjects = _context.GetCategories(skip, take);

            foreach (CategorieDal categorie in ListOfDataLayerObjects)
            {
                CategorieBLL BusinessObject = new  CategorieBLL(categorie);
                ProposedReturnValue.Add(BusinessObject);
            }
            return(ProposedReturnValue);
        }
示例#4
0
        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"));
            }
        }
示例#5
0
        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"));
            }
        }
示例#6
0
 public void DeleteCategirie(CategorieBLL categorie)
 {
     _context.DeleteCategorie(categorie.CategorieID);
 }
示例#7
0
 public void UpdateCategories(CategorieBLL categorie)
 {
     _context.UpdateCategori(categorie.CategorieID, categorie.Categorie);
 }