コード例 #1
0
        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; }
        }
コード例 #2
0
 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); }
 }
コード例 #3
0
 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); }
 }
コード例 #4
0
 public AuthController(Models.TMShopsContext _db)
 {
     db = _db;
 }
コード例 #5
0
 public HomeController(Models.TMShopsContext context)
 {
     _context = context;
 }