Esempio n. 1
0
        public List <Customer> GetAll()
        {
            try
            {
                getDatalayer = new LiteDbCustomerDataMapper();
                var data = getDatalayer.GetAll();

                return(data);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message.ToString());
            }
        }
Esempio n. 2
0
        public bool Update(Customer item)
        {
            try
            {
                getDatalayer = new LiteDbCustomerDataMapper();
                if (item != null && item.Id > 0)
                {
                    getDatalayer.Update(item);
                }

                return(true);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message.ToString());
            }
        }
Esempio n. 3
0
        public bool Insert(Customer item)
        {
            try
            {
                getDatalayer = new LiteDbCustomerDataMapper();
                if (item != null)
                {
                    getDatalayer.Insert(item);
                }

                return(true);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message.ToString());
            }
        }
Esempio n. 4
0
        public List <Customer> Search(Customer item)
        {
            try
            {
                getDatalayer = new LiteDbCustomerDataMapper();
                List <Customer> searchlist = new List <Customer>();

                if (!string.IsNullOrWhiteSpace(item.searchText) || item.Id > -1)
                {
                    searchlist = getDatalayer.Search(item);
                }


                return(searchlist);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message.ToString());
            }
        }