public bool DeleteProductRequest(int id)
 {
     try
     {
         Quiz.Core.EntityModel.tblProduct productRequest = _Context.tblProducts.Find(id);
         _Context.tblProducts.Remove(productRequest);;
         _Context.SaveChanges();
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
        public bool SaveProductRequests(ProductViewModel productRequest)
        {
            Quiz.Core.EntityModel.tblProduct tblProduct = new Quiz.Core.EntityModel.tblProduct();
            bool result = false;

            try
            {
                if (productRequest.Id == 0)
                {
                    Mapper.Map(productRequest, tblProduct);

                    tblProduct.CreatedOn = DateTime.Now;
                    if (tblProduct.ManufactureDate == DateTime.MinValue)
                    {
                        tblProduct.DateOfPurchase  = DateTime.Now;
                        tblProduct.ManufactureDate = DateTime.Now;
                    }
                    tblProduct.CreatedOn = DateTime.Now;
                    tblProduct.CreatedBy = 101;
                    tblProduct.IsActive  = true;
                    tblProduct.IsDeleted = false;
                    _Context.tblProducts.Add(tblProduct);
                    _Context.SaveChanges();
                    result = true;
                }
                else
                {
                    Mapper.Map(productRequest, tblProduct);
                    _Context.Entry(tblProduct).State = EntityState.Modified;
                    _Context.SaveChanges();
                    result = true;
                }
            }
            catch (Exception EX)
            {
                result = false;
            }
            return(result);
        }