Пример #1
0
        public News_TypeDTO Add(News_TypeDTO x)
        {
            var obj = x.toModel();

            try
            {
                db.News_Type.Add(obj);
                db.SaveChanges();
            }
            catch
            {
                return(null);
            }
            return(new News_TypeDTO(obj));
        }
Пример #2
0
        public ProducerDTO Add(ProducerDTO x)
        {
            var obj = x.toModel();

            try
            {
                db.Producers.Add(obj);
                db.SaveChanges();
            }
            catch
            {
                return(null);
            }
            return(new ProducerDTO(obj));
        }
        public Bill_DetailsDTO Add(Bill_DetailsDTO x)
        {
            var obj = x.toModel();

            try
            {
                db.Bill_Details.Add(obj);
                db.SaveChanges();
            }
            catch
            {
                return(null);
            }
            return(new Bill_DetailsDTO(obj));
        }
Пример #4
0
        public AccountDTO Add(AccountDTO x)
        {
            var obj = x.toModel();

            try
            {
                db.Accounts.Add(obj);
                db.SaveChanges();
            }
            catch
            {
                return(null);
            }
            return(new AccountDTO(obj));
        }
Пример #5
0
        public CategoryDTO Add(CategoryDTO x)
        {
            var obj = x.toModel();

            try
            {
                db.Categories.Add(obj);
                db.SaveChanges();
            }
            catch
            {
                return(null);
            }
            return(new CategoryDTO(obj));
        }