예제 #1
0
        //public ActionResult CompanyReview(string id)
        //{
        //    return Json("Please login to submit the review.", JsonRequestBehavior.AllowGet);

        //}

        public string ClaimListing(int companyID, string Email, string Domain)
        {
            int    UserID   = 0;
            string message  = string.Empty;
            string compname = string.Empty;

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

            try
            {
                ClaimApproveRejectListingRequest claimListingRequest = new ClaimApproveRejectListingRequest
                {
                    ClaimListingID = 0,
                    companyID      = companyID,
                    CompanyName    = compname,
                    IsUserVerify   = false,
                    Email          = Email,
                    Domain         = Domain,
                    userID         = UserID
                };

                message = new CompanyService().ClaimListing(claimListingRequest);
            }
            catch (Exception)
            {
            }
            return(message);
        }
예제 #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);
        }
예제 #3
0
        public string AdminApproveRejectForClaim(int userID, int claimlistingID, int companyID, bool isAdminApproved, string Rejectioncomment, string Email, string CompanyName, string Type)
        {
            string message = "";
            ClaimApproveRejectListingRequest claimRequestobj = new ClaimApproveRejectListingRequest
            {
                ClaimListingID   = claimlistingID,
                userID           = userID,
                companyID        = companyID,
                IsAdminApproved  = isAdminApproved,
                RejectionComment = Rejectioncomment,
                Email            = Email,
                CompanyName      = CompanyName,
                Type             = Type
            };

            using (_httpClient = new HttpClient())
            {
                string WebAPIURL   = System.Configuration.ConfigurationManager.AppSettings["WebAPIURL"].ToString();
                string apiMethod   = "AdminApproveRejectForClaim";
                string completeURL = WebAPIURL + apiMethod + '/';


                StringContent httpContent = new StringContent(JsonConvert.SerializeObject(claimRequestobj), Encoding.UTF8, "application/json");

                HttpResponseMessage response = _httpClient.PostAsync(completeURL, httpContent).Result;
                if (response.IsSuccessStatusCode)
                {
                    message = response.Content.ReadAsStringAsync().Result;
                    if (message.Contains("claimed"))
                    {
                        message = "claimed";
                    }
                    else if (message.Contains("Rejected"))
                    {
                        message = "Rejected";
                    }
                    else
                    {
                        message = "error";
                    }
                }
                else
                {
                    message = "error";
                }
            }
            return(message);
        }
예제 #4
0
        internal string ClaimSoftwareListing(ClaimApproveRejectListingRequest claimlistingrequest)
        {
            const string apiMethod   = "InsertVerifyClaimSoftwareListing";
            var          completeUrl = _webApiurl + apiMethod + '/';
            var          httpContent = new StringContent(JsonConvert.SerializeObject(claimlistingrequest), Encoding.UTF8, "application/json");

            using (_httpClient = new HttpClient())
            {
                HttpResponseMessage response;
                using (httpContent)
                {
                    response = _httpClient.PostAsync(completeUrl, httpContent).Result;
                }

                var message = response.IsSuccessStatusCode ? "Successfully Claimed" : "Something error occured while claiming. Please contact support.";
                return(message);
            }
        }
예제 #5
0
        internal string ClaimListing(ClaimApproveRejectListingRequest claimlistingrequest)
        {
            using (_httpClient = new HttpClient())
            {
                string message     = string.Empty;
                string WebAPIURL   = System.Configuration.ConfigurationManager.AppSettings["WebAPIURL"].ToString();
                string apiMethod   = "InsertVerifyClaimListing";
                string completeURL = WebAPIURL + apiMethod + '/';

                StringContent httpContent = new StringContent(JsonConvert.SerializeObject(claimlistingrequest), Encoding.UTF8, "application/json");

                HttpResponseMessage response = _httpClient.PostAsync(completeURL, httpContent).Result;
                if (response.IsSuccessStatusCode)
                {
                    message = "Successfully Claimed";
                }
                else
                {
                    message = "Something error occured while claiming. Please contact support.";
                }
                return(message);
            }
        }