コード例 #1
0
 protected override void OnLoad(EventArgs e)
 {
     this.AlipayLoginSrcUrl = base.ResolveUrl("~/Home/Room/images/zfb_button2.jpg");
     this.LoginTopSrcUrl = base.ResolveUrl("~/Home/Room/images/login_top.jpg");
     this.LoginBackSrcUrl = base.ResolveUrl("~/Home/Room/images/login_back.jpg");
     this.RegisterUrl = base.ResolveUrl("~/UserReg.aspx");
     this.ForgetPwdUrl = base.ResolveUrl("~/Home/Room/ForgetPassword.aspx");
     this.AlipayLoginUrl = base.ResolveUrl("~/Home/Room/Login.aspx");
     this.LoginIframeUrl = base.ResolveUrl("~/Home/Room/UserLoginDialog.aspx");
     this._Site = new Sites()[1L];
     this._User = Users.GetCurrentUser(this._Site.ID);
     base.OnLoad(e);
 }
コード例 #2
0
ファイル: PF.cs プロジェクト: NoobSkie/taobao-shop-helper
 public static int SendStationSMS(Sites Site, long SourceUserID, long AimUserID, short StationSMSType, string Content)
 {
     new Tables.T_StationSMS { SiteID = { Value = Site.ID }, SourceID = { Value = SourceUserID }, AimID = { Value = AimUserID }, Type = { Value = StationSMSType }, Content = { Value = Content }, isRead = { Value = (bool)false } }.Insert();
     return 0;
 }
コード例 #3
0
ファイル: PF.cs プロジェクト: NoobSkie/taobao-shop-helper
 public static int SendSMS(Sites Site, long UserID, string Mobile, string Content)
 {
     if ((Site == null) || (Site.ID < 0L))
     {
         return -1;
     }
     new Tables.T_SMS { SiteID = { Value = Site.ID }, SMSID = { Value = -1 }, From = { Value = "" }, To = { Value = Mobile }, Content = { Value = Content }, IsSent = { Value = false } }.Insert();
     return 0;
 }
コード例 #4
0
ファイル: PF.cs プロジェクト: NoobSkie/taobao-shop-helper
 public static int SendEmail(Sites Site, string MailTo, string Subject, string Body)
 {
     new SendEmailTask(Site, MailTo, Subject, Body).Run();
     return 0;
 }
コード例 #5
0
ファイル: Users.cs プロジェクト: NoobSkie/taobao-shop-helper
 public Users(long siteid)
 {
     this.Site = new Sites();
     this.HeadUrl = "";
     this.cps = new Cps(this);
     this.Competences = new Competences(this);
     this.SiteID = siteid;
     this._id = -1L;
     this.Name = "";
     this.NickName = "";
     this.RealityName = "";
     this.Password = "";
     this.PasswordAdv = "";
     this.Sex = "男";
     this.BirthDay = DateTime.Parse("1980-01-01");
     this.IDCardNumber = "";
     this.CityID = 1;
     this.Address = "";
     this.Email = "";
     this.isEmailValided = false;
     this.QQ = "";
     this.isQQValided = false;
     this.Telephone = "";
     this.Mobile = "";
     this.isMobileValided = false;
     this.isPrivacy = false;
     this.isCanLogin = true;
     this.RegisterTime = DateTime.Now;
     this.LastLoginTime = DateTime.Now;
     try
     {
         this.LastLoginIP = HttpContext.Current.Request.UserHostAddress;
     }
     catch
     {
         this.LastLoginIP = "";
     }
     this.LoginCount = 0;
     this.UserType = 1;
     this.BankType = 1;
     this.BankName = "";
     this.BankCardNumber = "";
     this.Balance = 0.0;
     this.cardPasswordM = 0.0;
     this.Freeze = 0.0;
     this.ScoringOfSelfBuy = 0.0;
     this.ScoringOfCommendBuy = 0.0;
     this.Scoring = 0.0;
     this.Level = 0;
     this.CommenderID = -1L;
     this.CpsID = -1L;
     this.isAlipayCps = false;
     this.Bonus = 0.0;
     this.Reward = 0.0;
     this.AlipayID = "";
     this.AlipayName = "";
     this.isAlipayNameValided = false;
     this.Memo = "";
     this.BonusThisMonth = 0.0;
     this.BonusAllow = 0.0;
     this.BonusUse = 0.0;
     this.PromotionMemberBonusScale = 0.0;
     this.PromotionSiteBonusScale = 0.0;
     this.OwnerSites = "";
     this.ComeFrom = 0;
     this.IsCrossLogin = false;
     this.VisitSource = "";
     this.HeadUrl = "";
     this.SecurityQuestion = "";
     this.SecurityAnswer = "";
     this.FriendList = "";
     this.Reason = "";
 }
コード例 #6
0
ファイル: Users.cs プロジェクト: NoobSkie/taobao-shop-helper
 public Users()
 {
     this.Site = new Sites();
     this.HeadUrl = "";
     throw new Exception("不能用无参数的 Users 类的构造来申明实例。此无参数构造函数是为了能使其序列化。");
 }
コード例 #7
0
 public SiteNotificationTemplates(Sites site)
 {
     this.Site = site;
 }
コード例 #8
0
 public SiteOptions(Sites site)
 {
     this.Site = site;
 }
コード例 #9
0
ファイル: Sites.cs プロジェクト: NoobSkie/taobao-shop-helper
 public int GetSiteInformationByUrl(ref string ReturnDescription)
 {
     if ((this.Url == null) || (this.Url == ""))
     {
         throw new Exception("Sites 尚未初始化 Url 变量,无法获取信息");
     }
     int returnValue = -1;
     ReturnDescription = "";
     Sites site = new Sites();
     this.Clone(site);
     if (Procedures.P_GetSiteInformationByUrl(this.Url, ref this.ID, ref this.ParentID, ref this.OwnerUserID, ref this.Name, ref this.LogoUrl, ref this.Company, ref this.Address, ref this.PostCode, ref this.ResponsiblePerson, ref this.ContactPerson, ref this.Telephone, ref this.Fax, ref this.Mobile, ref this.Email, ref this.QQ, ref this.ServiceTelephone, ref this.ICPCert, ref this.Level, ref this.ON, ref this.BonusScale, ref this.MaxSubSites, ref this.UseLotteryListRestrictions, ref this.UseLotteryList, ref this.UseLotteryListQuickBuy, ref this._urls, ref this.AdministratorID, ref this.PageTitle, ref this.PageKeywords, ref returnValue, ref ReturnDescription) < 0)
     {
         site.Clone(this);
         ReturnDescription = "数据库读写错误";
         return -1;
     }
     if (returnValue < 0)
     {
         site.Clone(this);
         return returnValue;
     }
     this.Urls = this._urls;
     return 0;
 }
コード例 #10
0
        protected override void OnLoad(EventArgs e)
        {
            if (!base.IsPostBack)
            {
                new FirstUrl().Save();
            }
            this.PageUrl = base.Request.Url.AbsoluteUri;
            this._Site = new Sites()[1L];
            if (this._Site == null)
            {
                PF.GoError(1, "域名无效,限制访问", "SitePageBase");
            }
            else
            {
                this._User = Users.GetCurrentUser(this._Site.ID);
                if (this.isRequestLogin && (this._User == null))
                {
                    PF.GoLogin(this.RequestLoginPage, this.isAtFramePageLogin);
                }
                else
                {
                    try
                    {
                        PlaceHolder holder = this.Page.FindControl("phHead") as PlaceHolder;
                        if (holder != null)
                        {
                            UserControl child = this.Page.LoadControl("~/Home/Room/UserControls/WebHead.ascx") as UserControl;
                            holder.Controls.Add(child);
                        }
                        PlaceHolder holder2 = this.Page.FindControl("phFoot") as PlaceHolder;
                        if (holder2 != null)
                        {
                            UserControl control2 = this.Page.LoadControl("~/Home/Room/UserControls/WebFoot.ascx") as UserControl;
                            holder2.Controls.Add(control2);
                        }
                    }
                    catch
                    {
                    }
                    string str = ((base.Request.Url.Query == "") ? base.Request.Url.AbsoluteUri : base.Request.Url.AbsoluteUri.Replace(base.Request.Url.Query, "")).Replace(Utility.GetUrl(), "").Replace("/", "_").Replace(".aspx", "");
                    if (str.StartsWith("_"))
                    {
                        str = str.Remove(0, 1);
                    }
                    if (FloatNotifyPageList.IndexOf("," + str + ",") > -1)
                    {
                        StringBuilder builder = new StringBuilder();
                        string key = "FloatNotifyContent";
                        DataTable cacheAsDataTable = Shove._Web.Cache.GetCacheAsDataTable(key);
                        if (cacheAsDataTable == null)
                        {
                            cacheAsDataTable = new Tables.T_FloatNotify().Open("", "", "[Order] asc,[DateTime] desc");
                            if ((cacheAsDataTable != null) && (cacheAsDataTable.Rows.Count > 0))
                            {
                                Shove._Web.Cache.SetCache(key, cacheAsDataTable, 0xea60);
                            }
                        }
                        bool flag = false;
                        int num = this._Site.SiteOptions["Opt_FloatNotifiesTime"].ToInt(3);
                        string name = "LastLoginShowFloatNotifyUserID";
                        switch (num)
                        {
                            case 1:
                                {
                                    HttpCookie cookie = base.Request.Cookies[name];
                                    if ((cookie != null) && !string.IsNullOrEmpty(cookie.Value))
                                    {
                                        flag = true;
                                    }
                                    break;
                                }
                            case 2:
                                flag = DateTime.Now.Minute == 0;
                                break;

                            case 3:
                                flag = true;
                                break;
                        }
                        if (((cacheAsDataTable != null) && (cacheAsDataTable.Rows.Count > 0)) && flag)
                        {
                            DataRow[] rowArray = cacheAsDataTable.Select("isShow=1");
                            for (int i = 0; i < rowArray.Length; i++)
                            {
                                if (i == 2)
                                {
                                    break;
                                }
                                int num4 = i + 1;
                                builder.Append("<font color='" + rowArray[i]["Color"].ToString() + "'>").Append(num4.ToString()).Append(".</font>").Append("<a href='").Append(rowArray[i]["Url"].ToString()).Append("' target='_blank' style='text-decoration: none;color:").Append(rowArray[i]["Color"].ToString()).Append(";' onmouseover=\"this.style.color='#ff6600';\" onmouseout=\"this.style.color='").Append(rowArray[i]["Color"].ToString()).Append("';\">").Append(rowArray[i]["Title"].ToString()).Append("</a><br />");
                            }
                            string html = HmtlManage.GetHtml(AppDomain.CurrentDomain.BaseDirectory + "Home/Web/Template/FloatNotify.html");
                            Label label = new Label();
                            int num5 = FloatNotifyTimeOut * 100;
                            label.Text = html.Replace("$FloatNotifyTimeOut$", num5.ToString()).Replace("$FloatNotifyContent$", builder.ToString());
                            try
                            {
                                base.Form.Controls.AddAt(0, label);
                            }
                            catch (Exception exception)
                            {
                                new Log("Page").Write(str + exception.Message);
                            }
                            HttpCookie cookie2 = new HttpCookie(name)
                            {
                                Value = "",
                                Expires = DateTime.Now.AddYears(-20)
                            };
                            try
                            {
                                HttpContext.Current.Response.Cookies.Add(cookie2);
                            }
                            catch
                            {
                            }
                        }
                    }
                    if (this.isAllowPageCache && (this.PageCacheSeconds > 0))
                    {
                        base.Response.Cache.SetExpires(DateTime.Now.AddSeconds((double)this.PageCacheSeconds));
                        base.Response.Cache.SetCacheability(HttpCacheability.Server);
                        base.Response.Cache.VaryByParams["*"] = true;
                        base.Response.Cache.SetValidUntilExpires(true);
                        base.Response.Cache.SetVaryByCustom("SitePage");
                    }
                    base.OnLoad(e);
                }
            }
        }
コード例 #11
0
ファイル: Sites.cs プロジェクト: NoobSkie/taobao-shop-helper
 public void Clone(Sites site)
 {
     site.ID = this.ID;
     site.ParentID = this.ParentID;
     site.OwnerUserID = this.OwnerUserID;
     site.Name = this.Name;
     site.LogoUrl = this.LogoUrl;
     site.Company = this.Company;
     site.Address = this.Address;
     site.PostCode = this.PostCode;
     site.ResponsiblePerson = this.ResponsiblePerson;
     site.ContactPerson = this.ContactPerson;
     site.Telephone = this.Telephone;
     site.Fax = this.Fax;
     site.Mobile = this.Mobile;
     site.Email = this.Email;
     site.QQ = this.QQ;
     site.ServiceTelephone = this.ServiceTelephone;
     site.ICPCert = this.ICPCert;
     site.Level = this.Level;
     site.ON = this.ON;
     site.BonusScale = this.BonusScale;
     site.MaxSubSites = this.MaxSubSites;
     site.UseLotteryListRestrictions = this.UseLotteryListRestrictions;
     site.UseLotteryList = this.UseLotteryList;
     site.UseLotteryListQuickBuy = this.UseLotteryListQuickBuy;
     site.AdministratorID = this.AdministratorID;
     site._urls = this._urls;
     site.Url = this.Url;
     site.SiteNotificationTemplates = this.SiteNotificationTemplates;
     site.SiteOptions = this.SiteOptions;
     site.PageTitle = this.PageTitle;
     site.PageKeywords = this.PageKeywords;
 }
コード例 #12
0
ファイル: Sites.cs プロジェクト: NoobSkie/taobao-shop-helper
 public Sites this[long siteid]
 {
     get
     {
         Sites sites = new Sites
         {
             ID = siteid
         };
         string returnDescription = "";
         if (sites.GetSiteInformationByID(ref returnDescription) < 0)
         {
             return null;
         }
         return sites;
     }
 }
コード例 #13
0
ファイル: Sites.cs プロジェクト: NoobSkie/taobao-shop-helper
 public Sites this[string url]
 {
     get
     {
         string str = "Site_";
         Sites sites = null;
         try
         {
             sites = (Sites)HttpContext.Current.Application[str + url];
         }
         catch
         {
         }
         if (sites == null)
         {
             sites = new Sites
             {
                 Url = url
             };
             string returnDescription = "";
             if (sites.GetSiteInformationByUrl(ref returnDescription) < 0)
             {
                 return null;
             }
             try
             {
                 HttpContext.Current.Application.Lock();
                 HttpContext.Current.Application.Add(str + url, sites);
             }
             catch
             {
             }
             finally
             {
                 try
                 {
                     HttpContext.Current.Application.UnLock();
                 }
                 catch
                 {
                 }
             }
         }
         return sites;
     }
 }
コード例 #14
0
ファイル: PF.cs プロジェクト: NoobSkie/taobao-shop-helper
 public static void SendWinNotification(DataSet ds)
 {
     if (ds != null)
     {
         for (int i = 0; i < ds.Tables.Count; i++)
         {
             DataTable table = ds.Tables[i];
             if (table.Rows.Count >= 1)
             {
                 long siteID = long.Parse(table.Rows[0]["SiteID"].ToString());
                 bool flag = Functions.F_GetSiteSendNotificationTypes(siteID, 2).IndexOf("[Win]") >= 0;
                 bool flag2 = Functions.F_GetSiteSendNotificationTypes(siteID, 1).IndexOf("[Win]") >= 0;
                 bool flag3 = Functions.F_GetSiteSendNotificationTypes(siteID, 3).IndexOf("[Win]") >= 0;
                 if ((flag || flag2) || flag3)
                 {
                     Sites site = new Sites()[siteID];
                     if (site != null)
                     {
                         string subject = "";
                         string body = "";
                         if (flag)
                         {
                             site.SiteNotificationTemplates.SplitEmailTemplate(site.SiteNotificationTemplates[2, "Win"], ref subject, ref body);
                         }
                         string str3 = "";
                         if (flag2)
                         {
                             str3 = site.SiteNotificationTemplates[1, "Win"];
                         }
                         string str4 = "";
                         if (flag3)
                         {
                             str4 = site.SiteNotificationTemplates[3, "Win"];
                         }
                         if (((subject != "") && (body != "")) || ((str3 != "") || (str4 != "")))
                         {
                             for (int j = 0; j < table.Rows.Count; j++)
                             {
                                 DataRow row = table.Rows[j];
                                 Users users = new Users(site.ID)[site.ID, long.Parse(row["UserID"].ToString())];
                                 if (users != null)
                                 {
                                     if (((flag && (subject != "")) && ((body != "") && (users.Email != ""))) && Functions.F_GetIsSendNotification(site.ID, 2, "Win", users.ID))
                                     {
                                         string str5 = subject.Replace("[UserName]", users.Name);
                                         string str6 = body.Replace("[UserName]", users.Name).Replace("[SchemeID]", row["SchemeID"].ToString()).Replace("[Money]", double.Parse(row["WinMoney"].ToString()).ToString("N"));
                                         SendEmail(site, users.Email, str5, str6);
                                     }
                                     if (((flag2 && (str4 != "")) && ((users.Mobile != "") && users.isMobileValided)) && Functions.F_GetIsSendNotification(site.ID, 1, "Win", users.ID))
                                     {
                                         string content = str4.Replace("[UserName]", users.Name).Replace("[SchemeID]", row["SchemeID"].ToString()).Replace("[Money]", double.Parse(row["WinMoney"].ToString()).ToString("N"));
                                         SendSMS(site, users.ID, users.Mobile, content);
                                     }
                                     if ((flag3 && (str4 != "")) && Functions.F_GetIsSendNotification(site.ID, 3, "Win", users.ID))
                                     {
                                         string str8 = str4.Replace("[UserName]", users.Name).Replace("[SchemeID]", row["SchemeID"].ToString()).Replace("[Money]", double.Parse(row["WinMoney"].ToString()).ToString("N"));
                                         SendStationSMS(site, site.AdministratorID, users.ID, 2, str8);
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }
コード例 #15
0
 public SiteNotificationTemplates()
 {
     this.Site = null;
 }
コード例 #16
0
ファイル: PF.cs プロジェクト: NoobSkie/taobao-shop-helper
 public static bool ValidLotteryID(Sites Site, int LotteryID)
 {
     return (("," + Site.UseLotteryList + ",").IndexOf("," + LotteryID.ToString() + ",") >= 0);
 }
コード例 #17
0
 public SiteOptions()
 {
     this.Site = null;
 }