Example #1
0
        public void SetAddress(int id = 0)
        {
            string target = Request.QueryString["target"];

            if (string.IsNullOrEmpty(target))
            {
                if (Request.UrlReferrer != null)
                {
                    target = Request.UrlReferrer.ToString();
                }
            }
            M.ShippingAddress address = M.ShippingAddress.GetById(DataSource, id, User.Identity.Id);
            int location;

            if (address == null)
            {
                City city;
                using (IPArea area = new IPArea())
                {
                    IPLocation local = area.Search(ClientIp);
                    using (Country country = Country.GetCountry())
                        city = local.GetCity(country);
                }
                location = city != null ? city.Id : 441900;
            }
            else
            {
                location = address.County;
            }
            this["Target"]   = target;
            this["Location"] = location;
            this["Address"]  = address;
            Render("set_address.html");
        }
Example #2
0
        public void Index()
        {
            M.MemberInfo member = M.MemberInfo.GetByModify(DataSource, User.Identity.Id);
            DateTime     begin  = (DateTime)Types.GetDefaultValue(TType <DateTime> .Type);

            if (member.Birthday < begin)
            {
                member.Birthday = begin;
            }
            int location = member.County;

            if (location == 0)
            {
                City city;
                using (IPArea area = new IPArea())
                {
                    IPLocation local = area.Search(ClientIp);
                    using (Country country = Country.GetCountry())
                        city = local.GetCity(country);
                }
                location = city != null ? city.Id : 441900;
            }
            this["Location"] = location;
            this["Member"]   = member;
            Render("memberinfo.html");
        }
Example #3
0
        public void Index()
        {
            City city;

            using (IPArea area = new IPArea())
            {
                IPLocation local = area.Search(ClientIp);
                using (Country country = Country.GetCountry())
                    city = local.GetCity(country);
            }
            this["Location"] = city != null ? city.Id : 441900;
            Render("shippingaddress.html");
        }
Example #4
0
 public void Welcome()
 {
     if (CheckRight())
     {
         if (User != null && User.Identity.IsAuthenticated && User.Identity.IsAdmin)
         {
             if (CheckPost("welcome", () =>
             {
                 StringBuilder sb = new StringBuilder();
                 List <ModuleInfo> list = ModuleInfo.GetAllList(Context);
                 foreach (ModuleInfo info in list)
                 {
                     sb.Append("<li><i class=\"dll\">");
                     sb.Append(info.Name);
                     sb.Append("</i><i class=\"ii\">&nbsp;v</i><i class=\"ver\">");
                     sb.Append(info.Version);
                     sb.Append("</i><i class=\"up\"></i></li>");
                 }
                 this["Version"] = sb.ToString();
                 string loginArea = User.Identity.LastIp;
                 using (IPArea area = new IPArea())
                 {
                     IPLocation ip = area.Search(loginArea);
                     if (ip != null)
                     {
                         loginArea = ip.ToString();
                     }
                 }
                 this["LoginArea"] = loginArea;
             }))
             {
                 NotFound();
             }
         }
         else
         {
             Unauthorized();
         }
     }
 }