Exemple #1
0
        public JsonResult AcceptRp(string id)
        {
            MembershipBll bll = new MembershipBll();
            int           res = bll.AcceptReplay(id);

            if (res >= 0)
            {
                return(RepReurnOK());
            }
            else if (res == -1)
            {
                return(RepReurnError("此消息已经过期"));
            }
            else if (res == -2)
            {
                return(RepReurnError("请先完善基本信息再参加比赛"));
            }
            else if (res == -3)
            {
                return(RepReurnError("你已经参加了本次比赛的一个队伍,不能接受其他队伍"));
            }
            else if (res == -9)
            {
                return(RepReurnError("参赛的队员年龄不能大于60岁或者小于16岁"));
            }
            else
            {
                return(RepReurnError("操作中出现错误"));
            }
        }
Exemple #2
0
        public JsonResult edituser(tblusers user)
        {
            if (!user.birthday.HasValue)
            {
                return(RepReurnError("请检查出生日期格式是否正确"));
            }

            MembershipBll bll = new MembershipBll();
            int           res = bll.UpdateUser(user);

            if (res >= 0)
            {
                return(RepReurnOK());
            }
            else if (res == -2)
            {
                return(RepReurnError("这个身份证号已经被注册"));
            }
            else if (res == -3)
            {
                return(RepReurnError("你的年龄不是在16-60之间"));
            }
            else
            {
                return(RepReurnError("操作中出现错误"));
            }
        }
Exemple #3
0
        public JsonResult replayer(string mobile, string mid)
        {
            if (UserInfo == null)
            {
                return(RepReurnError("请登录"));
            }

            MembershipBll bll = new MembershipBll();
            int           res = bll.Replayer(UserInfo.userid, mobile, mid);

            if (res > 0)
            {
                return(RepReurnOK());
            }
            else if (res == -1)
            {
                return(RepReurnError("更换队员已经参加了比赛"));
            }
            else if (res == -2)
            {
                return(RepReurnError("你不是队长,没有权限更换"));
            }
            else if (res == -3)
            {
                return(RepReurnError("替换的队员不存在"));
            }
            else
            {
                return(RepReurnError("输入的手机号没有注册或者信息不完善"));
            }
        }
Exemple #4
0
        public ActionResult Step4(string tid, string tp)
        {
            if (UserInfo == null)
            {
                return(RedirectToAction("login", "member"));
            }

            ViewBag.tp = tp;
            TeamRegBll bll = new TeamRegBll();

            ViewBag.tid = tid;
            var mbll = new MembershipBll();
            var usr  = mbll.GetUserByTeamId(tid);
            //var usr = bll.GetMatchuserById(tid, UserInfo.userid);

            var line = bll.GetLineById(tid);

            if (line == null)
            {
                return(RedirectToAction("Step3", new { tid = tid }));
            }

            ViewBag.cnt  = line.Playercount.Value - 1;
            ViewBag.lsts = line.Status;

            if (line.Matchid == "6a61b95b-2d5d-4373-abaf-bf4e4c438800")
            {
                ViewBag.lname = line.Lineno;
            }
            else
            {
                if (string.IsNullOrEmpty(line.Lineno))
                {
                    ViewBag.lname = line.Linename;
                }
                else
                {
                    ViewBag.lname = line.Lineno + "-" + line.Linename;
                }
            }

            var mt = bll.GetMatchByTeamid(tid);

            if (mt != null)
            {
                ViewBag.tp = ((mt.Status == "1" || mt.Status == "2" || mt.Status == "3") && mt.Paystatus == 6 && mt.chglines == "1") ? "1" : "";

                ViewBag.matchstatus = mt.Status;
                ViewBag.matchname   = mt.Match_name;
                ViewBag.tname       = mt.Teamname;
                ViewBag.leader      = (mt.userid == UserInfo.userid ? "1" : "0");
                ViewBag.date2       = mt.Date2.Value.ToString("yyyy年MM月dd日");
                if (mt.Paystatus == 1 || mt.Paystatus == 0)
                {
                    return(RedirectToAction("Step5", new { tid = tid }));
                }
            }

            return(View(usr));
        }
Exemple #5
0
        public JsonResult changeteam(tblteams tm)
        {
            if (UserInfo == null)
            {
                return(RepReurnError("请登录系统"));
            }

            MembershipBll bll = new MembershipBll();
            int           res = bll.changeteam(tm);

            if (res >= 0)
            {
                return(RepReurnOK());
            }
            else if (res == -1)
            {
                return(RepReurnError("队伍不存在"));
            }
            else if (res == -2)
            {
                return(RepReurnError("报名已经完成,不能修改"));
            }
            else if (res == -3)
            {
                return(RepReurnError("队伍名称重复,不能修改"));
            }
            else
            {
                return(RepReurnError("操作中出现错误"));
            }
        }
Exemple #6
0
        /// <summary>
        /// 获取验证码
        /// </summary>
        /// <param name="mobile"></param>
        /// <returns></returns>
        public JsonResult GetSMS(string mobile)
        {
            if (string.IsNullOrEmpty(mobile) || mobile.Trim().Length < 1)
            {
                return(RepReurnError("请输入手机号"));
            }

            System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex(@"^1(3|5|7|8)\d{9}$");
            if (!regex.IsMatch(mobile))
            {
                return(RepReurnError("手机号错误"));
            }

            if (mobile.Trim().Length > 15)
            {
                return(RepReurnError("手机号输入错误"));
            }
            if (mobile.Trim() == "4654984351984156")
            {
                return(RepReurnError("兄弟请收手吧!这样不好."));
            }

            string ip;

            if (!GetWebClientIp(out ip))
            {
                return(RepReurnError("错误访问"));
            }

            MembershipBll bll = new MembershipBll();
            SMSResponse   rep = new SMSResponse();
            int           res = bll.GetSMS(mobile.Trim(), ip, ref rep);

            ILog log = LogManager.GetLogger(this.GetType());

            log.Error(string.Format("[{0}-{1}]", rep.error, rep.msg));

            if (res == 1)
            {
                return(RepReurnOK());
            }
            else if (res == -1)
            {
                return(RepReurnError("这个手机号已经被注册"));
            }
            else if (res == -2)
            {
                return(RepReurnError("获取验证码次数太频繁,请于明日再进行"));
            }
            else if (res == -3)
            {
                return(RepReurnError("今日获取验证码次数太频繁,已被限制"));
            }
            else
            {
                return(RepReurnError("获取验证码时出现错误"));
            }
        }
Exemple #7
0
        //
        // GET: /pay/
        public ActionResult success_return()
        {
            SortedDictionary <string, string> sPara = GetRequestGet();

            WriteLog("success_return:", sPara);

            if (sPara.Count > 0)//判断是否有带返回参数
            {
                Notify aliNotify    = new Notify();
                bool   verifyResult = aliNotify.Verify(sPara, Request.QueryString["notify_id"], Request.QueryString["sign"]);

                if (verifyResult)//验证成功
                {
                    ViewBag.flag = "0";

                    //商户订单号
                    string out_trade_no = Request.QueryString["out_trade_no"];

                    //支付宝交易号
                    string trade_no = Request.QueryString["trade_no"];

                    //交易状态
                    string trade_status = Request.QueryString["trade_status"];

                    string buyer_email = Request.QueryString["buyer_email"];

                    MembershipBll bll = new MembershipBll();
                    bll.PayReturn(out_trade_no, trade_no, buyer_email, trade_status);

                    if (trade_status == "TRADE_FINISHED" || trade_status == "TRADE_SUCCESS" || trade_status == "9000")
                    {
                        var m = bll.GetMatchByOrderId(out_trade_no);

                        ViewBag.price = Request.QueryString["price"];
                        ViewBag.title = Request.QueryString["subject"];
                        ViewBag.no    = trade_no;
                        ViewBag.match = m.Match_name;
                        ViewBag.date  = m.Date4.Value.ToString("yyyy-MM-dd");
                        SMSHepler.SendCommonSms(m.Mobile, string.Format("[{0}]报名费用已经成功支付,感谢你的参与!请妥善保管帐号信息,等待查询比赛编组.", m.Match_name));
                    }
                }
                else//验证失败
                {
                    //Response.Write("验证失败");
                    ViewBag.flag = "1";
                }
            }
            else
            {
                //Response.Write("无返回参数");
                ViewBag.flag = "1";
            }

            return(View());
        }
Exemple #8
0
        public ActionResult myinfo()
        {
            if (UserInfo == null)
            {
                return(RedirectToAction("login", "member"));
            }

            MembershipBll bll = new MembershipBll();

            return(View(bll.GetMyinfo(UserInfo.userid)));
        }
Exemple #9
0
        public JsonResult CheckGSMS(string mobile, string vercode)
        {
            MembershipBll bll = new MembershipBll();
            int           res = bll.CheckGSms(mobile, vercode);

            if (res >= 0)
            {
                return(RepReurnOK());
            }
            else
            {
                return(RepReurnError("输入的验证码错误"));
            }
        }
Exemple #10
0
        /// <summary>
        /// 忘记密码,获取验证码
        /// </summary>
        /// <param name="mobile"></param>
        /// <returns></returns>
        public JsonResult GetGSMS(string mobile)
        {
            MembershipBll bll = new MembershipBll();
            int           res = bll.GetGSMS(mobile);

            if (res == -1)
            {
                return(RepReurnError("这个手机号不存在"));
            }
            else
            {
                return(RepReurnOK());
            }
        }
Exemple #11
0
        public JsonResult delteam(string tid)
        {
            MembershipBll bll = new MembershipBll();
            int           res = bll.DelTeam(tid);

            if (res >= 0)
            {
                return(RepReurnOK());
            }
            else
            {
                return(RepReurnError("操作中出现错误"));
            }
        }
Exemple #12
0
        public JsonResult Reject(string id, string uid)
        {
            MembershipBll bll = new MembershipBll();
            int           res = bll.RejectMatch(uid, id);

            if (res >= 0)
            {
                return(RepReurnOK());
            }
            else
            {
                return(RepReurnError("您已经接受了其余队伍或删除了报名数据,不能再次操作,请忽略此条信息"));
            }
        }
Exemple #13
0
        public JsonResult RejectRp(string id, string uid)
        {
            MembershipBll bll = new MembershipBll();
            int           res = bll.RejectReplay(id);

            if (res >= 0)
            {
                return(RepReurnOK());
            }
            else
            {
                return(RepReurnError("此消息已经过期"));
            }
        }
Exemple #14
0
        public ActionResult myfix(FormCollection fc)
        {
            if (UserInfo == null)
            {
                return(RedirectToAction("login", "member"));
            }

            string md5Pwd    = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(fc["password"], "MD5");
            string md5newPwd = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(fc["npassword"], "MD5");

            MembershipBll bll = new MembershipBll();
            int           res = bll.UpdatePwd(UserInfo.userid, md5Pwd, md5newPwd);

            ViewBag.flag = res;
            return(View());
        }
Exemple #15
0
        public JsonResult repwd(string m, string pwd)
        {
            string md5Pwd = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(pwd, "MD5");

            MembershipBll bll = new MembershipBll();
            int           res = bll.ResetPwd(m, md5Pwd);

            if (res < 0)
            {
                return(RepReurnError("不存在这个账户"));
            }
            else
            {
                return(RepReurnOK());
            }
        }
Exemple #16
0
        public JsonResult updpwd(string id, string pwd, string npwd)
        {
            string md5Pwd  = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(pwd, "MD5");
            string md5NPwd = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(npwd, "MD5");

            MembershipBll bll = new MembershipBll();
            int           res = bll.UpdatePwd(id, md5Pwd, md5NPwd);

            if (res < 0)
            {
                return(RepReurnError("请检查输入的旧密码是否正确"));
            }
            else
            {
                return(RepReurnOK());
            }
        }
Exemple #17
0
        /// <summary>
        /// 验证码检验
        /// </summary>
        /// <param name="mobile"></param>
        /// <param name="vercode"></param>
        /// <returns></returns>
        public JsonResult CheckSMS(string mobile, string vercode)
        {
            MembershipBll bll   = new MembershipBll();
            string        usrid = "";
            int           res   = bll.CheckSms(mobile, vercode, ref usrid);

            if (res >= 0)
            {
                return(RepReurn(0, usrid, null));
            }
            else if (res == -2)
            {
                return(RepReurnError("抱歉,这个号码已经被注册过"));
            }
            else
            {
                return(RepReurnError("输入的验证码错误"));
            }
        }
Exemple #18
0
        public ActionResult center(string m)
        {
            if (UserInfo == null)
            {
                return(RedirectToAction("login", "member"));
            }

            MembershipBll bll = new MembershipBll();

            //我的赛事
            ViewBag.mtlst = bll.GetMymatch(UserInfo.userid);
            //我的消息
            ViewBag.infolst = bll.GetMyinfo(UserInfo.userid);

            var mbll = new MembershipBll();
            var usr  = mbll.GetUserById(UserInfo.userid);

            return(View(usr));
        }
Exemple #19
0
        public JsonResult Accept(string id, string uid)
        {
            MembershipBll bll = new MembershipBll();
            int           res = bll.AcceptMatch(uid, id);

            if (res >= 0)
            {
                return(RepReurnOK());
            }
            else if (res == -1)
            {
                return(RepReurnError("您已经接受了其余队伍或删除了报名数据,不能再次操作,请忽略此条信息"));
            }
            else if (res == -2)
            {
                return(RepReurnError("你已经参加了本次比赛的一个队伍,不能接受其他队伍"));
            }
            else
            {
                return(RepReurnError("请先完善基本信息再参加比赛"));
            }
        }
Exemple #20
0
        public JsonResult checkpay(string tid)
        {
            MembershipBll bll   = new MembershipBll();
            var           order = bll.GetOrderByTeamId(tid);

            if (order.Status == 2)
            {
                return(RepReurnError("已经支付成功"));
            }

            var line = bll.GetLineById(tid);
            var tm   = new TeamRegBll().GetTeamById(tid);

            if (tm.Teamtype == 1)
            {
                return(RepReurnOK());
            }

            if (line.Linesid == "207bfe24-bef3-4e1d-95dc-22228e0e04e8")
            {
                return(RepReurnError("抱歉!您所选择的线路类型已经支付结束"));
            }
            else if (line.Linesid == "119eeb28-935e-479c-b157-1dd17e6427f6" || line.Linesid == "7e34f192-f909-4f2d-9f37-99a9ad7df092" || line.Linesid == "f0efcd04-10d0-4a96-91ea-1f2e7e374250")
            {
                return(RepReurnError("抱歉!您所选择的线路类型目前还没有开始支付"));
            }

            string msg = bll.CheckPay(order.Id, line.Paycount.Value, order.Match_Id);

            if (!string.IsNullOrEmpty(msg))
            {
                return(RepReurnError(msg));
            }
            else
            {
                return(RepReurnOK());
            }
        }
Exemple #21
0
        public ActionResult my(FormCollection fc)
        {
            if (UserInfo == null)
            {
                return(RedirectToAction("login", "member"));
            }

            var model = new tblusers();

            DateTime sr;

            if (DateTime.TryParse(fc["txtsr"], out sr))
            {
                model.birthday = sr;
            }
            model.cardno   = fc["txtcard"];
            model.cardtype = fc["cbxcardtype"];
            model.Mobile   = fc["txtmobile"];
            model.Name     = fc["txtname"];
            model.sexy     = fc["cbxsexy"];
            model.Isupt    = "1";

            model.userid = UserInfo.userid;

            MembershipBll bll = new MembershipBll();
            int           res = bll.UpdateUser(model);

            if (res < 0)
            {
                model.Status = -999;
            }
            else
            {
                model.Status = -888;
            }

            return(View(model));
        }
Exemple #22
0
        public JsonResult releader(string mid)
        {
            if (UserInfo == null)
            {
                return(RepReurnError("请登录"));
            }

            MembershipBll bll = new MembershipBll();
            int           res = bll.ReLeader(UserInfo.userid, mid);

            if (res > 0)
            {
                return(RepReurnOK());
            }
            else if (res == -1)
            {
                return(RepReurnError("你不是队长,没有权限更换"));
            }
            else
            {
                return(RepReurnError("操作中出现错误"));
            }
        }
Exemple #23
0
        public JsonResult checkuser(string acc, string pwd)
        {
            string md5Pwd = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(pwd, "MD5");

            MembershipBll bll  = new MembershipBll();
            tblusers      user = bll.GetUser(acc, md5Pwd);

            string ip;

            GetWebClientIp(out ip);

            if (user == null)
            {
                bll.OptLog(1, "", ip, string.Format("用户[{0}]登录失败", acc));
                return(RepReurnError("用户名或者密码输入错误"));
            }
            else
            {
                bll.UpdateUserLastTime(user.userid);

                bll.OptLog(1, user.userid, ip, string.Format("用户[{0}]成功登录", acc));

                //保存用户信息
                HttpCookie cookie = new HttpCookie("coc_cookie_info");
                cookie.HttpOnly = false;
                //cookie.Expires = DateTime.Now.AddDays(7);
                System.Collections.Specialized.NameValueCollection nv = new System.Collections.Specialized.NameValueCollection();
                nv.Add("uuid", user.userid);
                nv.Add("uunm", user.Name);
                cookie.Values.Add(nv);

                HttpContext.Response.SetCookie(cookie);

                return(RepReurn(0, user.Type, null));
            }
        }
Exemple #24
0
        public ContentResult notify_return()
        {
            SortedDictionary <string, string> sPara = GetRequestPost();

            WriteLog("notify_return:", sPara);

            if (sPara.Count > 0)//判断是否有带返回参数
            {
                Notify aliNotify    = new Notify();
                bool   verifyResult = aliNotify.Verify(sPara, Request.Form["notify_id"], Request.Form["sign"]);

                //if (verifyResult)//验证成功
                {
                    /////////////////////////////////////////////////////////////////////////////////////////////////////////////
                    //请在这里加上商户的业务逻辑程序代码


                    //——请根据您的业务逻辑来编写程序(以下代码仅作参考)——
                    //获取支付宝的通知返回参数,可参考技术文档中服务器异步通知参数列表

                    //商户订单号

                    string out_trade_no = Request.Form["out_trade_no"];

                    //支付宝交易号

                    string trade_no = Request.Form["trade_no"];

                    //交易状态
                    string trade_status = Request.Form["trade_status"];

                    string buyer_email = Request.Form["buyer_email"];

                    if (trade_status == "TRADE_FINISHED" || trade_status == "TRADE_SUCCESS" || trade_status == "9000")
                    {
                        MembershipBll bll = new MembershipBll();
                        bll.PayReturn(out_trade_no, trade_no, buyer_email, trade_status);

                        var m = bll.GetMatchByOrderId(out_trade_no);

                        //log4net.ILog log = log4net.LogManager.GetLogger(this.GetType());
                        //log.Fatal(trade_status);
                        SMSHepler.SendCommonSms(m.Mobile, string.Format("[{0}]报名费用已经成功支付,感谢你的参与!请妥善保管帐号信息,等待查询比赛编组.", m.Match_name));
                    }

                    //——请根据您的业务逻辑来编写程序(以上代码仅作参考)——

                    //Response.Write("success");  //请不要修改或删除

                    return(this.Content("success"));
                    /////////////////////////////////////////////////////////////////////////////////////////////////////////////
                }
                //else//验证失败
                //{
                //Response.Write("fail");
                //    return this.Content("fail");
                //}
            }
            else
            {
                //Response.Write("无通知参数");
                return(this.Content("无通知参数"));
            }
        }
Exemple #25
0
        public ActionResult my()
        {
            MembershipBll bll = new MembershipBll();

            return(View(bll.GetUserById(UserInfo.userid)));
        }
Exemple #26
0
        public void createpay(string teamid)
        {
            MembershipBll bll   = new MembershipBll();
            var           order = bll.GetOrderByTeamId(teamid);
            var           cnt   = new TeamBll().GetPaycountByTeamid(teamid);

            var tm = new TeamRegBll().GetTeamById(teamid);

            if (tm.Teamtype != 1)
            {
                string msg = bll.CheckPay(order.Id, cnt, order.Match_Id);

                if (!string.IsNullOrEmpty(msg) && msg != "正在支付,请等待")
                {
                    ViewBag.msg = msg;
                    return;
                }
            }

            //商户订单号,商户网站订单系统中唯一订单号,必填
            string out_trade_no = order.Orderid;

            //订单名称,必填
            string subject = order.Title;

            //付款金额,必填
            string total_fee = order.Ordertotal;

            //商品描述,可空
            string body = order.Title;


            ViewBag.title = order.Title;
            ViewBag.total = order.Ordertotal;

            //把请求参数打包成数组
            SortedDictionary <string, string> sParaTemp = new SortedDictionary <string, string>();

            sParaTemp.Add("service", Config.service);
            sParaTemp.Add("partner", Config.partner);
            sParaTemp.Add("seller_id", Config.seller_id);
            sParaTemp.Add("_input_charset", Config.input_charset.ToLower());
            sParaTemp.Add("payment_type", Config.payment_type);
            sParaTemp.Add("notify_url", Config.notify_url);
            sParaTemp.Add("return_url", Config.return_url);
            sParaTemp.Add("anti_phishing_key", Config.anti_phishing_key);
            sParaTemp.Add("exter_invoke_ip", Config.exter_invoke_ip);
            sParaTemp.Add("out_trade_no", out_trade_no);
            sParaTemp.Add("subject", subject);
            sParaTemp.Add("total_fee", total_fee);
            sParaTemp.Add("body", body);
            sParaTemp.Add("it_b_pay", Config.it_b_pay);

            //其他业务参数根据在线开发文档,添加参数.文档地址:https://doc.open.alipay.com/doc2/detail.htm?spm=a219a.7629140.0.0.O9yorI&treeId=62&articleId=103740&docType=1
            //如sParaTemp.Add("参数名","参数值");

            //建立请求
            string sHtmlText = Submit.BuildRequest(sParaTemp, "get", "确认");

            Response.Write(sHtmlText);
        }