public void Add(OrderPayDesc model) { if (model == null) { return; } context.OrderPayDesc.Add(model); context.SaveChanges(); }
public OrderPayDesc GetInfo(long orderId, long uid, int userType) { OrderPayDesc orderinfo = new OrderPayDesc(); if (orderId != 0) { orderinfo = (from p in context.OrderPayDesc where p.OrderId == orderId select p).FirstOrDefault(); } if (uid != 0) { orderinfo = (from p in context.OrderPayDesc where p.UserId == uid select p).FirstOrDefault(); } if (userType != 0) { orderinfo = (from p in context.OrderPayDesc where p.UserType == userType select p).FirstOrDefault(); } return(orderinfo); }
public void Update(OrderPayDesc model) { if (model == null) { return; } OrderPayDesc order = context.OrderPayDesc.FirstOrDefault((OrderPayDesc m) => m.Id == model.Id); if (order == null) { return; } order.OrderId = model.OrderId; order.UserId = model.UserId; order.UserType = model.UserType; order.PayTime = model.PayTime; order.ReciveTime = model.ReciveTime; order.TotalPrice = model.TotalPrice; order.RealPrice = model.RealPrice; order.Isfenqi = model.Isfenqi; order.Status = model.Status; order.CoinType = model.CoinType; context.SaveChanges(); }