コード例 #1
0
ファイル: Competences.cs プロジェクト: ichari/ichari
 public Competences()
 {
     User = null;
 }
コード例 #2
0
ファイル: Competences.cs プロジェクト: ichari/ichari
 public Competences(Users user)
 {
     User = user;
 }
コード例 #3
0
ファイル: Cps.cs プロジェクト: ichari/ichari
        public Cps(Users user)
        {
            User = user;

            ID = -1;
            SiteID = user.SiteID;
            OwnerUserID = user.ID;
            Name = "";

            Url = "";
            LogoUrl = "";

            BonusScale = 0;

            ON = false;
            IsShow = true;

            Company = "";
            Address = "";
            PostCode = "";
            ResponsiblePerson = "";
            ContactPerson = "";
            Telephone = "";
            Fax = "";
            Mobile = "";
            Email = "";
            QQ = "";
            ServiceTelephone = "";
            MD5Key = "";
            Type = -1;
            DomainName = "";
            ParentID = -1;
            OperatorID = 1;
            CommendID = -1;
            DateTime = DateTime.Now;

            Content = null;
        }
コード例 #4
0
ファイル: PublicFunction.cs プロジェクト: ichari/ichari
    // 中奖的记录,发送通知
    public static void SendWinNotification(DataSet ds,string connStr)
    {
        if (ds == null)
        {
            return;
        }

        for (int i = 0; i < ds.Tables.Count; i++)
        {
            DataTable dt = ds.Tables[i];

            if (dt.Rows.Count < 1)
            {
                continue;
            }

            long SiteID = long.Parse(dt.Rows[0]["SiteID"].ToString());

            bool isWinSendEmail = (SLS.Dal.Functions.F_GetSiteSendNotificationTypes(connStr,SiteID, NotificationManners.Email).IndexOf("[" + NotificationTypes.Win + "]") >= 0);
            bool isWinSendSMS = (SLS.Dal.Functions.F_GetSiteSendNotificationTypes(connStr,SiteID, NotificationManners.SMS).IndexOf("[" + NotificationTypes.Win + "]") >= 0);
            bool isWinSendStationSMS = (SLS.Dal.Functions.F_GetSiteSendNotificationTypes(connStr,SiteID, NotificationManners.StationSMS).IndexOf("[" + NotificationTypes.Win + "]") >= 0);

            if (!isWinSendEmail && !isWinSendSMS && !isWinSendStationSMS)
            {
                continue;
            }

            Sites ts = new Sites()[SiteID];

            if (ts == null)
            {
                continue;
            }

            string Old_EmailSubject = "", Old_EmailBody = "";

            if (isWinSendEmail)
            {
                ts.SiteNotificationTemplates.SplitEmailTemplate(ts.SiteNotificationTemplates[NotificationManners.Email, NotificationTypes.Win], ref Old_EmailSubject, ref Old_EmailBody);
            }

            string Old_SMSBody = "";

            if (isWinSendSMS)
            {
                Old_SMSBody = ts.SiteNotificationTemplates[NotificationManners.SMS, NotificationTypes.Win];
            }

            string Old_StationSMSBody = "";

            if (isWinSendStationSMS)
            {
                Old_StationSMSBody = ts.SiteNotificationTemplates[NotificationManners.StationSMS, NotificationTypes.Win];
            }

            if (((Old_EmailSubject == "") || (Old_EmailBody == "")) && (Old_SMSBody == "") && (Old_StationSMSBody == ""))
            {
                continue;
            }

            for (int j = 0; j < dt.Rows.Count; j++)
            {
                DataRow dr = dt.Rows[j];

                Users tu = new Users(ts.ID)[ts.ID, long.Parse(dr["UserID"].ToString())];

                if (tu == null)
                {
                    continue;
                }

                //Send Email
                if (isWinSendEmail && (Old_EmailSubject != "") && (Old_EmailBody != "") && (tu.Email != "") && (SLS.Dal.Functions.F_GetIsSendNotification(connStr,ts.ID, NotificationManners.Email, NotificationTypes.Win, tu.ID)))
                {
                    string EmailSubject = Old_EmailSubject.Replace("[UserName]", tu.Name);
                    string EmailBody = Old_EmailBody.Replace("[UserName]", tu.Name).
                                                    Replace("[SchemeID]", dr["SchemeID"].ToString()).
                                                    Replace("[Money]", double.Parse(dr["WinMoney"].ToString()).ToString("N"));

                    PF.SendEmail(ts, tu.Email, EmailSubject, EmailBody);
                }

                //Send SMS
                if (isWinSendSMS && (Old_StationSMSBody != "") && (tu.Mobile != "") && tu.isMobileValided && (SLS.Dal.Functions.F_GetIsSendNotification(connStr,ts.ID, NotificationManners.SMS, NotificationTypes.Win, tu.ID)))
                {
                    string Body = Old_StationSMSBody.Replace("[UserName]", tu.Name).
                                                Replace("[SchemeID]", dr["SchemeID"].ToString()).
                                                Replace("[Money]", double.Parse(dr["WinMoney"].ToString()).ToString("N"));

                    PF.SendSMS(ts, tu.ID, tu.Mobile, Body);
                }

                //Send StationSMS
                if (isWinSendStationSMS && (Old_StationSMSBody != "") && SLS.Dal.Functions.F_GetIsSendNotification(connStr,ts.ID, NotificationManners.StationSMS, NotificationTypes.Win, tu.ID))
                {
                    string Body = Old_StationSMSBody.Replace("[UserName]", tu.Name).
                        Replace("[SchemeID]", dr["SchemeID"].ToString()).
                        Replace("[Money]", double.Parse(dr["WinMoney"].ToString()).ToString("N"));

                    PF.SendStationSMS(ts, ts.AdministratorID, tu.ID, StationSMSTypes.SystemMessage, Body);
                }
            }
        }
    }
コード例 #5
0
ファイル: Users.cs プロジェクト: ichari/ichari
        public int GetUserInformationByName(ref string ReturnDescription)
        {
            int ReturnValue = -1;
            ReturnDescription = "";

            Users tu = new Users(SiteID);
            Clone(tu);

            int Result = SLS.Dal.Procedures.P_GetUserInformationByName(PF.ConnectString,Name, SiteID, ref _id, ref NickName, ref RealityName, ref _password, ref _passwordadv, ref CityID,
                ref Sex, ref BirthDay, ref IDCardNumber, ref Address, ref Email, ref isEmailValided, ref QQ, ref isQQValided, ref Telephone, ref Mobile, ref isMobileValided, ref isPrivacy, ref isCanLogin,
                ref RegisterTime, ref LastLoginTime, ref LastLoginIP, ref LoginCount, ref UserType, ref BankType, ref BankName, ref BankCardNumber, ref Balance,
                ref Freeze, ref ScoringOfSelfBuy, ref ScoringOfCommendBuy, ref Scoring, ref Level, ref CommenderID, ref CpsID, ref OwnerSites, ref AlipayID, ref Bonus, ref Reward,
                ref AlipayName, ref isAlipayNameValided, ref ComeFrom, ref isCanLogin, ref Memo, ref BonusThisMonth, ref BonusAllow, ref BonusUse, ref PromotionMemberBonusScale, ref PromotionSiteBonusScale,
                ref VisitSource, ref HeadUrl, ref SecurityQuestion, ref SecurityAnswer, ref FriendList, ref ReturnValue, ref ReturnDescription);

            if (Result < 0)
            {
                tu.Clone(this);

                ReturnDescription = "数据库读写错误";

                return -1;
            }

            if (ReturnValue < 0)
            {
                tu.Clone(this);

                return ReturnValue;
            }

            cps.OwnerUserID = ID;

            ReturnDescription = "";
            cps.GetCpsInformationByOwnerUserID(ref ReturnDescription);

            if ((cps.SiteID > 0) && (cps.ID < 0))
            {
                ReturnDescription = "";
            }

            return 0;
        }
コード例 #6
0
ファイル: Users.cs プロジェクト: ichari/ichari
        public static Users GetCurrentUser(long siteid)
        {
            // 从 Cookie 中取出 UserID
            HttpCookie cookieUser = HttpContext.Current.Request.Cookies[ConfigurationManager.AppSettings["SiteCookieName"]];
            if ((cookieUser == null) || (String.IsNullOrEmpty(cookieUser.Values[ConfigurationManager.AppSettings["LotteryCookieName"]])))
            {
                return null;
            }

            string CookieUserID = cookieUser.Values[ConfigurationManager.AppSettings["LotteryCookieName"]];
            try
            {
                //CookieUserID = Shove._Security.Encrypt.UnEncryptString(PF.GetCallCert(), Shove._Security.Encrypt.Decrypt3DES(PF.GetCallCert(), CookieUserID, PF.DesKey));
                CookieUserID = DataEncryption.DecryptAES(CookieUserID);
            }
            catch
            {
                CookieUserID = "";
            }

            long UserID = -1;
            Users t_user = null;

            if (!String.IsNullOrEmpty(CookieUserID))
            {
                UserID = Shove._Convert.StrToLong(CookieUserID, -1);

                if (UserID > 0)
                {
                    t_user = new Users(siteid)[siteid, UserID];

                    if (t_user != null)
                    {
                        return t_user;
                    }
                }
            }

            return null;
        }
コード例 #7
0
ファイル: Users.cs プロジェクト: ichari/ichari
        public void Clone(Users user)
        {
            user._id = _id;
            user._siteid = _siteid;
            user._password = _password;
            user._passwordadv = _passwordadv;

            user.Name = Name;
            user.RealityName = RealityName;

            user.Sex = Sex;
            user.BirthDay = BirthDay;
            user.IDCardNumber = IDCardNumber;
            user.CityID = CityID;
            user.Address = Address;
            user.Email = Email;
            user.isEmailValided = isEmailValided;
            user.QQ = QQ;
            user.isQQValided = isQQValided;
            user.Telephone = Telephone;
            user.Mobile = Mobile;
            user.isMobileValided = isMobileValided;

            user.isPrivacy = isPrivacy;
            user.isCanLogin = isCanLogin;

            user.RegisterTime = RegisterTime;
            user.LastLoginTime = LastLoginTime;
            user.LastLoginIP = LastLoginIP;
            user.LoginCount = LoginCount;

            user.UserType = UserType;

            user.BankType = BankType;
            user.BankName = BankName;
            user.BankCardNumber = BankCardNumber;

            user.Balance = Balance;
            user.Freeze = Freeze;
            user.ScoringOfSelfBuy = ScoringOfSelfBuy;
            user.ScoringOfCommendBuy = ScoringOfCommendBuy;
            user.Scoring = Scoring;
            user.Bonus = Bonus;
            user.Reward = Reward;

            user.Level = Level;

            user.CommenderID = CommenderID;
            user.CpsID = CpsID;
            user.cps = cps;
            user.isAlipayCps = isAlipayCps;

            user.AlipayID = AlipayID;
            user.AlipayName = AlipayName;
            user.isAlipayNameValided = isAlipayNameValided;

            user.Site = Site;

            user.Competences = Competences;

            user.OwnerSites = OwnerSites;

            user.VisitSource = VisitSource;
        }
コード例 #8
0
ファイル: Users.cs プロジェクト: ichari/ichari
        public Users this[long siteid, string name]
        {
            get
            {
                Users user = new Users(siteid);

                user.Name = name;

                string ReturnDescription = "";

                if (user.GetUserInformationByName(ref ReturnDescription) < 0)
                {
                    return null;
                }

                return user;
            }
        }
コード例 #9
0
ファイル: Users.cs プロジェクト: ichari/ichari
        public Users this[long siteid, long id]
        {
            get
            {
                Users user = new Users(siteid);

                user.ID = id;

                return user;
            }
        }