예제 #1
0
        public ActionResult SaveCommentsInformation(CommentsInformation model)
        {
            var  serialization = new Serialization();
            var  listingsBA    = new Listings();
            long listingID     = 0;

            if (ModelState.IsValid)
            {
                Hashtable HashCriteria = new Hashtable();
                HashCriteria.Add("ListingID", model.ID);
                HashCriteria.Add("Comments", model.Comments);
                HashCriteria.Add("IsSellerOffering", model.IsSellerOffering);
                HashCriteria.Add("SellerOfferingPercentage", model.SellerOfferingPercentage);
                HashCriteria.Add("UserID", userID);
                var actualCriteria = serialization.SerializeBinary((object)HashCriteria);
                var result         = listingsBA.SaveCommentsInformation(actualCriteria);
                listingID = Convert.ToInt64(serialization.DeSerializeBinary(Convert.ToString(result)));
            }
            else
            {
                return(PartialView("_Comments", model));
            }
            var ListingID  = CipherTool.EncryptString(Convert.ToString(listingID), true);
            var jsonResult = new[] {
                new { ListingID = ListingID, ID = listingID },
            };

            return(Json(jsonResult, JsonRequestBehavior.AllowGet));
        }