public List <DTO_DrawPoints> GetLinePoints(DTO_DrawID d) { List <DTO_DrawPoints> dp = new List <DTO_DrawPoints>(); using (DB_122744_doodleEntities db = new DB_122744_doodleEntities()) { var list = db.drawPoints.Where(c => c.DrawID == d.DrawID).ToList(); foreach (var record in list) { DTO_DrawPoints dpo = new DTO_DrawPoints(); dpo.DrawID = record.DrawID.Value; dpo.DrawPointID = record.DrawPointID; dpo.DrawPointX = record.DrawPointX.Value; dpo.DrawPointX2 = record.DrawPointX2.Value; dpo.DrawPointY = record.DrawPointY.Value; dpo.DrawPointY2 = record.DrawPointY2.Value; dp.Add(dpo); break; } } return(dp); }
public List <DTO_DrawPoints> PushLine(DTO_DrawPoints lineSegment) { List <DTO_DrawPoints> ret = new List <DTO_DrawPoints>(); using (DB_122744_doodleEntities db = new DB_122744_doodleEntities()) { drawPoint dp = new drawPoint(); dp.DrawID = lineSegment.DrawID; dp.DrawPointX = lineSegment.DrawPointX; dp.DrawPointY = lineSegment.DrawPointY; dp.DrawPointX2 = lineSegment.DrawPointX2; dp.DrawPointY2 = lineSegment.DrawPointY2; db.drawPoints.Add(dp); db.SaveChanges(); } return(ret); }
public List <DTO_DrawPoints> GetDrawPoints(DTO_DrawID drawID) { List <DTO_DrawPoints> drawpointlist = new List <DTO_DrawPoints>(); using (DB_122744_doodleEntities db = new DB_122744_doodleEntities()) { var points = db.drawPoints.Where(c => c.DrawID == drawID.DrawID).ToList(); foreach (var s in points) { DTO_DrawPoints u = new DTO_DrawPoints(); u.DrawID = s.DrawID.Value; u.DrawPointID = s.DrawPointID; u.DrawPointX = s.DrawPointX.Value; u.DrawPointY = s.DrawPointY.Value; u.DrawPointX2 = s.DrawPointX2.Value; u.DrawPointY2 = s.DrawPointY2.Value; drawpointlist.Add(u); } } return(drawpointlist); }
private async Task PostLine(Point p1, Point p2) { DTO_DrawPoints line = new DTO_DrawPoints(); line.DrawID = S_Draw.Instance.drawID; line.DrawPointX = p1.X; line.DrawPointY = p1.Y; line.DrawPointX2 = p2.X; line.DrawPointY2 = p2.Y; try { HttpResponseMessage response = await client.PostAsJsonAsync(string.Format(@"{0}{1}", URL, "PushLine"), line); response.EnsureSuccessStatusCode(); } catch (HttpRequestException hre) { Debug.WriteLine(hre.Message); } await PullLines(); }