示例#1
0
 public T_User GetUserModelByToken(string token)
 {
     using (var db = new cakedbEntities())
     {
         return(db.T_User.Where(t => t.Token == token).FirstOrDefault());
     }
 }
示例#2
0
 public T_Address GetAddressByUserId(int userid)
 {
     using (var db = new cakedbEntities())
     {
         return(db.T_Address.Where(t => t.UserId == userid).FirstOrDefault());
     }
 }
示例#3
0
 public bool IsMobile(string mobile)
 {
     using (var db = new cakedbEntities())
     {
         return(db.T_User.Where(t => t.Mobile == mobile).ToList().Count() > 0);
     }
 }
示例#4
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);
     }
 }
示例#5
0
 public T_User GetUserModelByMobile(string Mobile)
 {
     using (var db = new cakedbEntities())
     {
         return(db.T_User.Where(t => t.Mobile == Mobile).FirstOrDefault());
     }
 }
示例#6
0
 public List <T_Address> GetAddressListByUserId(int userid)
 {
     using (var db = new cakedbEntities())
     {
         return(db.T_Address.Where(t => t.UserId == userid).ToList());
     }
 }
示例#7
0
 public List <T_ProductComment> GetCommentByPId(int PId)
 {
     using (var db = new cakedbEntities())
     {
         return(db.T_ProductComment.Where(t => t.ProductId == PId).ToList());
     }
 }
示例#8
0
 public T_User GetUserModelByCode(string code)
 {
     using (var db = new cakedbEntities())
     {
         return(db.T_User.Where(t => t.InvitationCode == code).FirstOrDefault());
     }
 }
示例#9
0
 public T_ProductDetail GetPDetailById(int Id)
 {
     using (var db = new cakedbEntities())
     {
         return(db.T_ProductDetail.Where(t => t.Id == Id).FirstOrDefault());
     }
 }
示例#10
0
 public List <T_ProductDetail> GetProductDetailById(int PId)
 {
     using (var db = new cakedbEntities())
     {
         return(db.T_ProductDetail.Where(t => t.ProductId == PId).ToList());
     }
 }
示例#11
0
 public T_Protuct GetProductById(int PId)
 {
     using (var db = new cakedbEntities())
     {
         return(db.T_Protuct.Where(t => t.Id == PId).FirstOrDefault());
     }
 }
示例#12
0
 public List <T_Protuct> GetProductListByClassId(List <int?> id)
 {
     using (var db = new cakedbEntities())
     {
         return(db.T_Protuct.Where(t => id.Contains(t.Category)).ToList());
     }
 }
示例#13
0
 public List <T_Protuct> GetProductListByClassId(int id)
 {
     using (var db = new cakedbEntities())
     {
         return(db.T_Protuct.Where(t => t.Category == id).ToList());
     }
 }
示例#14
0
 public T_User GetUserModelById(int Id)
 {
     using (var db = new cakedbEntities())
     {
         return(db.T_User.Where(t => t.Id == Id).FirstOrDefault());
     }
 }
示例#15
0
 public T_Admin GetAdminModel(int id)
 {
     using (var db = new cakedbEntities())
     {
         return(db.T_Admin.Where(t => t.Id == id).FirstOrDefault());
     }
 }
示例#16
0
 public T_OrderDetail GetOrderDetailByCode(string ordercode)
 {
     using (var db = new cakedbEntities())
     {
         return(db.T_OrderDetail.Where(t => t.OrderCode == ordercode).FirstOrDefault());
     }
 }
示例#17
0
 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);
     }
 }
示例#18
0
 public List <T_Order> GetOrderList(int i, int top)
 {
     using (var db = new cakedbEntities())
     {
         return(db.T_Order.OrderByDescending(t => t.Id).ToList());
     }
 }
示例#19
0
 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());
     }
 }
示例#20
0
 public List <T_Order> GetOrderByUserId(int userid)
 {
     using (var db = new cakedbEntities())
     {
         return(db.T_Order.Where(t => t.UserId == userid).ToList());
     }
 }
示例#21
0
 public List <T_OrderDetail> GetOrderDetailList(string ordercode)
 {
     using (var db = new cakedbEntities())
     {
         return(db.T_OrderDetail.Where(t => t.OrderCode == ordercode).ToList());
     }
 }
示例#22
0
 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);
     }
 }
示例#23
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());
     }
 }
示例#24
0
 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);
     }
 }
示例#25
0
 public List <T_Cart> GetCartListByUserId(int userid)
 {
     using (var db = new cakedbEntities())
     {
         return(db.T_Cart.Where(t => t.UserId == userid).ToList());
     }
 }
示例#26
0
 public bool  UpdateOrder(T_Order order)
 {
     using (var db = new cakedbEntities())
     {
         return(db.SaveChanges() > 0);
     }
 }
示例#27
0
 public T_Admin GetAdminByToken(string token)
 {
     using (var db = new cakedbEntities())
     {
         return(db.T_Admin.Where(t => t.admintoken == token).FirstOrDefault());
     }
 }
示例#28
0
 public bool AddAdmin(T_Admin model)
 {
     using (var db = new cakedbEntities())
     {
         db.T_Admin.Add(model);
         return(db.SaveChanges() > 0);
     }
 }
示例#29
0
 public bool AddOrderLog(T_OrderLog model)
 {
     using (var db = new cakedbEntities())
     {
         db.Set <T_OrderLog>().Add(model);
         return(db.SaveChanges() > 0);
     }
 }
示例#30
0
 public bool InsertCart(T_Cart model)
 {
     using (var db = new cakedbEntities())
     {
         db.Set <T_Cart>().Add(model);
         return(db.SaveChanges() > 0);
     }
 }