コード例 #1
0
 public ActionResult GetCompanySoftwareAutoComplete(int type, string search)
 {
     try
     {
         AutocompleteRequestEntity AutocompleteObj = new AutocompleteRequestEntity {
             Type = type, Search = search
         };
         var response = new SubmitReviewService().GetDataForAutoComplete(AutocompleteObj);
         return(Json(response.companySoftwareAutocomplete, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
コード例 #2
0
 public string AddSoftwareReview(CompanySoftwareReviewViewModel review)
 {
     try
     {
         if (Session["UserID"] != null)
         {
             review.UserID = Convert.ToInt32(Session["UserID"]);
             bool   isSuccess = new SubmitReviewService().AddSoftwareReview(review);
             string softname  = "";
             if (Session["SoftwareName"] != null)
             {
                 softname = Session["SoftwareName"].ToString();
             }
             if (CacheHandler.Exists(softname + "reviews"))
             {
                 CacheHandler.Clear(softname + "reviews");
             }
             if (CacheHandler.Exists(softname))
             {
                 CacheHandler.Clear(softname);
             }
             if (!isSuccess)
             {
                 return("Review is already added by this user.");
             }
             else
             {
                 return("Success");
             }
         }
         else
         {
             return("Login to add reviews");
         }
     }
     catch (Exception ex)
     {
         return("");
     }
 }