Example #1
0
        public void Post([FromBody] SubMenu subMenu)
        {
            try
            {
                ValidateLogin(subMenu);
                var subMenuRepository = new SubMenuRepository();
                if (subMenu.Image.IndexOf(Constants.Base64String) >= 0)
                {
                    byte[] content = Convert.FromBase64String(subMenu.Image.Replace(Constants.Base64String, string.Empty));
                    var    guid    = Guid.NewGuid().ToString("N");
                    var    path    = "/Images/" + guid + ".jpeg";
                    if (System.Diagnostics.Debugger.IsAttached)
                    {
                        path = "~/Images/" + guid + ".jpeg";;
                    }

                    var fullPath = System.Web.HttpContext.Current.Server.MapPath(path);
                    System.IO.File.WriteAllBytes(fullPath, content);
                    subMenu.Image = path;
                }
                subMenuRepository.Upsert(subMenu);
            }
            catch (Exception e)
            {
                logger.Error(string.Format("Hata=>{0} StackTrace=>{1}", e.Message, e.StackTrace));
            }
        }
Example #2
0
        public UnitOfWork(ApplicationDbContext context)
        {
            _context       = context;
            ProductDetails = new ReservationDetailsRepository(_context);
            Products       = new ProductRepository(_context);

            ProductCategories = new ProductCategoryRepository(_context);

            Services = new ServiceRepository(_context);

            ServiceCategories = new ServiceCategoryRepository(_context);

            Departments = new DepartmentRepository(_context);

            Menus = new MenuRepository(_context);

            SubMenus = new SubMenuRepository(_context);

            OurTeams = new OurTeamRepository(_context);

            Designations = new DesignationRepository(_context);

            Faq = new FaqRepository(_context);

            Client = new ClientRepository(_context);

            Blogs = new BlogRepository(_context);

            ContactUs = new ContactUsRepository(_context);

            Companies = new CompanyRepository(_context);

            Banner = new BannerRepository(_context);

            ChooseUs = new WhyChooseUsRepository(_context);

            ClientProducts = new ClientProductRepository(_context);

            AboutUs = new AboutUsRepository(_context);

            HostingPlan = new HostingPlanRepository(_context);

            CustomerReview = new CustomerReviewRepository(_context);

            Career = new CareerRepository(_context);

            Job = new JobRepository(_context);

            Softwares = new SoftwareRepository(_context);

            SoftwareCategories = new SoftwareCategoriesRepository(_context);

            Features = new FeaturesRepository(_context);

            BlogComment = new BlogCommentRepository(_context);

            QueryHelper = new QueryHelper();
        }
Example #3
0
 public void Delete([FromBody] SubMenu subMenu)
 {
     try
     {
         ValidateLogin(subMenu);
         var subMenuRepository = new SubMenuRepository();
         subMenuRepository.Delete(subMenu.Id);
     }
     catch (Exception e)
     {
         logger.Error(string.Format("Hata=>{0} StackTrace=>{1}", e.Message, e.StackTrace));
     }
 }
Example #4
0
 public HomeController(SubMenuRepository smr)
 {
     _smr = smr;
 }