예제 #1
0
        public byte GenerateNewCategoryId()
        {
            byte categoryId;

            try
            {
                var newCategoryId = (from p in _context.Categories select QuickKartDBContext.ufn_GenerateNewCategoryId()).FirstOrDefault();
                categoryId = Convert.ToByte(newCategoryId);
            }
            catch (Exception ex)
            {
                categoryId = 0;
            }
            return(categoryId);
        }
예제 #2
0
        public string GenerateNewProductId()
        {
            string productId;

            try
            {
                productId = (from p in _context.Products
                             select
                             QuickKartDBContext.ufn_GenerateNewProductId()).FirstOrDefault();
            }
            catch (Exception)
            {
                productId = null;
            }
            return(productId);
        }
 public QuickKartRepository()
 {
     context = new QuickKartDBContext();
 }
예제 #4
0
 public QuickKartRepository(QuickKartDBContext context)
 {
     _context = context;
 }