public T_User GetUserModelByToken(string token) { using (var db = new cakedbEntities()) { return(db.T_User.Where(t => t.Token == token).FirstOrDefault()); } }
public T_Address GetAddressByUserId(int userid) { using (var db = new cakedbEntities()) { return(db.T_Address.Where(t => t.UserId == userid).FirstOrDefault()); } }
public bool IsMobile(string mobile) { using (var db = new cakedbEntities()) { return(db.T_User.Where(t => t.Mobile == mobile).ToList().Count() > 0); } }
public bool GetUserModelByMobile(string Mobile, string pwd) { using (var db = new cakedbEntities()) { return(db.T_User.Where(t => t.Mobile == Mobile && t.Pwd == pwd).ToList().Count() > 0); } }
public T_User GetUserModelByMobile(string Mobile) { using (var db = new cakedbEntities()) { return(db.T_User.Where(t => t.Mobile == Mobile).FirstOrDefault()); } }
public List <T_Address> GetAddressListByUserId(int userid) { using (var db = new cakedbEntities()) { return(db.T_Address.Where(t => t.UserId == userid).ToList()); } }
public List <T_ProductComment> GetCommentByPId(int PId) { using (var db = new cakedbEntities()) { return(db.T_ProductComment.Where(t => t.ProductId == PId).ToList()); } }
public T_User GetUserModelByCode(string code) { using (var db = new cakedbEntities()) { return(db.T_User.Where(t => t.InvitationCode == code).FirstOrDefault()); } }
public T_ProductDetail GetPDetailById(int Id) { using (var db = new cakedbEntities()) { return(db.T_ProductDetail.Where(t => t.Id == Id).FirstOrDefault()); } }
public List <T_ProductDetail> GetProductDetailById(int PId) { using (var db = new cakedbEntities()) { return(db.T_ProductDetail.Where(t => t.ProductId == PId).ToList()); } }
public T_Protuct GetProductById(int PId) { using (var db = new cakedbEntities()) { return(db.T_Protuct.Where(t => t.Id == PId).FirstOrDefault()); } }
public List <T_Protuct> GetProductListByClassId(List <int?> id) { using (var db = new cakedbEntities()) { return(db.T_Protuct.Where(t => id.Contains(t.Category)).ToList()); } }
public List <T_Protuct> GetProductListByClassId(int id) { using (var db = new cakedbEntities()) { return(db.T_Protuct.Where(t => t.Category == id).ToList()); } }
public T_User GetUserModelById(int Id) { using (var db = new cakedbEntities()) { return(db.T_User.Where(t => t.Id == Id).FirstOrDefault()); } }
public T_Admin GetAdminModel(int id) { using (var db = new cakedbEntities()) { return(db.T_Admin.Where(t => t.Id == id).FirstOrDefault()); } }
public T_OrderDetail GetOrderDetailByCode(string ordercode) { using (var db = new cakedbEntities()) { return(db.T_OrderDetail.Where(t => t.OrderCode == ordercode).FirstOrDefault()); } }
public bool GetAdminModeByEmail(string Email, string Pwd) { using (var db = new cakedbEntities()) { return(db.T_Admin.Where(t => t.Email == Email && t.Pwd == Pwd).Count() > 0); } }
public List <T_Order> GetOrderList(int i, int top) { using (var db = new cakedbEntities()) { return(db.T_Order.OrderByDescending(t => t.Id).ToList()); } }
public List <T_Order> GetOrderList(string key) { using (var db = new cakedbEntities()) { return(db.T_Order.Where(t => t.Mobile == key || t.OrderCode == key || t.OrderStatus == key).ToList()); } }
public List <T_Order> GetOrderByUserId(int userid) { using (var db = new cakedbEntities()) { return(db.T_Order.Where(t => t.UserId == userid).ToList()); } }
public List <T_OrderDetail> GetOrderDetailList(string ordercode) { using (var db = new cakedbEntities()) { return(db.T_OrderDetail.Where(t => t.OrderCode == ordercode).ToList()); } }
public bool GetAdminModeByName(string Name, string Pwd) { using (var db = new cakedbEntities()) { return(db.T_Admin.Where(t => t.UserName == Name && t.Pwd == Pwd).Count() > 0); } }
public T_Order GetOrderByUserId(int userid, string ordercode) { using (var db = new cakedbEntities()) { return(db.T_Order.Where(t => t.UserId == userid && t.OrderCode == ordercode).FirstOrDefault()); } }
public bool GetAdminModeByMobile(string Mobile, string Pwd) { using (var db = new cakedbEntities()) { return(db.T_Admin.Where(t => t.Mobile == Mobile && t.Pwd == Pwd).Count() > 0); } }
public List <T_Cart> GetCartListByUserId(int userid) { using (var db = new cakedbEntities()) { return(db.T_Cart.Where(t => t.UserId == userid).ToList()); } }
public bool UpdateOrder(T_Order order) { using (var db = new cakedbEntities()) { return(db.SaveChanges() > 0); } }
public T_Admin GetAdminByToken(string token) { using (var db = new cakedbEntities()) { return(db.T_Admin.Where(t => t.admintoken == token).FirstOrDefault()); } }
public bool AddAdmin(T_Admin model) { using (var db = new cakedbEntities()) { db.T_Admin.Add(model); return(db.SaveChanges() > 0); } }
public bool AddOrderLog(T_OrderLog model) { using (var db = new cakedbEntities()) { db.Set <T_OrderLog>().Add(model); return(db.SaveChanges() > 0); } }
public bool InsertCart(T_Cart model) { using (var db = new cakedbEntities()) { db.Set <T_Cart>().Add(model); return(db.SaveChanges() > 0); } }