Exemple #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));
        }
        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));
        }
Exemple #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));
        }
        public CategoryDTO Add(CategoryDTO x)
        {
            var obj = x.toModel();

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