예제 #1
0
        public object Register(string nickname, string acc, string pwd)
        {
            if (RegexUtil.IsEmail(acc))
            {
                DataTable dt = MemberBll.Instance.GetList("Email='" + acc + "'").Tables[0];
                if (dt.Rows.Count > 0)
                {
                    return(new Dictionary <string, string>()
                    {
                        { "status", "400" }, { "message", "该邮箱已被注册" }
                    });
                }
            }
            else
            {
                DataTable dt = MemberBll.Instance.GetList($"Phone_mob='{acc}'").Tables[0];
                if (dt.Rows.Count > 0)
                {
                    return(new Dictionary <string, string>()
                    {
                        { "status", "403" }, { "message", "该手机号已经注册" }
                    });
                }
            }

            string status = MemberApi.Register(nickname, acc, pwd);

            return(new Dictionary <string, string>()
            {
                { "status", "200" }, { "message", status }
            });
        }
예제 #2
0
        public void ProcessRequest(HttpContext context)
        {
            string         examine        = context.Request.Form["Examine"];
            string         exId           = context.Request.Form["Exid"];
            string         s              = "{\"status\":\"error\"}";
            bool           b              = false;
            ExchangeEntity exchangeEntity = ExchangeBll.Instance.GetModel(int.Parse(exId));

            if (examine == "3")   //加身家
            {
                string       userId       = exchangeEntity.UserId;
                MemberEntity memberEntity = MemberBll.Instance.GetModel(int.Parse(userId));
                MemberApi.SendMail(memberEntity.nickname, "您发布的兑换已被确认!", memberEntity.Email);
                string official = exchangeEntity.Official;
                MemberBll.Instance.UpdateIntegral(userId, "Shenjia", official);
            }

            exchangeEntity.Examine = examine;
            b = ExchangeBll.Instance.Update(exchangeEntity);

            if (b)
            {
                s = "{\"status\":\"success\"}";
            }
            context.Response.ContentType = "text/plain";
            context.Response.Charset     = "utf-8";
            context.Response.Write(s);
        }
예제 #3
0
 public ActionResult Member([FromBody] MemberApi memberApi)
 {
     if (memberApi == null)
     {
         return(Json(new ResultsJson(new Message(CodeMessage.PostNull, "PostNull"), null)));
     }
     return(Json(Global.BUSS.BussResults(this, memberApi)));
 }
예제 #4
0
        public ApiContainer(string appKey, string appSecret, string url = AppStoreManager.DEFAULT_URL)
        {
            var passportBag = AppStoreManager.GetPassportBag(appKey);
            if (passportBag == null || passportBag.Passport == null)
            {
                AppStoreManager.ApplyPassport(appKey, appSecret, url);
            }

            Passport = AppStoreManager.GetPassportBag(appKey).Passport;//执行SdkManager.ApplyPassport后,PassportCollection[appKey]必定存在

            MemberApi = new MemberApi(Passport);
        }
예제 #5
0
        public ApiContainer(string appKey, string appSecret, string url = AppStoreManager.DEFAULT_URL)
        {
            var passportBag = AppStoreManager.GetPassportBag(appKey);

            if (passportBag == null || passportBag.Passport == null)
            {
                AppStoreManager.ApplyPassport(appKey, appSecret, url);
            }

            Passport = AppStoreManager.GetPassportBag(appKey).Passport;//执行SdkManager.ApplyPassport后,PassportCollection[appKey]必定存在

            MemberApi = new MemberApi(Passport);
        }
예제 #6
0
        public ActionResult AddActivity(string Phone, int ID)
        {
            _companyApi  = new CompanyApi("https://control.mysupport247.net", "Mysupport247", "SwitchvoxAPI", "mH5219b2vri0KUa", "NovaramCred1");
            _activityApi = new ActivityApi("https://control.mysupport247.net", "Mysupport247", "SwitchvoxAPI", "mH5219b2vri0KUa", "NovaramCred1");

            string conditions = "ID=" + ID;

            List <CompanyFindResult> list2 = _companyApi.FindCompanies(conditions, "CompanyName asc", new int?(100000), new int?(0), new List <string>
            {
                "Id",
                "CompanyName",
                "CompanyIdentifier"
            });

            _memberApi = new MemberApi("https://control.mysupport247.net", "Mysupport247", "SwitchvoxAPI", "mH5219b2vri0KUa", "NovaramCred1");

            List <MemberFindResult> MembersList = _memberApi.FindMembers("", "FirstName asc", new int?(1000), new int?(0), new List <string>
            {
                "Id",
                "MemberIdentifier",
                "FirstName",
                "LastName"
            });
            var membersQuery = MembersList.Select(a => new
            {
                MemberIdentifier = a.MemberIdentifier,
                Name             = a.FirstName + " " + a.LastName
            }).ToList();

            ViewBag.MembersList = new SelectList(membersQuery.AsEnumerable(), "MemberIdentifier", "Name");


            List <ActivityFindResult> ActivityTypeList = _activityApi.FindActivities("", "Id asc", new int?(1000), new int?(0), new List <string>
            {
                "ActivityTypeDescription"
            });
            var query = ActivityTypeList.Where(a => a.ActivityTypeDescription != null).Select(a => new
            {
                a.ActivityTypeDescription
            }).Distinct().ToList();

            ViewBag.ActivityList = new SelectList(query.AsEnumerable(), "ActivityTypeDescription", "ActivityTypeDescription");

            ActivityModel model = new ActivityModel();

            model.Phone             = Phone;
            model.ContactId         = GetContactsId(Phone);
            model.CompanyIdentifier = list2.FirstOrDefault().CompanyIdentifier;
            model.CompanyName       = list2.FirstOrDefault().CompanyName;
            return(View("AddActivity", model));
        }
예제 #7
0
        /// <summary>
        /// 绑定兑换的人员
        /// </summary>
        /// <param name="exId">分享的id</param>
        /// <returns></returns>
        protected string GetExchangePerson(string exId)
        {
            DataTable     exPersonTable = ExchangePersonBll.Instance.GetList($"ep.Status>0 AND ep.Examine='1' AND ExId='{exId}'", "ep.AddTime DESC").Tables[0];
            StringBuilder s             = new StringBuilder();

            if (exPersonTable.Rows.Count > 0)
            {
                s.Append("<a href=\"projects.html\">");
                s.AppendFormat("<img alt=\"image\" class=\"img-circle\" src=\"{0}\" title=\"{1}\"></a>", MemberApi.GetPortraitUrl(exPersonTable.Rows[0]["User_id"].ToString()), MemberApi.GetNickname((exPersonTable.Rows[0]["User_id"].ToString())));
                s.Append("</a>");
            }
            return(s.ToString());
        }
예제 #8
0
        public void ProcessRequest(HttpContext context)
        {
            string    nickname = context.Request.Form["user[nickname]"];
            string    email    = context.Request.Form["user[email]"];
            string    pwd      = context.Request.Form["user[pwd]"];
            string    s        = "{\"status\":\"error\"}";
            bool      b        = false;
            DataTable dt       = MemberBll.Instance.GetList("Email='" + email + "'").Tables[0];

            if (dt.Rows.Count > 0)
            {
                s = "{\"status\":\"exist\"}";
                return;
            }

            MemberEntity memberEntity = new MemberEntity();

            memberEntity.User_name = "";
            memberEntity.Email     = email;
            memberEntity.Password  = DEncryptUtils.Encrypt3DES(pwd);
            memberEntity.Real_name = "";
            memberEntity.nickname  = nickname;
            memberEntity.Gender    = memberEntity.Birthday = memberEntity.Phone_tel = memberEntity.Phone_mob = memberEntity.Im_qq = memberEntity.Im_msn
                                                                                                                                        = memberEntity.In_skype = memberEntity.Im_yahoo = memberEntity.Im_aliww = memberEntity.Outer_id
                                                                                                                                                                                                                      = memberEntity.Feed_config = "";
            memberEntity.Portrait   = "/Upload/Portrait/1.jpg";
            memberEntity.Reg_time   = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
            memberEntity.Last_login = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
            memberEntity.Last_ip    = new BasePage().ClientIP;
            memberEntity.Logins     = 0;
            memberEntity.Ugrade     = 1;
            memberEntity.Status     = 1;
            memberEntity.reward     = 0;
            memberEntity.CNbi       = 0;
            memberEntity.integral   = 0;
            memberEntity.ardent     = 0;
            memberEntity.Growth     = 0;
            memberEntity.code       = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(Guid.NewGuid().ToString(), "MD5");
            memberEntity.Activation = "0";
            memberEntity.Describe   = "";
            memberEntity.Shenjia    = 0;
            memberEntity.Bean       = "0";

            StringBuilder mailBody = new StringBuilder();

            mailBody.AppendFormat(EmailConfig.Instance._EmailBody, memberEntity.nickname, HttpContext.Current.Request.Url.Host, memberEntity.code);

            //发送注册邮件
            b = MemberApi.SendRegisterMail(memberEntity.nickname, memberEntity.code, memberEntity.Email);
            if (b)
            {
                b = MemberBll.Instance.Add(memberEntity) > 0;
                if (b)
                {
                    CookieHelper cookieHelper = new CookieHelper("52cos", DateTime.Now.AddMonths(1));
                    dt = MemberBll.Instance.GetList("Email='" + memberEntity.Email + "' and Password='******'").Tables[0];
                    cookieHelper.SetCookie("user_id", DEncryptUtils.DESEncrypt(dt.Rows[0]["User_id"].ToString())); //将user_id添加到cookie
                    cookieHelper.SetCookie("pwd", memberEntity.Password);                                          //将Password添加到cookie
                    s = "{\"status\":\"success\"}";
                }
            }


            context.Response.ContentType = "text/plain";
            context.Response.Write(s);
        }