/// <summary> /// 完成订单 /// </summary> /// <param name="OrderID"></param> /// <returns></returns> public int CompleteOrder(int OrderID) { var query = (from t in HouseAppEntities.Order where t.OrderID == OrderID select t); int effect = -1; query.First().State = 2; query.First().TakeEndDateTime = DateTime.Now; DataCount dataCount = new DataCount(); dataCount.OrderID = query.First().OrderID; dataCount.CreaterID = query.First().CreaterID; dataCount.TakerID = query.First().TakerID; dataCount.Street = query.First().Street; HouseAppEntities.DataCount.Add(dataCount); CommentOrder comment = new CommentOrder(); comment.OrderID = query.First().OrderID; comment.CreaterID = query.First().CreaterID; comment.TakerID = query.First().TakerID; HouseAppEntities.CommentOrder.Add(comment); effect = HouseAppEntities.SaveChanges(); return effect; }
public int InsertComment(CommentOrder Order) { var query = (from c in HouseAppEntities.CommentOrder where c.OrderID == Order.OrderID select c); query.First().Comment = Order.Comment; int effect = -1; effect = HouseAppEntities.SaveChanges(); return effect; }