Beispiel #1
0
        public ActionResult SoftwareAllReviewsByName(string id)
        {
            try
            {
                Session["calledPage"] = "R";

                SoftwareViewModel softwareViewModel = null;

                SoftwareFilterEntity softwarereviewsFilter = new SoftwareFilterEntity
                {
                    SoftwareName = id.Replace("-", " "),
                    Rows         = 0
                };

                softwareViewModel = new SoftwareService().GetAllSoftwareReviews(softwarereviewsFilter);
                if (softwareViewModel != null && (softwareViewModel.SoftwareList != null && softwareViewModel.SoftwareList.Count > 0))
                {
                    softwareViewModel.WebBaseUrl = _webBaseURL;
                    return(View("~/Views/AllListPages/AllSoftwareReviewsList.cshtml", softwareViewModel));
                }
                else
                {
                    return(View("~/Views/Error/PageNotFound.cshtml"));
                }
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
Beispiel #2
0
        public string ClaimSoftwareListing(int SoftwareID, string Email, string Domain)
        {
            int    UserID       = 0;
            string message      = string.Empty;
            string softwarename = string.Empty;

            if (Convert.ToInt32(Session["UserID"]) != 0)
            {
                UserID = Convert.ToInt32(Session["UserID"]);
            }
            if (!string.IsNullOrEmpty(Session["SoftwareName"].ToString()))
            {
                softwarename = Session["SoftwareName"].ToString();
            }

            try
            {
                var claimSoftwareListingRequest = new ClaimApproveRejectListingRequest
                {
                    ClaimListingID = 0,
                    softwareID     = SoftwareID,
                    SoftwareName   = softwarename,
                    IsUserVerify   = false,
                    Email          = Email,
                    Domain         = Domain,
                    userID         = UserID
                };

                message = new SoftwareService().ClaimSoftwareListing(claimSoftwareListingRequest);
            }
            catch (Exception ex)
            {
            }
            return(message);
        }
        private Task <List <RicEvent> > LoadRicEvents()
        {
            var events = new List <RicEvent>();

            return(Task.Run(() =>
            {
                using (var svc = new SoftwareService())
                {
                    var softIds = svc.GetSoftwares().Where(s => s.SoftwareKey == SoftwareId).Select(s => s.Key);

                    foreach (var sId in softIds)
                    {
                        var logs = svc.GetMessageLog((Guid)sId, Start, End);

                        foreach (var log in logs)
                        {
                            var ev = new RicEvent
                            {
                                Message = log.Message,
                                DateTime = log.CaptureDate
                            };
                            events.Add(ev);
                        }
                    }
                }

                return events;
            }));
        }
 public AccountingController()
 {
     _accService      = new AccountingService();
     _customerService = new CustomerService();
     _hardwareService = new HardwareService();
     _softwareService = new SoftwareService();
 }
Beispiel #5
0
 public SoftwareController()
 {
     _softwareService = new SoftwareService();
     _productService  = new ProductService();
     _customerService = new CustomerService();
     _userService     = new UserService();
 }
Beispiel #6
0
        public ActionResult SoftwareList(string SoftwareName, int SoftwareCategoryID, string sortby, int PageNo, int PageSize, int FirstPage, int LastPage, int OrderColumn)
        {
            SoftwareService softwareService = new SoftwareService();

            SoftwareFilterEntity softwareFilter = new SoftwareFilterEntity
            {
                SoftwareName       = SoftwareName,
                SoftwareCategoryId = SoftwareCategoryID,
                PageNo             = PageNo,
                PageSize           = PageSize,
                SortBy             = sortby,
                UserID             = Convert.ToInt32(Session["UserID"]),
                OrderColumn        = OrderColumn
            };

            SoftwareViewModel softwareViewModel = softwareService.GetSoftware(softwareFilter);

            softwareViewModel.WebBaseUrl = _webBaseUrl;
            softwareViewModel.PageCount  = 0;
            softwareViewModel.PageNumber = PageNo;
            softwareViewModel.PageIndex  = 1;
            if (softwareViewModel.SoftwareList.Count > 0)
            {
                softwareViewModel.PageCount = (softwareViewModel.SoftwareList[0].TotalCount + PageSize - 1) / PageSize;
            }
            if ((PageNo == FirstPage || PageNo == LastPage) && LastPage >= 5)
            {
                if (PageNo == FirstPage && PageNo != 1)
                {
                    softwareViewModel.PageIndex = FirstPage - 1;
                }
                else if (PageNo == LastPage)
                {
                    if (PageNo == softwareViewModel.PageCount)
                    {
                        softwareViewModel.PageIndex = (PageNo - 5) + 1;
                    }
                    else
                    {
                        softwareViewModel.PageIndex = FirstPage + 1;
                    }
                }
            }
            else if (PageNo > LastPage && LastPage >= 5)
            {
                softwareViewModel.PageIndex = (PageNo - 5) + 1;
            }
            else if (PageNo >= FirstPage && PageNo <= LastPage)
            {
                softwareViewModel.PageIndex = FirstPage;
            }

            return(PartialView("_SoftwareList", softwareViewModel));
        }
Beispiel #7
0
 public string ThanksNoteForReview(int softwareID, int softwareReviewID, string softwareName)
 {
     if (Convert.ToInt32(Session["UserID"]) != 0)
     {
         if (CacheHandler.Exists(softwareName))
         {
             CacheHandler.Clear(softwareName);
         }
         string message = new SoftwareService().ThanksNoteForReview(softwareID, softwareReviewID, Convert.ToInt32(Session["UserID"]));
         return(message);
     }
     else
     {
         return("Please login to provide thanks note.");
     }
 }
Beispiel #8
0
        public ActionResult UpdateSoftwareRejectionComments()
        {
            if (Request.Params["softwareRejectComments"] != null)
            {
                JObject jobj = JObject.Parse(Request.Params["softwareRejectComments"]);
                SoftwareRejectComments softwareRejectComments = jobj.ToObject <SoftwareRejectComments>();
                UserEntity             loggedInUser           = (UserEntity)Session["UserObj"];
                softwareRejectComments.RejectedBy = loggedInUser.FirstName + " " + loggedInUser.LastName;
                bool isRejectCommentsUpdated = new SoftwareService().UpdateSoftwareRejectionComments(softwareRejectComments);
                return(PartialView("~/Views/Authenticated/Center/UserSoftwareList.cshtml",
                                   new SoftwareViewModel()
                {
                    SoftwareList = new List <SoftwareEntity>()
                }));
            }

            return(null);
        }
        private async Task <IActionResult> GetSoftwareById(GetSoftwareByIdRequest getSoftwareRequest)
        {
            var options = new DbContextOptionsBuilder <Context>()
                          .UseInMemoryDatabase(databaseName: "Software")
                          .Options;


            // Run the test against one instance of the context
            using (var context = new Context(options))
            {
                var repository = new SoftwareRepository(context, AutomapperSingleton.Mapper);
                var service    = new SoftwareService(repository, AutomapperSingleton.Mapper);
                var controller = new SoftwareController(service);

                Mock <HttpRequest> mockGetRequest = MockHttpRequest.CreateMockQuery(getSoftwareRequest.Id);
                return(await controller.GetSoftwareByIdAsync(mockGetRequest.Object, _logger)); //as GridController;
            }
        }
Beispiel #10
0
        // GET: CompanyList
        public ActionResult SoftwareList(string id)
        {
            Session["calledPage"] = "S";
            var urlSoftwareCategory = Convert.ToString(Request.Url.Segments[1]);
            var softwareService     = new SoftwareService();
            var softwareCategoryId  = 0;

            if (Request.Url.Segments.Length > 2)
            {
                urlSoftwareCategory = urlSoftwareCategory.Replace("/", "");
            }
            if (urlSoftwareCategory != string.Empty)
            {
                Session["SoftwareCategory"] = urlSoftwareCategory.ToString();
                softwareCategoryId          = new FocusAreaService().GetSoftwareCategoryID(urlSoftwareCategory);
            }
            SoftwareFilterEntity softwareFilter = new SoftwareFilterEntity
            {
                SoftwareName       = "",
                SoftwareCategoryId = softwareCategoryId,
                PageNo             = 1,
                PageSize           = 25,
                SortBy             = "DESC",
                UserID             = Convert.ToInt32(Session["UserID"]),
                OrderColumn        = 1,
            };

            SoftwareViewModel softwareViewModel = softwareService.GetSoftware(softwareFilter);

            softwareViewModel.WebBaseUrl = _webBaseUrl;
            GetSoftwareCategoryHeadLine(urlSoftwareCategory, softwareViewModel);
            softwareViewModel.SoftwareCategoryId = softwareCategoryId.ToString();
            softwareViewModel.PageCount          = 0;
            softwareViewModel.PageNumber         = 1;
            softwareViewModel.PageIndex          = 1;
            softwareViewModel.TotalNoOfSoftwares = softwareViewModel.SoftwareList.Select(a => a.TotalCount).FirstOrDefault();
            if (softwareViewModel.SoftwareList.Count > 0)
            {
                softwareViewModel.PageCount = (softwareViewModel.SoftwareList[0].TotalCount + 25 - 1) / 25;
            }
            return(View(softwareViewModel));
        }
Beispiel #11
0
 public JsonResult GetDataForAutoComplete()
 {
     try
     {
         var           jsonResult         = default(dynamic);
         string        searchTerm         = Convert.ToString(Request.Params["starts_with"]);
         int           SoftwareCategory   = new FocusAreaService().GetSoftwareCategoryID(Convert.ToString(Session["SoftwareCategory"]));
         List <string> myAutoCompleteList = new SoftwareService().GetSoftwareForAutoComplete(SoftwareCategory, searchTerm);
         jsonResult = from a in myAutoCompleteList
                      select new
         {
             Name = a
         };
         return(Json(jsonResult, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
Beispiel #12
0
        public ActionResult Softwares()
        {
            try
            {
                Session["calledPage"] = "N";
                string            softwareName      = Convert.ToString(Request.Url.Segments[2]).Trim();
                SoftwareViewModel softwareViewModel = null;
                if (softwareName != string.Empty)
                {
                    Session["SoftwareName"] = softwareName;
                }
                if (CacheHandler.Exists(softwareName.ToLower()))
                {
                    softwareViewModel = new SoftwareViewModel();
                    CacheHandler.Get(softwareName.ToLower(), out softwareViewModel);
                }
                else
                {
                    SoftwareFilterEntity companyFilter = new SoftwareFilterEntity
                    {
                        SoftwareName       = softwareName.Replace("-", " "),
                        SortBy             = "DESC",
                        SoftwareCategoryId = 0,
                        UserID             = Convert.ToInt32(Session["UserID"]),
                        PageNo             = 1,
                        PageSize           = 10,
                        OrderColumn        = 1
                    };

                    softwareViewModel = new SoftwareService().GetSoftware(companyFilter);
                    CacheHandler.Add(softwareViewModel, softwareName);
                }

                softwareViewModel.WebBaseUrl = _webBaseURL;
                return(View(softwareViewModel));
            }
            catch (Exception)
            {
                return(null);
            }
        }
Beispiel #13
0
        public ActionResult GetSoftwareUserReviews(string softwarename, int PageSize)
        {
            int SoftwareCategoryID = 0;

            if (Session["SoftwareCategory"] != null)
            {
                SoftwareCategoryID = new FocusAreaService().GetSoftwareCategoryID(Session["SoftwareCategory"].ToString());
            }
            SoftwareFilterEntity UserReviewObj = new SoftwareFilterEntity
            {
                SoftwareCategoryId = SoftwareCategoryID,
                SoftwareName       = softwarename,
                PageNo             = 1,
                PageSize           = PageSize
            };

            CompanySoftwareUserReviews companyReViewModel = new CompanySoftwareUserReviews();

            companyReViewModel = new SoftwareService().GetUserReviewsForSoftwareListingPage(UserReviewObj);

            return(PartialView("~/Views/SoftwareList/_SoftwareUsersReviewsList.cshtml", companyReViewModel));
        }
Beispiel #14
0
        private void GetSoftwareCategoryHeadLine(string urlSoftwareCategory, SoftwareViewModel softwareViewModel)
        {
            int year = DateTime.Now.Year;


            string cachename = urlSoftwareCategory.Trim();
            CategoryMetaTagsDetails metaTagObj;

            if (CacheHandler.Exists(cachename))
            {
                metaTagObj = new CategoryMetaTagsDetails();
                CacheHandler.Get(cachename, out metaTagObj);
            }
            else
            {
                metaTagObj = new CategoryMetaTagsDetails();
                metaTagObj = new SoftwareService().GetSoftwareCategoryMetaTags(urlSoftwareCategory.Trim());
                CacheHandler.Add(metaTagObj, cachename);
            }
            softwareViewModel.CategoryHeadLine = metaTagObj.Title.ToUpper();
            softwareViewModel.Title            = metaTagObj.TwitterTitle.Replace("{Year}", year.ToString());
            softwareViewModel.MetaTag          = SoftwareCategoryMetaTags(metaTagObj);
        }
 public SoftwareController(IMemoryCache memoryCache, SeedService seedService, SoftwareService softwareService) :
     base(memoryCache, seedService) => this.softwareService = softwareService;