示例#1
0
        public EcoPathModel(EcoPath ecoPath)
        {
            Entity = ecoPath;
            entId  = ecoPath.Id;

            var    loggedInUser = HttpContext.Current.User.Identity.Name;
            string selectedCity = null;

            if (loggedInUser != null)
            {
                selectedCity = (from u in _context.User_Info
                                where u.User_Accounts.Username == loggedInUser
                                select u.City1.EngName).FirstOrDefault();
            }
            if (String.IsNullOrEmpty(selectedCity))
            {
                PathCity = Entity.City.EngName;
            }
            else
            {
                PathCity = selectedCity;
            }
        }
示例#2
0
 public EcoPathModel()
 {
     Entity = new EcoPath();
 }