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