Example #1
0
        public JsonResult OnCreate(string pTitle, int?pGroupId, string pLink, string pSummary, string pImageUrl)
        {
            var mImage = new Image()
            {
                Date      = DateTime.Now,
                Link      = pLink,
                LinkImage = pImageUrl,
                Name      = pTitle,
                Summary   = pSummary,
                TypeID    = pGroupId
            };

            MpStartEntities.AddToImage(mImage);
            MpStartEntities.SaveChanges();
            return(Json(new { code = 1, message = "Lưu  ảnh thành công." }));
        }