public static List <Models.Group> getGroup(string AppKey, string parent, Guid id) { try { var list = new List <Models.Group>(); var db = new Models.TMShopsContext(); var rs = new List <Models.Group>(); if (id == Guid.Empty) { rs = db.Groups.Where(d => d.appKey == AppKey && d.parentId == parent && d.flag > 0).ToList(); } else { rs = db.Groups.Where(d => d.id != id && d.appKey == AppKey && d.parentId == parent && d.flag > 0).ToList(); } foreach (var item in rs) { list.Add(item); list.AddRange(getGroup(AppKey, item.id.ToString(), id)); } return(list); } catch (Exception) { throw; } }
public static string GetCustomerName(string id) { try { var db = new Models.TMShopsContext(); var rs = db.Customers.Find(Guid.Parse(id)); if (rs != null) { return(rs.fullName); } else { return(TM.Common.Language.emptyvl); } } catch (Exception) { return(TM.Common.Language.emptyvl); } }
public static string GetUser(string id) { try { var db = new Models.TMShopsContext(); var rs = db.Users.Find(Guid.Parse(id)); if (rs != null) { if (!String.IsNullOrEmpty(rs.fullName)) { return(rs.fullName); } else { return(rs.username); } } else { return(TM.Common.Language.emptyvl); } } catch (Exception) { return(TM.Common.Language.emptyvl); } }
public AuthController(Models.TMShopsContext _db) { db = _db; }
public HomeController(Models.TMShopsContext context) { _context = context; }