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

            if (ModelState.IsValid)
            {
                var HashCriteria   = SetHashCriteriaForDocumentInformation(model);
                var actualCriteria = serialization.SerializeBinary((object)HashCriteria);
                var result         = listingsBA.SaveDocumentsInformation(actualCriteria);
                listingID = Convert.ToInt64(serialization.DeSerializeBinary(Convert.ToString(result)));
                SaveListingDocuments(Convert.ToInt64(listingID));
                SaveListingImages(Convert.ToInt64(listingID));
                Session["ListingDocuments"] = null;
                Session["ListingImages"]    = null;
            }
            else
            {
                return(PartialView("_Documents", model));
            }
            string ListingID  = Synoptek.SessionManagement.CipherTool.EncryptString(Convert.ToString(listingID), true);
            var    jsonResult = new[] {
                new { ListingID = ListingID, ID = listingID },
            };

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