Exemplo n.º 1
0
        /// <summary>
        ///To insert WebShop into the DB
        /// </summary>
        public void Insert(WebShopDTO webShop)
        {
            if (webShop == null)
            {
                return;
            }
            WebShop wShop = Mapper.Map <WebShop>(webShop);

            wShop.Status = true;
            uOW.WebShopRepo.Insert(wShop);
            uOW.Save();
        }
Exemplo n.º 2
0
        /// <summary>
        /// To delete one WebShop in the DB
        /// </summary>
        public void Delete(WebShopDTO webShop)
        {
            if (webShop == null)
            {
                return;
            }
            WebShop wShop = uOW.WebShopRepo.GetByID(webShop.Id);

            if (wShop == null)
            {
                return;
            }
            wShop.Status = false;
            uOW.Save();
        }
Exemplo n.º 3
0
        /// <summary>
        /// To update one WebShop in the DB
        /// </summary>
        public void Update(WebShopDTO webShop)
        {
            if (webShop == null)
            {
                return;
            }
            WebShop wShop = uOW.WebShopRepo.GetByID(webShop.Id);

            if (wShop == null)
            {
                return;
            }

            wShop.Name = webShop.Name;
            //if LogoPath null it may be lead to data loss
            wShop.LogoPath = webShop.LogoPath ?? wShop.LogoPath;
            wShop.Path     = webShop.Path;
            uOW.Save();
        }
Exemplo n.º 4
0
        /// <summary>
        ///To get one WebShop from DB
        /// </summary>
        public WebShopDTO GetById(int id)
        {
            WebShop webShop = uOW.WebShopRepo.GetByID(id);

            return(webShop != null?Mapper.Map <WebShopDTO>(webShop) : null);
        }