private void SaveLike(HttpContext context) { int id = int.Parse(context.Request.Params["id"]); bool liked = bool.Parse(context.Request.Params["liked"]); if (liked) { PindexProd.dbml.Likes l = new PindexProd.dbml.Likes(); l.BoardsImagesMappingID = id; l.UserID = Common.UserID.Value; this.GetPindexProdContext2.Likes.InsertOnSubmit(l); this.GetPindexProdContext2.SubmitChanges(); } else { this.GetPindexProdContext1.Execute(string.Format("Delete From Likes where BoardsImagesMappingID={0}", id)); } }