Exemplo n.º 1
0
 // Token: 0x060000C8 RID: 200 RVA: 0x0001373C File Offset: 0x0001193C
 protected override void View()
 {
     base.Response.Expires      = 0;
     base.Response.CacheControl = "no-cache";
     base.Response.Cache.SetNoStore();
     this.channelinfo = ChannelBll.GetChannelInfo("exam_question");
     if (this.channelinfo.id == 0)
     {
         this.ShowErr("对不起,目前系统尚未创建题目库频道。");
     }
     else
     {
         this.examinfo = DbHelper.ExecuteModel <ExamInfo>(this.examid);
         if (this.examinfo.id == 0)
         {
             this.ShowErr("对不起,该考试不存在或已被删除。");
         }
         else
         {
             if (this.examinfo.status == 0)
             {
                 if (!this.isperm && this.examinfo.uid != this.userid)
                 {
                     this.ShowErr("对不起,该考试已关闭。");
                     return;
                 }
             }
             this.sortid   = this.examinfo.sortid;
             this.sortinfo = SortBll.GetSortInfo(this.sortid);
             if (this.sortinfo.id == 0)
             {
                 SqlParam sqlParam = DbHelper.MakeAndWhere("sortid", this.sortid);
                 DbHelper.ExecuteDelete <ExamInfo>(new SqlParam[]
                 {
                     sqlParam
                 });
                 this.ShowErr("对不起,考试栏目不存在或已被删除。");
             }
             else if (this.ispost)
             {
                 if (this.examinfo.examroles != "")
                 {
                     if (!base.ischecked(this.roleid, this.examinfo.examroles) && !this.isperm)
                     {
                         this.ShowErr("对不起,您所在的角色不允许参加本场考试。");
                         return;
                     }
                 }
                 if (this.examinfo.examdeparts != "")
                 {
                     if (!base.ischecked(this.user.departid, this.examinfo.examdeparts) && !this.isperm)
                     {
                         this.ShowErr("对不起,您所在的部门不允许参加本场考试。");
                         return;
                     }
                 }
                 if (this.examinfo.examuser != "")
                 {
                     if (!base.ischecked(this.userid, this.examinfo.examuser) && !this.isperm)
                     {
                         this.ShowErr("对不起,您不允许参加本场考试。");
                         return;
                     }
                 }
                 if (this.examinfo.islimit == 1)
                 {
                     if (this.examinfo.starttime > DateTime.Now)
                     {
                         this.ShowErr("对不起,本场考试尚未到考试时间。");
                         return;
                     }
                     if (this.examinfo.endtime < DateTime.Now)
                     {
                         this.ShowErr("对不起,本场考试已超过考试期限。");
                         return;
                     }
                 }
                 SqlParam[] sqlparams = new SqlParam[]
                 {
                     DbHelper.MakeAndWhere("examid", this.examid),
                     DbHelper.MakeAndWhere("uid", this.userid),
                     DbHelper.MakeAndWhere("status", 0)
                 };
                 int num = DbHelper.ExecuteCount <ExamResult>(sqlparams);
                 if (num > 0)
                 {
                     this.ShowErr("对不起,本场考试您已经考过但尚未完成,请到考试历史那里查找。");
                 }
                 else
                 {
                     if (this.examinfo.repeats > 0)
                     {
                         SqlParam[] sqlparams2 = new SqlParam[]
                         {
                             DbHelper.MakeAndWhere("examid", this.examid),
                             DbHelper.MakeAndWhere("uid", this.userid),
                             DbHelper.MakeAndWhere("status", WhereType.GreaterThanEqual, 1)
                         };
                         num = DbHelper.ExecuteCount <ExamResult>(sqlparams2);
                         if (num >= this.examinfo.repeats)
                         {
                             this.ShowErr("对不起,本场考试限制次数为" + this.examinfo.repeats + "次,您已考完不能再考。");
                             return;
                         }
                     }
                     if (this.examinfo.credits > 0 && !this.isperm && this.examinfo.uid != this.userid)
                     {
                         if (this.user.credits < this.examinfo.credits)
                         {
                             this.ShowErr("对不起,您的积分余额不足,不能参加本场考试。");
                             return;
                         }
                         UserBll.UpdateUserCredit(this.userid, "参加考试", 0, this.examinfo.credits * -1);
                     }
                     Random           random        = new Random();
                     int              paper         = random.Next(this.examinfo.papers) + 1;
                     List <ExamTopic> examTopicList = ExamBll.GetExamTopicList(this.examid, paper);
                     int              num2          = 0;
                     for (int i = 0; i < examTopicList.Count; i++)
                     {
                         examTopicList[i].questionlist = QuestionBll.GetTopicQuestion(this.channelinfo.id, examTopicList[i]);
                         string[] array = FPUtils.SplitString(examTopicList[i].questionlist);
                         if (this.examinfo.display == 0)
                         {
                             examTopicList[i].questionlist = QuestionBll.GetRandom(array, array.Length);
                         }
                         examTopicList[i].optionlist = "";
                         foreach (ExamQuestion examQuestion in QuestionBll.GetQuestionList(examTopicList[i].questionlist))
                         {
                             if (examTopicList[i].optionlist != "")
                             {
                                 ExamTopic examTopic = examTopicList[i];
                                 examTopic.optionlist += "|";
                             }
                             if (examQuestion.type == 1 || examQuestion.type == 2)
                             {
                                 ExamTopic examTopic2 = examTopicList[i];
                                 examTopic2.optionlist += this.OptionInt(examQuestion.ascount, this.examinfo.optiondisplay);
                             }
                             else
                             {
                                 ExamTopic examTopic3 = examTopicList[i];
                                 examTopic3.optionlist += "*";
                             }
                         }
                         num2 += array.Length;
                         examTopicList[i].questions = array.Length;
                     }
                     ExamResult examResult = new ExamResult();
                     examResult.uid         = this.userid;
                     examResult.examid      = this.examid;
                     examResult.channelid   = this.channelinfo.id;
                     examResult.sortid      = this.examinfo.sortid;
                     examResult.examtype    = this.examinfo.examtype;
                     examResult.showanswer  = this.examinfo.showanswer;
                     examResult.allowdelete = this.examinfo.allowdelete;
                     examResult.examname    = this.examinfo.name;
                     examResult.examtime    = this.examinfo.examtime;
                     examResult.total       = this.examinfo.total;
                     examResult.passmark    = this.examinfo.passmark;
                     examResult.credits     = this.examinfo.credits;
                     examResult.questions   = num2;
                     examResult.islimit     = this.examinfo.islimit;
                     if (examResult.islimit == 1)
                     {
                         examResult.starttime = this.examinfo.starttime;
                         examResult.endtime   = this.examinfo.endtime;
                     }
                     else
                     {
                         examResult.starttime = DbUtils.GetDateTime();
                         examResult.endtime   = examResult.starttime.AddMinutes((double)this.examinfo.examtime);
                     }
                     examResult.examdatetime = DbUtils.GetDateTime();
                     examResult.status       = 0;
                     examResult.paper        = paper;
                     examResult.ip           = this.ip;
                     examResult.mac          = ExamConifgs.GetMacAddress(this.ip);
                     examResult.id           = DbHelper.ExecuteInsert <ExamResult>(examResult);
                     if (examResult.id > 0)
                     {
                         foreach (ExamTopic examTopic4 in examTopicList)
                         {
                             DbHelper.ExecuteInsert <ExamResultTopic>(new ExamResultTopic
                             {
                                 resultid     = examResult.id,
                                 type         = examTopic4.type,
                                 title        = examTopic4.title,
                                 perscore     = examTopic4.perscore,
                                 display      = examTopic4.display,
                                 questions    = examTopic4.questions,
                                 questionlist = examTopic4.questionlist,
                                 optionlist   = examTopic4.optionlist
                             });
                         }
                         if (this.examinfo.examdeparts == "" && this.examinfo.examuser == "" && this.examinfo.examroles == "")
                         {
                             string text = string.Format("UPDATE [{0}Exam_ExamInfo] SET [exams]=[exams]+1 WHERE [id]={1}", DbConfigs.Prefix, this.examid);
                             DbHelper.ExecuteSql(text.ToString());
                         }
                     }
                     base.Response.Redirect("exam.aspx?resultid=" + examResult.id);
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
        public void ProcessRequest(HttpContext context)
        {
            if (context.Request.HttpMethod == "POST")
            {
                string sFromHost = context.Request.UrlReferrer.Host;
                context.Response.Cookies["fromhost"].Value   = sFromHost;
                context.Response.Cookies["fromhost"].Expires = DateTime.Now.AddHours(1);
                string sAccount = CYRequest.GetFormString("quickaccount");//充值账号
                int    iUserID  = UserBll.UserIDSel(sAccount);
                if (iUserID < 1000)
                {
                    context.Response.Write("<script>alert('充值账号不存在!');</script>");
                    return;
                }

                string  sPayNums = CYRequest.GetFormString("quickpayprice");//充值金额
                decimal dPrice   = 0;
                decimal.TryParse(sPayNums, out dPrice);
                if (dPrice < 10)
                {
                    context.Response.Redirect("PayPErr.aspx?err=204");
                    return;
                }

                string sGameAbbre   = CYRequest.GetFormString("quickservername");
                string sGameIsLogin = PayAll.ValUserLoginGame(sGameAbbre, iUserID.ToString());
                if ("1" == sGameIsLogin)
                {
                    context.Response.Redirect("PayGErr.aspx?err=202");
                    return;
                }

                string sGameAbbreC = string.Empty;
                if (sGameAbbre.IndexOf("sq") == -1)
                {
                    sGameAbbreC = sGameAbbre;
                }
                else
                {
                    string sRoleID = CYRequest.GetFormString("quickrole");
                    sGameAbbreC = string.Format("{0}|{1}", sGameAbbre, sRoleID);
                }
                string sPhone    = CYRequest.GetFormString("quickphone");
                string sChannel  = CYRequest.GetFormString("quickchannel");
                int    iCount    = 1;
                string sBankName = string.Empty;
                if (sChannel == "ibank")
                {
                    sBankName = CYRequest.GetFormString("quickbank");
                }
                string sPayDirect = string.Empty;
                if (sChannel == "tenpay")
                {
                    string  sTranIP     = ProvideCommon.GetRealIP();
                    string  sPTranID    = TransPBLL.PointSalesInit(sChannel, sPhone, sAccount, dPrice, iCount, sTranIP);
                    decimal dFeeScale   = ChannelBLL.FeeScaleSel(sChannel);
                    int     iGamePoints = System.Convert.ToInt32(dPrice * 10 * dFeeScale);
                    int     iPayUserID  = UserBll.UserIDSel(sAccount);
                    string  sGTranID    = TransGBLL.GameSalesInit(sGameAbbre, iGamePoints, sAccount, sPhone, iPayUserID, sTranIP);
                    TranQuickBLL.TranQuickAdd(sGTranID, sPTranID);
                    sPayDirect = TenPayBuy.QuickPayBegin(sPTranID, sAccount, dPrice, sGameAbbreC, context);
                }
                else if (sChannel == "szfphone")
                {
                    string  sTranIP     = ProvideCommon.GetRealIP();
                    string  sPTranID    = TransPBLL.PointSalesInit(sChannel, sPhone, sAccount, dPrice, iCount, sTranIP);
                    decimal dFeeScale   = ChannelBLL.FeeScaleSel(sChannel);
                    int     iGamePoints = System.Convert.ToInt32(dPrice * 10 * dFeeScale);
                    int     iPayUserID  = UserBll.UserIDSel(sAccount);
                    string  sGTranID    = TransGBLL.GameSalesInit(sGameAbbre, iGamePoints, sAccount, sPhone, iPayUserID, sTranIP);
                    TranQuickBLL.TranQuickAdd(sGTranID, sPTranID);
                    string cardTypeCombine = CYRequest.GetFormString("quickcardTypeCombine");
                    sPayDirect = SzfPayBuy.QuickPayBegin(sPTranID, sAccount, dPrice, sGameAbbreC, "0", cardTypeCombine);
                }
                else
                {
                    sPayDirect = PayAll.QuickPay(sChannel, sPhone, sAccount, dPrice, iCount, sBankName, sGameAbbreC);
                }
                context.Response.Write(sPayDirect);
            }
        }
Exemplo n.º 3
0
        public string FirstGift(string sGameName, string sAccount, string sMultiPP, string sHost)
        {
            if (sMultiPP.Length < 10)
            {
                return("pplengthissmall");
            }
            string sBeginTime = ServerBLL.ServerTimeSel(sGameName);

            if (!FirstGiftBLL.valTime(sBeginTime))
            {
                return("timeerr");
            }
            if (sHost.Length < 4)
            {
                return("hostlenerr");
            }
            int iUserID = UserBll.UserIDSel(sAccount);

            if (!ProvideCommon.valMultiPP(iUserID, sMultiPP))
            {
                return("pperr");
            }
            string sGiftState = FirstGiftBLL.GiftStateSel(iUserID, sGameName);
            int    iPoint     = 10;
            string sTranIP    = ProvideCommon.GetRealIP();
            string sGiftRes   = string.Empty;
            string sRes       = string.Empty;

            switch (sGiftState)
            {
            case "0":
                sGiftRes = FirstGiftBLL.GiftToGame(iUserID, sGameName, sAccount, iPoint, sTranIP, sHost);
                if (sGiftRes == "0")
                {
                    sRes = "0";
                    FirstGiftBLL.GiftStateUpate(iUserID, sGameName, 1);
                }
                else
                {
                    sRes = sGiftRes;
                }
                break;

            case "1":
                sRes = "1";
                break;

            case "2":
                sRes = "7";
                break;

            default:
                string sLevel = FirstGiftBLL.ULevelSel(iUserID, sGameName);
                int    iLevel = 0;
                int.TryParse(sLevel, out iLevel);
                int iTrueLevel = GameLevelSel(sGameName);
                if (iLevel > iTrueLevel)
                {
                    FirstGiftBLL.GiftAdd(iUserID, iLevel, sGameName);
                    sGiftRes = FirstGiftBLL.GiftToGame(iUserID, sGameName, sAccount, iPoint, sTranIP, sHost);
                    if (sGiftRes == "0")
                    {
                        FirstGiftBLL.GiftStateUpate(iUserID, sGameName, 1);
                        sRes = "0";
                    }
                    else
                    {
                        FirstGiftBLL.GiftStateUpate(iUserID, sGameName, 0);
                        sRes = sGiftRes;
                    }
                }
                else
                {
                    sRes = "2";
                    //sRes = string.Format("2|{0}",iTrueLevel.ToString());
                }
                break;
            }
            return(sRes);
        }
        // GET: RoomReg
        public ActionResult Index(long roomId)
        {
            var user    = UserContext.CurrentUser;
            var hotelId = user.HotelId;

            var room = RoomBll.GetById(roomId);

            var globalFeeSet = GlobalFeeSetBll.GetByHotelId(hotelId);

            ViewBag.HotelId      = hotelId;
            ViewBag.RoomId       = roomId;
            ViewBag.GlobalFeeSet = globalFeeSet;
            var      now      = DateTime.Now;
            DateTime yuLiTime = now;

            //如果是6点,那么当天6点之后开的房间就是第二天中午退房,0点到6点开房就是当天中午退房
            if (now.Hour >= 0 && now.Hour <= globalFeeSet.QTAfterPointToNextDay)
            {
                //当天中午退房
                yuLiTime = now.Date.AddHours(globalFeeSet.QTExitPoint);
            }
            else
            {
                //第二天中午退房
                yuLiTime = now.Date.AddDays(1).AddHours(globalFeeSet.QTExitPoint);
            }

            //var yltime = "";
            //if (now.Hour > globalFeeSet.QTAfterPointToNextDay)
            //{
            //    //第二天退房
            //    yltime = now.AddDays(1).ToShortDateString() + $" {globalFeeSet.QTExitPoint}:00:00";
            //}
            //else
            //{
            //    //当天退房
            //    yltime = now.ToShortDateString() + $" {globalFeeSet.QTExitPoint}:00:00";
            //}
            ViewBag.CurrentTime = now.ToString("yyyy-MM-dd HH:mm:ss");
            ViewBag.yltime      = yuLiTime.ToString("yyyy-MM-dd HH:mm:ss");
            var my = UserBll.GetById(user.Id);

            ViewBag.MyKdzk = my == null ? 10 : my.CanSale;
            //获取登记单
            var roomReg = new Model.RoomReg();

            if (room != null)
            {
                if (room.FjState == FjStateEnum.干净房)
                {
                    roomReg = new Model.RoomReg();
                }
                else
                {
                    roomReg = RoomRegBll.GetById(room.RoomRegId);
                    if (roomReg == null)
                    {
                        roomReg = new Model.RoomReg();
                    }
                }
                if ((int)roomReg.FjState >= (int)FjStateEnum.脏房)
                {
                    // return Content("房间状态不允许开房登记");
                }
                //if(roomReg.FjState ==4)
                //    roomReg = new Model.RoomReg();
            }
            ViewBag.PanelHeight = 300;
            if (Session["PanelHeight"] != null)
            {
                ViewBag.PanelHeight = Convert.ToInt32(Session["PanelHeight"]);
            }
            if (room == null)
            {
                room = new Room();
                ViewBag.IsEmptyRoom = true;
            }
            else
            {
                ViewBag.IsEmptyRoom = false;
            }
            ViewBag.Room = room;
            return(View(roomReg));
        }
Exemplo n.º 5
0
        //protected void btnAdd_OnClick(object sender, EventArgs e)
        //{
        //    Response.Redirect("AddUserAddress.aspx");
        //    //var addrs = UserBll.GetUserAddressesByUserId(YeUser.UserID);
        //    //if (addrs.Count==3)
        //    //{
        //    //    WebUtil.Alert("You have got 3 Addresses!It's Limited.",this);
        //    //    return;
        //    //}
        //    //if (UserBll.AddUserAddress(new Ye_UserAddress()
        //    //{
        //    //    UserID = YeUser.UserID,
        //    //    Address = tbxAddress.Text,
        //    //    Zip = "",
        //    //    AptSuite = "",
        //    //    Receiver = tbxReceiver.Text,
        //    //    Mobile = tbxMobile.Text,
        //    //    IsDefault = addrs.Count==0
        //    //}))
        //    //{
        //    //    BindData();
        //    //}
        //    //else
        //    //{
        //    //    WebUtil.Alert("Sorry,something wrong happens.", this);
        //    //}
        //}

        private void BindData()
        {
            rpt.DataSource = UserBll.GetUserAddressesByUserId(YeUser.UserID);
            rpt.DataBind();
        }
Exemplo n.º 6
0
 protected int AccountVal(string sAccount)
 {
     return(UserBll.AccountsVal(sAccount));
 }
Exemplo n.º 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.RequestType == "POST")
            {
                string sAccountVal = CYRequest.GetFormString("account").Trim();
                string sPassWord   = CYRequest.GetFormString("password").Trim();
                if (sAccountVal.Length < 4 && sPassWord.Length < 4)
                {
                    return;
                }
                string sState       = string.Empty;
                string sMD5PassWord = UserBll.PassWordMD5(sAccountVal, sPassWord);
                sState = UserBll.UserVal(sAccountVal, sMD5PassWord);
                string sWWWUrl = string.Format("{0}/{1}?un={2}", sWUrl, "usercookie.aspx", sAccountVal);
                string sKey    = ConfigurationManager.AppSettings["UserValKey"].ToString();
                string sBBSUrl = DiscuzUserI.BBSLogin(sAccountVal, sPassWord, sKey);
                string sJSUrl  = string.Format("<script src='{0}'></script><script src='{1}'></script>", sBBSUrl, sWWWUrl);
                if ("0" == sState)
                {
                    int    iUserID  = UserBll.UserIDSel(sAccountVal);
                    string sPageUrl = Request.Url.ToString();
                    LoginStateSet(sAccountVal, iUserID, sPageUrl);
                    string sGameName = CYRequest.GetFormString("gname");
                    if (sGameName != "" && sGameName != "unsafe string")
                    {
                        sMsg = string.Format("{0}<script>window.location.href='{1}/GCenter/PlayGame.aspx?gn={2}'</script>", sJSUrl, sRootUrl, sGameName);
                        return;
                    }
                    else
                    {
                        string sFormUrl = CYRequest.GetFormString("url");
                        sMsg = string.Format("{0}<script>window.location.href='{1}';</script>", sJSUrl, sFormUrl);
                        return;
                    }
                }
                else
                {
                    string sMD5PassWordNew = UserBll.PassWordMD5New(sAccountVal, sPassWord);
                    if ("0" == UserBll.UserVal(sAccountVal, sMD5PassWordNew))
                    {
                        int    iUserID  = UserBll.UserIDSel(sAccountVal);
                        string sPageUrl = Request.Url.ToString();
                        LoginStateSet(sAccountVal, iUserID, sPageUrl);
                        string sGameName = CYRequest.GetFormString("gname");
                        if (sGameName != "" && sGameName != "unsafe string")
                        {
                            sMsg = string.Format("{0}<script>window.location.href='{1}/GCenter/PlayGame.aspx?gn={2}'</script>", sJSUrl, sRootUrl, sGameName);
                            return;
                        }
                        else
                        {
                            string sFormUrl = CYRequest.GetFormString("url");
                            sMsg = string.Format("{0}<script>window.location.href='{1}';</script>", sJSUrl, sFormUrl);
                            return;
                        }
                    }
                    else
                    {
                        sUrl = CYRequest.GetFormString("url");
                        sMsg = "<script>alert('用户信息输入错误,验证失败!')</script>";
                        return;
                    }
                }
            }
            sGName = CYRequest.GetString("gn");
            string sGetUrl = CYRequest.GetString("url");

            if (sGetUrl == "" || sGetUrl == "unsafe string")
            {
                if (sGName != "" && sGName != "unsafe string")
                {
                    sUrl = string.Format("{0}/GCenter/PlayGame.aspx?gn={1}", sRootUrl, sGName);
                }
                else
                {
                    sUrl = string.Format("{0}/yhzx/", sWUrl);
                }
            }
            else
            {
                sUrl = sGetUrl;
            }
            if (LoginSessionVal() || isLoginCookie())
            {
                Response.Redirect(sUrl, true);
            }
        }
Exemplo n.º 8
0
 public async Task UpdateUser(UserBll userBll)
 {
     await this.tableTableStore.UpdateTableEntity(UserEntity.FromUserBll(userBll));
 }
Exemplo n.º 9
0
 public UserService()
 {
     db    = Bll.NewBllNoRelation();
     dbSet = db.Users;
 }
Exemplo n.º 10
0
 public UserService(Bll bll)
 {
     this.db = bll;
     dbSet   = db.Users;
 }
Exemplo n.º 11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.HttpMethod == "POST" || Request.HttpMethod == "GET")
            {
                //StringBuilder sbTextLog = new StringBuilder();
                //sbTextLog.Append(Server.MapPath("~/Log"));
                //sbTextLog.Append("/noreg");
                //string sPath = sbTextLog.ToString();
                //ProvideCommon pcObject = new ProvideCommon();
                //sbTextLog.Remove(0, sbTextLog.Length);
                //sbTextLog.AppendFormat("{0},{1}", Request.Url.ToString(), DateTime.Now.ToString());
                //pcObject.WriteLogFile(sPath, "noreglogin", sbTextLog.ToString());
                string sSecond = CYRequest.GetString("second");
                if (sSecond.Length > 0)
                {
                    int.TryParse(sSecond, out iSecond);
                }
                string sWebUrl  = WebConfig.BaseConfig.sWUrl;
                string uniqueid = CYRequest.GetString("uniqueid");
                sGameName = CYRequest.GetString("game");
                string        sign   = CYRequest.GetString("sign");
                string        sKey   = "1!s@k#d)}w[l<>";
                StringBuilder sbText = new StringBuilder();
                sbText.Append(uniqueid);
                sbText.Append(sGameName);
                sbText.Append(sKey);
                string sValSign = ProvideCommon.MD5(sbText.ToString()).ToLower();
                if (sign == sValSign)
                {
                    if (!NoRegLoginBLL.NoRegLoginUnionidSel(uniqueid))
                    {
                        Response.Write("uniqueid 重复!");
                        return;
                    }
                    string sUserName = string.Format("?{0}", ProvideCommon.GenerateStringID());
                    int    iTypeID   = 1;
                    int    iState    = 1;
                    string sPassWord = "";
                    int    iUID      = UserBll.UserReg(sUserName, sPassWord, iTypeID, iState);
                    if (iUID > 1000)
                    {
                        string sPageUrl = Request.Url.ToString();
                        LoginStateSet(sUserName, iUID, sPageUrl);
                        NoRegLoginBLL.NoRegLoginAdd(iUID, uniqueid, sGameName);
                        NoRegLoginBLL.AddUserid(uniqueid, iUID.ToString());
                        if (sGameName.Length > 0)
                        {
                            string sGame = GameInfoBLL.GameInfoAbbreSel(sGameName).TrimEnd();
                            switch (sGame)
                            {
                            case "lj":
                            case "yjxy":
                            case "sq":
                            case "hzw":
                            case "xlfc":
                            case "dxz":
                            case "djj":
                            case "zl":
                            case "fswd2":
                            case "txj":
                            case "ljer":
                            case "sjsg":
                            case "tzcq":
                            case "zsg":
                            case "wssg":
                            case "by":
                            case "nz":
                            case "mjcs":
                                if (ProvideCommon.valTime(DateTime.Now.ToString(), ServerBLL.ServerTimeSel(sGameName)))
                                {
                                    sQueryString = string.Format("?gn={0}", sGameName);
                                    sUrl         = string.Format("/frame/g_mainframe_{0}.aspx{1}", sGame, sQueryString);
                                }
                                break;

                            case "tssg":
                                string fuid = CYRequest.GetString("fuid");
                                sQueryString = string.Format("?gn={0}&fuid={1}", sGameName, fuid);
                                sUrl         = string.Format("/frame/g_mainframe_{0}.aspx{1}", sGame, sQueryString);
                                break;

                            default:
                                sUrl = string.Format("/GCenter/PlayGame.aspx?gn={0}", sGameName);
                                break;
                            }
                        }
                        else
                        {
                            Response.StatusCode       = 301;
                            Response.Status           = "301 Moved Permanently";
                            Response.RedirectLocation = string.Format("{0}/yxzx/", sWebUrl);
                            Response.End();
                        }
                    }
                    else
                    {
                        Response.Write("<script>alert('注册失败!');location.href='http://www.dao50.com/';</script>");
                    }
                }
                else
                {
                    Response.Write("sign error");
                }
            }
        }
Exemplo n.º 12
0
 private void DataUpdate()
 {
     try
     {
         this.dbo = new DB_OPT();
         this.dbo.Open();
         if (((this.txtbh.Text.Trim() == "") || (this.txtName.Text.Trim() == "")) || ((this.txtssbmpk.Value.Trim() == "") || (this.txtssjspk.Value.Trim() == "")))
         {
             Const.ShowMessage("带*的数据必须填写!", this.Page);
         }
         else
         {
             string strEditMess = "";
             if (!PageDo.IsChanged(ref strEditMess, true, this.Page) && (this.txtxbbak.Text == this.rblsex1.SelectedIndex.ToString()))
             {
                 Const.ShowMessage("没有修改任何信息,请修改信息后再保存!", this.Page);
             }
             else
             {
                 if (this.txtxbbak.Text != this.rblsex1.SelectedIndex.ToString())
                 {
                     string str2 = strEditMess;
                     strEditMess = str2 + "性别从 " + this.txtxbbak.Text + " 修改为 " + this.rblsex1.SelectedIndex.ToString();
                 }
                 string strUser = base.Request.QueryString["PK"].ToString().Trim();
                 EmployeeModel model = new EmployeeDal
                 {
                     EmployeePK = strUser,
                     BH = this.txtbh.Text.Trim(),
                     Name = this.txtName.Text.Trim(),
                     Sex = this.rblsex1.SelectedItem.Value
                 };
                 if (this.txtage.Text.Trim() != "")
                 {
                     model.Age = int.Parse(this.txtage.Text.Trim());
                 }
                 if (this.txtworkage.Text.Trim() != "")
                 {
                     model.WorkAge = int.Parse(this.txtworkage.Text.Trim());
                 }
                 model.MZ = this.txtmz.Text.Trim();
                 model.Nationals = this.txtnational.Text.Trim();
                 model.Province = this.txtprovince.Text.Trim();
                 model.Area = this.txtarea.Text.Trim();
                 model.City = this.txtcity.Text.Trim();
                 model.PostalCode = this.txtpostcode.Text.Trim();
                 model.Address = this.txtaddress.Text.Trim();
                 model.Phone = this.txthousetel.Text.Trim();
                 model.OfficePhone = this.txtofficetel.Text.Trim();
                 model.Mobile1 = this.txtmobile1.Text.Trim();
                 model.Mobile2 = this.txtmobile2.Text.Trim();
                 model.QQNum = this.txtqq.Text.Trim();
                 model.ICQNum = this.txticq.Text.Trim();
                 model.MSNNum = this.txtmsn.Text.Trim();
                 model.Email = this.txtemail.Text.Trim();
                 if (this.txtBirthDay.Value.Trim() != "")
                 {
                     model.BirthDay = DateTime.Parse(this.txtBirthDay.Value.Trim());
                 }
                 model.OtherLink = this.txtother.Text.Trim();
                 model.BranchPK = this.txtssbmpk.Value.Trim();
                 model.RolePK = this.txtssjspk.Value.Trim();
                 model.pk_corp = this.txtssgspk.Value.Trim();
                 if (model.Update(this.dbo) > 0)
                 {
                     UserModel model2 = new UserDal
                     {
                         EmployeePK = strUser
                     };
                     if (model2.ExistsByEmpPK(this.dbo) > 0)
                     {
                         UserBll bll = new UserBll();
                         if (bll.Updateuserinfo(strUser, this.txtssbmpk.Value, this.txtssjspk.Value.Trim(), this.txtName.Text, this.txtssgspk.Value.Trim(), this.dbo) <= 0)
                         {
                             Const.DoSuccessClose("修改员工信息成功,但联动修改用户信息失败,请手动修改用户信息!", this.Page);
                         }
                     }
                     Const.DoSuccessClose("修改员工信息成功!", this.Page);
                     strEditMess = "编号为:" + this.txtbh.Text.Trim() + " 名称为:" + this.txtName.Text.Trim() + " 的职员修改信息:" + strEditMess;
                     OperationLogBll.insertOp("修改", "职员列表", strEditMess, "Y", this.Page);
                 }
                 else
                 {
                     Const.ShowMessage("", this.Page);
                 }
             }
         }
     }
     catch (Exception exception)
     {
         this.el = new ExceptionLog.ExceptionLog();
         this.el.ErrClassName = base.GetType().ToString();
         this.el.ErrMessage = exception.Message.ToString();
         this.el.ErrMethod = "DataUpdate()";
         this.el.WriteExceptionLog(true);
         Const.OpenErrorPage("操作失败,请联系管理员!", this.Page);
     }
     finally
     {
         if (this.dbo != null)
         {
             this.dbo.Close();
         }
     }
 }
Exemplo n.º 13
0
 private void ToBeUser(int index)
 {
     try
     {
         if ((index >= 0) && (this.gvResult.Rows.Count >= index))
         {
             this.dbo = new DB_OPT();
             this.bll = new UserBll();
             this.dbo.Open();
             string str = ((Label)this.gvResult.Rows[index].Cells[5].FindControl("labgspk")).Text.Trim();
             string strdept = ((Label)this.gvResult.Rows[index].Cells[6].FindControl("labbmpk")).Text.Trim();
             string strposition = ((Label)this.gvResult.Rows[index].Cells[7].FindControl("labjspk")).Text.Trim();
             string emppk = ((Label)this.gvResult.Rows[index].Cells[2].FindControl("labemppk")).Text.Trim();
             string strname = ((Label)this.gvResult.Rows[index].Cells[1].FindControl("labBH")).Text.Trim();
             string strtruename = ((Label)this.gvResult.Rows[index].Cells[2].FindControl("labName")).Text.Trim();
             string text = ((Label)this.gvResult.Rows[index].FindControl("labCompany")).Text;
             string str8 = ((Label)this.gvResult.Rows[index].FindControl("labBranch")).Text;
             string str9 = ((Label)this.gvResult.Rows[index].FindControl("labRole")).Text;
             string strpwd = QxRoom.QxConst.QxConst.Encrypt("123456", "powerich").Trim();
             if (this.bll.IfHadData(emppk, this.dbo) <= 0)
             {
                 if (this.bll.adduserinfo(strdept, strposition, emppk, strname, strtruename, strpwd, str, this.dbo) > 0)
                 {
                     PageShowText.ShowMessage_List("授权用户成功!", this.Page);
                     OperationLogBll.insertOp("授权", "职员列表", "授权给 " + text + " 单位, " + str8 + "部门下编号为:" + strname + " 真实姓名为:" + strtruename + " 角色为:" + str9 + " 的职员", "Y", this.Page);
                 }
             }
             else
             {
                 PageShowText.ShowMessage_List("该员工已经授权!", this.Page);
             }
         }
         else
         {
             PageShowText.ShowMessage_List("请选择一行数据再操作!", this.Page);
         }
     }
     catch (Exception exception)
     {
         this.el = new ExceptionLog.ExceptionLog();
         this.el.ErrClassName = base.GetType().ToString();
         this.el.ErrMessage = exception.Message.ToString();
         this.el.ErrMethod = "ToBeUser()";
         this.el.WriteExceptionLog(true);
         Const.OpenErrorPage("操作失败,请联系管理员!", this.Page);
     }
     finally
     {
         if (this.dbo != null)
         {
             this.dbo.Close();
         }
     }
 }
Exemplo n.º 14
0
        public async Task Invoke(HttpContext httpContext)
        {
            var rst = new ReturnResult <bool>();

            try
            {
                if (!httpContext.Request.Path.ToString().StartsWith("/Api"))
                {
                    await _next.Invoke(httpContext);

                    return;
                }
                if (_allowAnonymousPathList.Contains(httpContext.Request.Path))
                {
                    await _next.Invoke(httpContext);

                    return;
                }

                //var result = await httpContext.AuthenticateAsync(JwtBearerDefaults.AuthenticationScheme);

                //if (!result.Succeeded)
                //{
                //    httpContext.Response.StatusCode = (int)HttpStatusCode.Unauthorized;
                //    await httpContext.Response.WriteAsync("Unauthorized");
                //}
                //else
                //{
                //    httpContext.User = result.Principal;
                //    await _next.Invoke(httpContext);
                //}

                #region 身份验证,并设置用户Ruser值
                var result = httpContext.Request.Headers.TryGetValue("Authorization", out StringValues authStr);
                if (!result || string.IsNullOrEmpty(authStr.ToString()) || authStr.ToString() == "Bearer undefined")
                {
                    //授权不存在
                    rst.Status = 10000;
                    throw new Exception("未登录");
                }
                result = JwtHandler.Validate(_jwtSetting, authStr.ToString().Substring("Bearer ".Length).Trim(), out int code, out string error, out Dictionary <string, object> payLoad);
                if (!result)
                {
                    rst.Status = code;
                    throw new Exception(error);
                }

                #endregion

                #region 权限验证
                //if (!userContext.Authorize(context.Request.Path))
                //{
                //    throw new UnauthorizedAccessException("未授权");
                //}
                #endregion

                //前端F5刷新 重新获取用户信息
                if (httpContext.Request.Path.ToString() == "/Api/User/GetUserInfo")
                {
                    var bll  = new UserBll();
                    var user = bll.GetUserInfo(payLoad["user_id"].ToString());
                    if (user.Result)
                    {
                        //密码不传前端
                        user.Data.password = "";
                    }
                    await httpContext.Response.WriteAsync(JsonHelper.Instance.Serialize(user));
                }
                else
                {
                    //验证通过
                    await _next.Invoke(httpContext);
                }
            }
            catch (Exception ex)
            {
                rst.Message = ex.Message;
                await httpContext.Response.WriteAsync(JsonHelper.Instance.Serialize(rst));
            }
        }
Exemplo n.º 15
0
        // Token: 0x060000B8 RID: 184 RVA: 0x00011E2C File Offset: 0x0001002C
        protected override void View()
        {
            if (this.ispost)
            {
                if (!this.isperm)
                {
                    this.ShowErrMsg("对不起,您没有权限阅卷。");
                    return;
                }
                this.examresult = ExamBll.GetExamResult(this.resultid);
                if (this.examresult.id == 0)
                {
                    this.ShowErrMsg("对不起,该考试不存在或已被删除。");
                    return;
                }
                int status = this.examresult.status;
                this.examresult.status = 2;
                this.examresult.exnote = FPRequest.GetString("exnote");
                if (DbHelper.ExecuteUpdate <ExamResult>(this.examresult) <= 0)
                {
                    this.ShowErrMsg("保存出现错误。");
                    return;
                }
                List <ExamResultTopic> examResultTopicList = ExamBll.GetExamResultTopicList(this.resultid);
                int    num   = 0;
                double score = this.examresult.score;
                this.examresult.score  = 0.0;
                this.examresult.score1 = 0.0;
                this.examresult.score2 = 0.0;
                this.examresult.wrongs = 0;
                foreach (ExamResultTopic examResultTopic in examResultTopicList)
                {
                    if (examResultTopic.questions == 0)
                    {
                        num++;
                    }
                    else
                    {
                        int[]    array  = FPUtils.SplitInt(examResultTopic.questionlist);
                        string[] array2 = FPUtils.SplitString(examResultTopic.answerlist, "§", array.Length);
                        string[] array3 = FPUtils.SplitString(examResultTopic.scorelist, "|", array.Length);
                        examResultTopicList[num].scorelist   = "";
                        examResultTopicList[num].correctlist = "";
                        examResultTopicList[num].score       = 0.0;
                        int num2 = 0;
                        foreach (ExamQuestion examQuestion in QuestionBll.GetQuestionList(examResultTopic.questionlist))
                        {
                            string a = array2[num2];
                            if (examResultTopicList[num].scorelist != "")
                            {
                                ExamResultTopic examResultTopic2 = examResultTopicList[num];
                                examResultTopic2.scorelist += "|";
                            }
                            double num3 = 0.0;
                            if (examQuestion.type == 1 || examQuestion.type == 2)
                            {
                                num3 = (double)FPRequest.GetFloat("score_" + examQuestion.id);
                                this.examresult.score1 += num3;
                            }
                            else if (examQuestion.type == 3)
                            {
                                num3 = (double)FPRequest.GetFloat("score_" + examQuestion.id);
                                this.examresult.score1 += num3;
                            }
                            else if (examQuestion.type == 4)
                            {
                                num3 = (double)FPRequest.GetFloat("score_" + examQuestion.id);
                                this.examresult.score1 += num3;
                            }
                            else if (examQuestion.type == 5)
                            {
                                num3 = (double)FPRequest.GetFloat("score_" + examQuestion.id);
                                this.examresult.score2 += num3;
                            }
                            else if (examQuestion.type == 6)
                            {
                                num3 = (double)FPRequest.GetFloat("score_" + examQuestion.id);
                                this.examresult.score2 += num3;
                            }
                            this.examresult.score          += num3;
                            examResultTopicList[num].score += num3;
                            ExamResultTopic examResultTopic3 = examResultTopicList[num];
                            examResultTopic3.scorelist += num3.ToString();
                            if (examResultTopicList[num].correctlist != "")
                            {
                                ExamResultTopic examResultTopic4 = examResultTopicList[num];
                                examResultTopic4.correctlist += "|";
                            }
                            bool iswrong = false;
                            if (num3 >= examResultTopic.perscore * 0.6)
                            {
                                ExamResultTopic examResultTopic5 = examResultTopicList[num];
                                examResultTopic5.correctlist += "1";
                            }
                            else
                            {
                                ExamResultTopic examResultTopic6 = examResultTopicList[num];
                                examResultTopic6.correctlist += "0";
                                examResultTopicList[num].wrongs++;
                                this.examresult.wrongs++;
                                if (a == "")
                                {
                                    this.examresult.unanswer++;
                                }
                                iswrong = true;
                            }
                            SortInfo sortInfo = SortBll.GetSortInfo(examQuestion.sortid);
                            ExamBll.UpdateExamLog(sortInfo, this.examresult.uid, examQuestion, iswrong);
                            num2++;
                        }
                        DbHelper.ExecuteUpdate <ExamResultTopic>(examResultTopicList[num]);
                        num++;
                    }
                }
                ExpInfo       examExpByScore = ExamBll.GetExamExpByScore(this.examresult.score, this.examresult.examid);
                StringBuilder stringBuilder  = new StringBuilder();
                if (status == 0)
                {
                    stringBuilder.AppendFormat("UPDATE [{0}Exam_ExamResult] SET [score1]={1},[score2]={2},[score]={3},[wrongs]={4},[exp]={5} WHERE [id]={6}|", new object[]
                    {
                        DbConfigs.Prefix,
                        this.examresult.score1,
                        this.examresult.score2,
                        this.examresult.score,
                        this.examresult.wrongs,
                        examExpByScore.exp,
                        this.examresult.id
                    });
                    stringBuilder.AppendFormat("UPDATE [{0}Exam_ExamInfo] SET [exams]=[exams]+1,[score]=[score]+{1} WHERE [id]={2}", DbConfigs.Prefix, this.examresult.score, this.examresult.examid);
                }
                else
                {
                    stringBuilder.AppendFormat("UPDATE [{0}Exam_ExamResult] SET [score1]={1},[score2]={2},[score]={3},[exp]={4} WHERE [id]={5}|", new object[]
                    {
                        DbConfigs.Prefix,
                        this.examresult.score1,
                        this.examresult.score2,
                        this.examresult.score,
                        examExpByScore.exp,
                        this.examresult.id
                    });
                    stringBuilder.AppendFormat("UPDATE [{0}Exam_ExamInfo] SET [score]=[score]-{1} WHERE [id]={2}|", DbConfigs.Prefix, score, this.examresult.examid);
                    stringBuilder.AppendFormat("UPDATE [{0}Exam_ExamInfo] SET [score]=[score]+{1} WHERE [id]={2}", DbConfigs.Prefix, this.examresult.score, this.examresult.examid);
                    stringBuilder.AppendFormat("UPDATE [{0}WMS_UserInfo] SET [exp]=[exp]-{1} WHERE [id]={2}", DbConfigs.Prefix, this.examresult.exp, this.examresult.uid);
                }
                this.msg = DbHelper.ExecuteSql(stringBuilder.ToString());
                UserBll.UpdateUserExp(this.examresult.uid, examExpByScore.exp);
                if (this.msg != "")
                {
                    this.ShowErrMsg(this.msg);
                    return;
                }
            }
            Hashtable hashtable = new Hashtable();

            hashtable["error"]   = 0;
            hashtable["message"] = "";
            base.Response.AddHeader("Content-Type", "text/html; charset=UTF-8");
            base.Response.Write(JsonMapper.ToJson(hashtable));
            base.Response.End();
        }
Exemplo n.º 16
0
    protected void btnLogin_Click(object sender, EventArgs e)
    {
        //测试
        Request.Cookies.Clear();
        if (txtUserName.Text.Trim() != "")
        {
            try
            {
                string key = txtUserName.Text.ToLower();
                string UserCache = Convert.ToString(Cache[key]);

                UserBll userBll = new UserBll();

                DataTable dtUserList = userBll.GetUserInfo(txtUserName.Text.Trim());
                if (dtUserList != null && dtUserList.Rows.Count > 0)
                {
                    if (dtUserList.Rows[0]["UserPassword"].ToString().Trim() == txtPassWord.Text.Trim())
                    {
                        FormsAuthentication.SetAuthCookie(this.txtUserName.Text, false);

                        Session["UserID"] = dtUserList.Rows[0]["UserID"].ToString();
                        Session["GroupID"] = dtUserList.Rows[0]["GroupID"].ToString();
                        Session["G_user"] = dtUserList.Rows[0]["UserName"].ToString();

                        string EmployeeCode = dtUserList.Rows[0]["EmployeeCode"].ToString();

                        Session["EmployeeCode"] = dtUserList.Rows[0]["EmployeeCode"].ToString();
                        #region 添加登录日志

                        BLL.BLLBase bll = new BLL.BLLBase();
                        bll.ExecNonQuery("Security.InsertOperatorLog", new DataParameter[]{new DataParameter("@LoginUser", Session["G_user"].ToString()),new DataParameter("@LoginTime",DateTime.Now),
                                                         new DataParameter("@LoginModule","登录系统"),new DataParameter("@ExecuteOperator","用户登录")});

                        #endregion
                        TimeSpan stLogin = new TimeSpan(0, 0, System.Web.HttpContext.Current.Session.Timeout, 0, 0);
                        HttpContext.Current.Cache.Insert(key, Page.Request.UserHostAddress, null, DateTime.MaxValue, stLogin, System.Web.Caching.CacheItemPriority.NotRemovable, null);

                        Response.Redirect("Default.aspx", false);
                    }
                    else
                    {
                        BLL.BLLBase bll = new BLL.BLLBase();
                        bll.ExecNonQuery("Security.InsertOperatorLog", new DataParameter[]{new DataParameter("@LoginUser",this.txtUserName.Text.Trim()),new DataParameter("@LoginTime",DateTime.Now),
                                                         new DataParameter("@LoginModule","登录页面"),new DataParameter("@ExecuteOperator","登录(用户密码有误)")});
                        ltlMessage.Text = "对不起,您输入的密码有误!";
                    }
                }
                else
                {
                    ltlMessage.Text = "对不起,您输入的用户名不存在!";
                }

            }
            catch (Exception exp)
            {
                ltlMessage.Text = exp.Message;
            }
        }
        else
        {
            ltlMessage.Text = "请输入用户名!";
        }
    }
Exemplo n.º 17
0
 // Token: 0x060000A4 RID: 164 RVA: 0x0000F8A4 File Offset: 0x0000DAA4
 protected override void View()
 {
     if (this.ispost)
     {
         this.examresult = ExamBll.GetExamResult(this.resultid);
         if (this.examresult.id == 0)
         {
             this.ShowErr("对不起,该考试不存在或已被删除。");
         }
         else if (this.examresult.uid != this.userid)
         {
             this.ShowErr("对不起,您不是该考试的主人。");
         }
         else if (this.examresult.status == 1)
         {
             this.ShowErr("对不起,该考试已完成,不能重复提交。");
         }
         else
         {
             this.examresult.utime   = FPRequest.GetInt("utime");
             this.examresult.endtime = DbUtils.GetDateTime();
             this.examresult.status  = 1;
             if (DbHelper.ExecuteUpdate <ExamResult>(this.examresult) > 0)
             {
                 List <ExamResultTopic> examResultTopicList = ExamBll.GetExamResultTopicList(this.resultid);
                 int num = 0;
                 foreach (ExamResultTopic examResultTopic in examResultTopicList)
                 {
                     if (examResultTopic.questions == 0)
                     {
                         num++;
                     }
                     else
                     {
                         examResultTopicList[num].answerlist  = "";
                         examResultTopicList[num].scorelist   = "";
                         examResultTopicList[num].correctlist = "";
                         List <ExamQuestion> questionList = QuestionBll.GetQuestionList(examResultTopic.questionlist);
                         string[]            array        = FPUtils.SplitString(examResultTopic.optionlist, "|", questionList.Count);
                         int num2 = 0;
                         foreach (ExamQuestion examQuestion in questionList)
                         {
                             string text = FPRequest.GetString("answer_" + examQuestion.id);
                             if (num2 == 0)
                             {
                                 ExamResultTopic examResultTopic2 = examResultTopicList[num];
                                 examResultTopic2.answerlist += text;
                             }
                             else
                             {
                                 ExamResultTopic examResultTopic3 = examResultTopicList[num];
                                 examResultTopic3.answerlist = examResultTopic3.answerlist + "§" + text;
                             }
                             if (examResultTopicList[num].scorelist != "")
                             {
                                 ExamResultTopic examResultTopic4 = examResultTopicList[num];
                                 examResultTopic4.scorelist += "|";
                             }
                             examQuestion.optionlist = array[num2];
                             int    num3 = 0;
                             double num4 = 0.0;
                             if (examQuestion.type == 1 || examQuestion.type == 2)
                             {
                                 num3 = examQuestion.ascount;
                                 examQuestion.answer = this.OptionAnswer(array[num2], examQuestion.answer);
                                 if (text == examQuestion.answer && text != "")
                                 {
                                     num4 = examResultTopic.perscore;
                                 }
                                 this.examresult.score1 += num4;
                             }
                             else if (examQuestion.type == 3)
                             {
                                 num3 = examQuestion.ascount;
                                 if (text == examQuestion.answer && text != "")
                                 {
                                     num4 = examResultTopic.perscore;
                                 }
                                 this.examresult.score1 += num4;
                             }
                             else if (examQuestion.type == 4)
                             {
                                 string[] array2;
                                 if (examQuestion.upperflg == 1)
                                 {
                                     array2 = FPUtils.SplitString(examQuestion.answer, ",");
                                 }
                                 else
                                 {
                                     array2 = FPUtils.SplitString(examQuestion.answer.ToLower(), ",");
                                 }
                                 text = exampost.DelSameAnser(text);
                                 string[] array3;
                                 if (examQuestion.upperflg == 1)
                                 {
                                     array3 = FPUtils.SplitString(text, ",", array2.Length);
                                 }
                                 else
                                 {
                                     array3 = FPUtils.SplitString(text.ToLower(), ",", array2.Length);
                                 }
                                 if (examQuestion.orderflg == 1)
                                 {
                                     for (int i = 0; i < array3.Length; i++)
                                     {
                                         if (FPUtils.InArray(array3[i], array2[i], "|"))
                                         {
                                             num3++;
                                         }
                                     }
                                 }
                                 else
                                 {
                                     for (int i = 0; i < array3.Length; i++)
                                     {
                                         if (FPUtils.InArray(array3[i], examQuestion.answer.Replace("|", ",")))
                                         {
                                             num3++;
                                         }
                                     }
                                 }
                                 if (num3 > 0)
                                 {
                                     if (examQuestion.ascount <= 0)
                                     {
                                         examQuestion.ascount = 1;
                                     }
                                     num4 = Math.Round(examResultTopic.perscore / (double)examQuestion.ascount * (double)num3, 1);
                                     this.examresult.score2 += num4;
                                 }
                             }
                             else if (examQuestion.type == 5)
                             {
                                 foreach (string value in FPUtils.SplitString(examQuestion.answerkey))
                                 {
                                     if (text.IndexOf(value) >= 0)
                                     {
                                         num3++;
                                     }
                                 }
                                 if (num3 > 0 && text != "")
                                 {
                                     if (examQuestion.ascount > 0)
                                     {
                                         examQuestion.ascount = 1;
                                     }
                                     num4 = Math.Round(examResultTopic.perscore / (double)examQuestion.ascount * (double)num3, 1);
                                     this.examresult.score2 += num4;
                                 }
                             }
                             else if (examQuestion.type == 6)
                             {
                                 for (int k = 0; k < examQuestion.title.Length; k++)
                                 {
                                     if (text.IndexOf(examQuestion.title.Substring(k, 1)) >= 0)
                                     {
                                         num3++;
                                     }
                                 }
                                 if (num3 > 0)
                                 {
                                     num4 = Math.Round(examResultTopic.perscore / (double)examQuestion.title.Length * (double)num3, 1);
                                     this.examresult.score2 += num4;
                                 }
                             }
                             this.examresult.score          += num4;
                             examResultTopicList[num].score += num4;
                             ExamResultTopic examResultTopic5 = examResultTopicList[num];
                             examResultTopic5.scorelist += num4.ToString();
                             if (examResultTopicList[num].correctlist != "")
                             {
                                 ExamResultTopic examResultTopic6 = examResultTopicList[num];
                                 examResultTopic6.correctlist += "|";
                             }
                             bool flag = false;
                             if (num4 >= examResultTopic.perscore * 0.6)
                             {
                                 ExamResultTopic examResultTopic7 = examResultTopicList[num];
                                 examResultTopic7.correctlist += "1";
                             }
                             else
                             {
                                 ExamResultTopic examResultTopic8 = examResultTopicList[num];
                                 examResultTopic8.correctlist += "0";
                                 examResultTopicList[num].wrongs++;
                                 this.examresult.wrongs++;
                                 if (text == "")
                                 {
                                     this.examresult.unanswer++;
                                 }
                                 flag = true;
                             }
                             string sqlstring;
                             if (flag)
                             {
                                 sqlstring = string.Format("UPDATE [{0}Exam_ExamQuestion] SET [exams]=[exams]+1,[wrongs]=[wrongs]+1 WHERE [id]={1}", DbConfigs.Prefix, examQuestion.id);
                             }
                             else
                             {
                                 sqlstring = string.Format("UPDATE [{0}Exam_ExamQuestion] SET [exams]=[exams]+1 WHERE [id]={1}", DbConfigs.Prefix, examQuestion.id);
                             }
                             DbHelper.ExecuteSql(sqlstring);
                             examQuestion.useranswer = text;
                             SortInfo sortInfo = SortBll.GetSortInfo(examQuestion.sortid);
                             ExamBll.UpdateExamLog(sortInfo, this.userid, examQuestion, flag);
                             num2++;
                         }
                         DbHelper.ExecuteUpdate <ExamResultTopic>(examResultTopicList[num]);
                         num++;
                     }
                 }
                 this.expinfo               = ExamBll.GetExamExpByScore(this.examresult.score, this.examresult.examid);
                 this.examresult.exnote     = this.expinfo.comment;
                 this.examresult.exp        = this.expinfo.exp;
                 this.examresult.getcredits = this.expinfo.credits;
                 StringBuilder stringBuilder = new StringBuilder();
                 stringBuilder.AppendFormat("UPDATE [{0}Exam_ExamResult] SET [score1]={1},[score2]={2},[score]={3},[wrongs]={4},[exp]={5},[exnote]='{6}' WHERE [id]={7}|", new object[]
                 {
                     DbConfigs.Prefix,
                     this.examresult.score1,
                     this.examresult.score2,
                     this.examresult.score,
                     this.examresult.wrongs,
                     this.examresult.exp,
                     this.examresult.exnote,
                     this.examresult.id
                 });
                 stringBuilder.AppendFormat("UPDATE [{0}Exam_ExamInfo] SET [score]=[score]+{1} WHERE [id]={2}", DbConfigs.Prefix, this.examresult.score, this.examresult.examid);
                 this.msg = DbHelper.ExecuteSql(stringBuilder.ToString());
                 if (this.examresult.exp > 0)
                 {
                     UserBll.UpdateUserExp(this.examresult.uid, this.examresult.exp);
                 }
                 if (this.examresult.getcredits > 0)
                 {
                     UserBll.UpdateUserCredit(new CreditInfo
                     {
                         uid     = this.examresult.uid,
                         name    = "考试奖励积分",
                         type    = 0,
                         credits = this.examresult.getcredits,
                         doid    = this.userid,
                         doname  = this.username
                     });
                 }
                 if (this.msg != "")
                 {
                     this.ShowErr(this.msg);
                 }
             }
         }
     }
 }
Exemplo n.º 18
0
 public async Task DeleteUser(UserBll userBll)
 {
     await this.tableTableStore.DeleteTableEntity <UserEntity>(userBll.City, userBll.Nickname);
 }
Exemplo n.º 19
0
 public UserController(UserBll userBll, UserGroupBll userGroupBll, LogBll logBll)
 {
     _userBll      = userBll;
     _userGroupBll = userGroupBll;
     _logBll       = logBll;
 }
Exemplo n.º 20
0
        public void ProcessRequest(HttpContext context)
        {
            string sAjaxType = CYRequest.GetString("AjaxType");
            int    iUserID   = 0;

            switch (sAjaxType)
            {
            case "ValName":
                context.Response.Write(AccountVal(CYRequest.GetString("Account")));
                break;

            case "GameAllSel":
                context.Response.Write(GameAllSel());
                break;

            case "ServerSelByGame":
                context.Response.Write(ServerSelByGame(CYRequest.GetString("Abbre")));
                break;

            case "ServerNumSelByGame":
                context.Response.Write(ServerNumSelByGame(CYRequest.GetString("Abbre"), CYRequest.GetString("Num")));
                break;

            case "CodeTypeSel":
                context.Response.Write(CodeTypeSel(CYRequest.GetString("GameAbbre")));
                break;

            case "CodeUrlSel":
                context.Response.Write(CodeUrlSel(CYRequest.GetString("Abbre")));
                break;

            case "loginval":
                context.Response.Write(UserVal(CYRequest.GetString("username"), CYRequest.GetString("password")));
                break;

            case "ServerNewSel":
                int iGameID = 0;
                int.TryParse(CYRequest.GetString("gameid"), out iGameID);
                if (iGameID > 0)
                {
                    context.Response.Write(ServerNewSel(iGameID));
                }
                break;

            case "ServerLoginLastSel":
                iGameID = 0;
                int.TryParse(CYRequest.GetString("gameid"), out iGameID);
                iUserID = UserBll.UserIDSel(CYRequest.GetString("account"));
                if (iGameID > 0 && iUserID > 999)
                {
                    context.Response.Write(ServerLoginLastSel(iUserID, iGameID));
                }
                break;

            case "NoticeSel":
                context.Response.Write(NoticeSel(CYRequest.GetString("abbre")));
                break;

            case "sqGameCL":
                context.Response.Write(sqGameCL(CYRequest.GetString("account"), CYRequest.GetString("game")));
                break;

            case "jyGameCL":
                context.Response.Write(jyGameCL(CYRequest.GetString("account"), CYRequest.GetString("game"), CYRequest.GetString("pc")));
                break;

            case "sqUserInfo":
                context.Response.Write(sqUserInfos(CYRequest.GetString("account"), CYRequest.GetString("game")));
                break;

            case "Top20PaySel":
                context.Response.Write(Top20PaySel());
                break;

            case "Top20PayAllSel":
                context.Response.Write(Top20PayAllSel());
                break;

            case "ServerJsonSelByGame":
                context.Response.Write(ServerJsonSelByGame((CYRequest.GetString("Game"))));
                break;

            case "HelpClassLJ2DLGGSel":
                context.Response.Write(HelpClassLJ2DLGGSel(CYRequest.GetString("ClassID")));
                break;

            case "LoginSeverSel":
                context.Response.Write(LoginSeverSel(CYRequest.GetString("un")));
                break;

            case "UserInfoSel":
                context.Response.Write(UserInfoSel(CYRequest.GetString("un")));
                break;

            case "CodeTake":
                iUserID = UserBll.UserIDSel(CYRequest.GetString("un"));
                if (iUserID > 999)
                {
                    string sTakeRes   = string.Empty;
                    string sGameAbbre = CYRequest.GetString("ServerAbbre");
                    string sGame      = GameInfoBLL.GameInfoAbbreSel(sGameAbbre).TrimEnd();
                    switch (sGame)
                    {
                    case "sxd":
                        sTakeRes = string.Format("0|{0}", sxdGame.GetNewCode(sGameAbbre, iUserID.ToString()));
                        break;

                    case "lj":
                        if (CYRequest.GetString("CodeType") == "ljxsk")
                        {
                            sTakeRes = string.Format("0|{0}", ljGame.GetNewCode(sGameAbbre, iUserID.ToString()));
                        }
                        else
                        {
                            sTakeRes = CodeTake(sGameAbbre, CYRequest.GetString("CodeType"), iUserID);
                        }
                        break;

                    case "swjt":
                        sTakeRes = string.Format("0|{0}", swjtGame.GetNewCode(sGameAbbre, iUserID.ToString()));
                        break;

                    case "wwsg":
                        sTakeRes = string.Format("0|{0}", wwsgGame.GetNewCode(iUserID.ToString(), sGameAbbre));
                        break;

                    case "ktpd":
                        sTakeRes = string.Format("0|{0}", ktpdGame.GetNewCode(iUserID.ToString(), sGameAbbre));
                        break;

                    case "sgyjz":
                        sTakeRes = string.Format("0|{0}", sgyjzGame.GetNewCode(iUserID.ToString(), sGameAbbre.ToString(), ""));
                        break;

                    case "zwx":
                        if (CYRequest.GetString("CodeType") == "zwxxsk")
                        {
                            sTakeRes = string.Format("0|{0}", zwxGame.GetNewCode(iUserID.ToString(), sGameAbbre));
                        }
                        else
                        {
                            sTakeRes = CodeTake(sGameAbbre, CYRequest.GetString("CodeType"), iUserID);
                        }
                        break;

                    default:
                        sTakeRes = CodeTake(sGameAbbre, CYRequest.GetString("CodeType"), iUserID);
                        break;
                    }
                    context.Response.Write(sTakeRes);
                }
                break;

            case "FirstGift":
                context.Response.Write(FirstGift(CYRequest.GetString("gn"), CYRequest.GetString("un"), CYRequest.GetString("pp"), CYRequest.GetString("host")));
                break;
            }
        }
Exemplo n.º 21
0
 private void frmUserManage_Load(object sender, EventArgs e)
 {
     dataGridView1.DataSource = UserBll.UserFill().Tables[0];
     getcolumn();
 }
Exemplo n.º 22
0
        protected string sqUserInfos(string sAccount, string sGameAbbre)
        {
            int iUserID = UserBll.UserIDSel(sAccount);

            return(sqGame.GetUserInfoJson(iUserID.ToString(), sGameAbbre));
        }
Exemplo n.º 23
0
 public UserController(UserBll bll) : base(bll)
 {
     _bll = bll;
 }
Exemplo n.º 24
0
 public static RegisterUserModel ToModel(this UserBll userBll)
 {
     return(Mapper.Map <UserBll, RegisterUserModel>(userBll));
 }
Exemplo n.º 25
0
        // Token: 0x060000B5 RID: 181 RVA: 0x0000DF80 File Offset: 0x0000C180
        protected override void View()
        {
            if (this.id > 0)
            {
                this.fulluserinfo = DbHelper.ExecuteModel <FullUserInfo>(this.id);
            }
            this.bday = FPUtils.SplitString(this.fulluserinfo.bday, ",", 3);
            if (this.ispost)
            {
                this.fulluserinfo.isreal   = 0;
                this.fulluserinfo.isemail  = 0;
                this.fulluserinfo.ismobile = 0;
                string username = this.fulluserinfo.username;
                this.fulluserinfo = FPRequest.GetModel <FullUserInfo>(this.fulluserinfo);
                if (this.fulluserinfo.roleid == 0)
                {
                    this.ShowErr("请选择用户角色。");
                    return;
                }
                if (this.fulluserinfo.username == "")
                {
                    this.ShowErr("请输入用户名。");
                    return;
                }
                string @string = FPRequest.GetString("password1");
                if (this.fulluserinfo.isidcard != 0)
                {
                    this.fulluserinfo.isidcard = ((this.fulluserinfo.isreal == 1) ? 1 : -1);
                }
                if (FPRequest.GetInt("isgrade") == 1)
                {
                    UserGrade userGradeByExpHigher = UserBll.GetUserGradeByExpHigher(this.fulluserinfo.exp);
                    this.fulluserinfo.gradeid = userGradeByExpHigher.id;
                }
                if (this.fulluserinfo.id > 0)
                {
                    if (this.fulluserinfo.username != username)
                    {
                        if (UserBll.CheckUserName(this.fulluserinfo.username))
                        {
                            this.ShowErr("该用户名已经存在,请使用别的用户名。");
                            return;
                        }
                    }
                    if (@string.Trim() != "")
                    {
                        this.fulluserinfo.password = FPUtils.MD5(@string);
                    }
                    DbHelper.ExecuteUpdate <FullUserInfo>(this.fulluserinfo);
                }
                else
                {
                    if (@string.Trim() == "")
                    {
                        this.ShowErr("登录密码不能为空!");
                        return;
                    }
                    if (UserBll.CheckUserName(this.fulluserinfo.username))
                    {
                        this.ShowErr("该用户名已经存在,请使用别的用户名。");
                        return;
                    }
                    this.fulluserinfo.password = FPUtils.MD5(@string);
                    this.fulluserinfo.regip    = FPRequest.GetIP();
                    this.fulluserinfo.lastip   = FPRequest.GetIP();
                    this.fulluserinfo.id       = DbHelper.ExecuteInsert <FullUserInfo>(this.fulluserinfo);
                }
                base.Response.Redirect("usermanage.aspx");
            }
            SqlParam sqlParam = DbHelper.MakeAndWhere("parentid", 0);

            this.deparlist = DbHelper.ExecuteList <Department>(OrderBy.ASC, new SqlParam[]
            {
                sqlParam
            });
            sqlParam      = DbHelper.MakeAndWhere("id", WhereType.NotEqual, 2);
            this.rolelist = DbHelper.ExecuteList <RoleInfo>(OrderBy.ASC, new SqlParam[]
            {
                sqlParam
            });
            this.usergradelist = DbHelper.ExecuteList <UserGrade>(OrderBy.ASC);
            this.typelist      = TypeBll.GetTypeListByMarkup("usertype");
            base.SaveRightURL();
        }
Exemplo n.º 26
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string account   = CYRequest.GetString("account");
            string agentid   = CYRequest.GetString("agentid");
            string gameabbre = CYRequest.GetString("gameabbre");
            string tstamp    = CYRequest.GetString("tstamp");

            if (account.Length > 20 || account.Length < 6)
            {
                Response.Write("2");
                return;
            }

            TimeSpan tsNow    = new TimeSpan(DateTime.Now.Ticks);
            long     lTime    = long.Parse(tstamp + "0000000");
            TimeSpan tsGet    = new TimeSpan(lTime);
            DateTime dtGet    = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)).Add(tsGet);
            int      iMinutes = 0;

            if (dtGet > DateTime.Now)
            {
                TimeSpan tsgetSpan = new TimeSpan(dtGet.Ticks);
                iMinutes = tsgetSpan.Subtract(tsNow).Minutes;
            }
            else
            {
                iMinutes = tsNow.Subtract(tsGet).Minutes;
            }


            if (iMinutes > 10)
            {
                DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
                Response.Write(string.Format("3|{0}|{1}:{2}|{3}", iMinutes, DateTime.Now.ToString(), dtGet, tstamp));
                return;
            }

            string sign = CYRequest.GetString("sign");//md5(account + agentid + gameabbre + tstamp + TICKEY_LOGIN)
            int    pid  = 0;

            int.TryParse(agentid, out pid);
            if (pid < 1)
            {
                Response.Write("4");
                return;
            }
            string        TICKEY_LOGIN = PartnerBLL.PartnerKeySel(pid);
            StringBuilder sbText       = new StringBuilder(50);

            sbText.Append(account);
            sbText.Append(agentid);
            sbText.Append(gameabbre);
            sbText.Append(tstamp);
            sbText.Append(TICKEY_LOGIN);
            string sValSign = ProvideCommon.MD5(sbText.ToString());

            if (sign == sValSign)
            {
                string sPageUrl      = Request.Url.ToString();
                string sPartnerAbbre = PartnerBLL.PartnerAbbreSel(pid);
                if (sPartnerAbbre == null || sPartnerAbbre.Length < 1)
                {
                    Response.Write("5");
                    return;
                }
                string sAccountC     = string.Format("{0}:{1}", sPartnerAbbre, account);
                string sAccountLogin = GetAccount();
                string sUserIP       = ProvideCommon.GetRealIP();
                int    iUserID;
                if (sAccountC != sAccountLogin)
                {
                    //1.检查帐号是否存在
                    iUserID = PartnerUserBLL.PartnerUserIDSel(account, pid);
                    if (iUserID < 1000)
                    {
                        //2.不存在,则注册帐号
                        int iUID = UserBll.UserReg(sAccountC, "");
                        if (iUID < 1000)
                        {
                            Response.Write("6");
                            return;
                        }
                        else
                        {
                            int iRow = PartnerUserBLL.PartnerUserAdd(pid, sUserIP, iUID, account);
                            if (iRow < 1)
                            {
                                Response.Write("7");
                                return;
                            }
                        }
                        iUserID = iUID;
                        LoginStateSet(sAccountC, iUID, sPageUrl);
                    }
                    else
                    {
                        LoginStateSet(sAccountC, iUserID, sPageUrl);
                    }
                }
                else
                {
                    iUserID = GetUserID();
                    if (!ValUserState(iUserID, sAccountC))
                    {
                        iUserID = UserBll.UserIDSel(sAccountC);
                        if (iUserID < 1000 || (!ValUserState(iUserID, sAccountC)))
                        {
                            ClearUsersInfo();
                            Response.Write("10");
                            return;
                        }
                        else
                        {
                            ClearUsersInfo();
                            LoginStateSet(sAccountC, iUserID, sPageUrl);
                        }
                    }
                }

                string sGame   = GameInfoBLL.GameInfoAbbreSel(gameabbre).TrimEnd();
                string sUrl    = string.Empty;
                string sUserID = iUserID.ToString();
                if (iUserID > 1000)
                {
                    switch (sGame)
                    {
                    case "sssg":
                        string sSource = string.Empty;
                        string client  = "web";
                        sUrl = sssgGame.Login(sUserID, gameabbre, sSource, client);
                        break;

                    case "sxd":
                        sUrl = sxdGame.Login(sUserID, gameabbre, "");
                        break;

                    case "tssg":
                        sUrl = tssgGame.Login(sUserID, gameabbre, "");
                        break;

                    case "lj":
                        sUrl = ljGame.Login(sUserID, gameabbre);
                        break;

                    case "yjxy":
                        sUrl = yjxyGame.Login(sUserID, gameabbre);
                        break;

                    case "mjcs":
                        sUrl = mjcsGame.Login(sUserID, gameabbre);
                        break;

                    case "sq":
                        sUrl = sqGame.Login(sUserID, gameabbre, true);
                        break;

                    case "hzw":
                        sUrl = hzwGame.Login(sUserID, gameabbre);
                        break;

                    case "xlfc":
                        sUrl = xlfcGame.Login(sUserID, gameabbre);
                        break;

                    default:
                        Response.Write("8");
                        break;
                    }
                }
                else
                {
                    ClearUsersInfo();
                    Response.Write("11");
                    return;
                }
                if (sUrl != null && sUrl.Length > 5)
                {
                    GameLoginBLL.GameLoginAdd(iUserID, gameabbre, sUserIP, sUrl);
                    Response.Redirect(sUrl, true);
                }
            }
            else
            {
                Response.Write("9");
            }
        }
Exemplo n.º 27
0
 public UsersController(DBApiContext context, IConfiguration configuration) : base(configuration)
 {
     this.userBll = new UserBll(context);
 }
Exemplo n.º 28
0
        public UserInfo GetUserInfo(string userName)
        {
            var model = new UserBll().GetUserInfo(userName);

            return(model);
        }
Exemplo n.º 29
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string ip = ProvideCommon.GetRealIP();

            sGameName = CYRequest.GetString("gn");
            if (sGameName == "" || sGameName == "unsafe string")
            {
                Response.Redirect(string.Format("{0}/yxzx", sWUrl), false);
            }
            else
            {
                if (LoginSessionVal() || isLoginCookie())
                {
                    int    iUserID  = GetUserID();
                    string sUserID  = string.Empty;
                    string sAccount = GetAccount();
                    if (!ValUserState(iUserID, sAccount))
                    {
                        iUserID = UserBll.UserIDSel(sAccount);
                        if (iUserID < 1000 || (!ValUserState(iUserID, sAccount)))
                        {
                            Response.Write(string.Format("<script>alert('用户名:{2}与数字ID:{3}不一致,请重新登录!谢谢!');location.href='{0}/Default.aspx?gn={1}';</script>", sRootUrl, sGameName, sAccount, iUserID));
                            ClearUsersInfo();
                            return;
                        }
                    }
                    else
                    {
                        DateTime dtLoginTime = GetLoginTime();
                        if (!PWDUpdateBLL.PwdUpdateVal(iUserID, dtLoginTime))
                        {
                            ClearUsersInfo();
                            Response.Redirect(string.Format("{0}/Default.aspx", sRootUrl), true);
                            return;
                        }
                    }

                    int iUserPoints = GetUPoints();
                    if (iUserPoints > 0)
                    {
                        UserPointsBLL.UPointCheck(iUserID);
                    }

                    sUserID = iUserID.ToString();
                    string sGame = GameInfoBLL.GameInfoAbbreSel(sGameName).TrimEnd();
                    switch (sGame)
                    {
                    case "sssg":
                        string sSource = string.Empty;
                        string client  = string.Empty;
                        if (CYRequest.GetString("client") != "pc")
                        {
                            client = "web";
                        }
                        else
                        {
                            client = CYRequest.GetString("client");
                        }
                        sUrl = sssgGame.Login(sUserID, sGameName, sSource, client);
                        if (GameLogin(sGameName))
                        {
                            GameLoginBLL.GameLoginAdd(iUserID, sGameName, ProvideCommon.GetRealIP(), sUrl);
                        }
                        if (client == "pc")
                        {
                            Response.Redirect(sUrl, true);
                            return;
                        }
                        else
                        {
                            sGameName = string.Empty;
                        }
                        break;

                    case "sxd":
                        sUrl    = sxdGame.Login(sUserID, sGameName, "");
                        iHeight = 635;
                        if (GameLogin(sGameName))
                        {
                            GameLoginBLL.GameLoginAdd(iUserID, sGameName, ProvideCommon.GetRealIP(), sUrl);
                        }
                        sGameName = string.Empty;
                        break;

                    default:
                        Response.Redirect(string.Format("wan.aspx?gn={0}", sGameName), true);
                        break;
                    }
                    sTitle = ServerBLL.ServerTitleSel(CYRequest.GetString("gn"));
                    if (sTitle.Length > 11)
                    {
                        ssTitle = sTitle.Substring(0, 11);
                    }
                    else
                    {
                        ssTitle = sTitle;
                    }
                }
                else
                {
                    Response.Write(string.Format("<script>alert('用户状态有误或没有登录,请重新登录!谢谢!');location.href='{0}/Default.aspx?gn={1}';</script>", sRootUrl, sGameName));
                }
            }
        }
Exemplo n.º 30
0
    protected void btnLogin_Click(object sender, EventArgs e)
    {
        //测试
        Request.Cookies.Clear();
        if (txtUserName.Text.Trim() != "")
        {
            try
            {
                string key       = txtUserName.Text.ToLower();
                string UserCache = Convert.ToString(Cache[key]);


                UserBll userBll = new UserBll();

                DataTable dtUserList = userBll.GetUserInfo(txtUserName.Text.Trim());
                if (dtUserList != null && dtUserList.Rows.Count > 0)
                {
                    if (dtUserList.Rows[0]["UserPassword"].ToString().Trim() == txtPassWord.Text.Trim())
                    {
                        FormsAuthentication.SetAuthCookie(this.txtUserName.Text, false);


                        Session["UserID"]  = dtUserList.Rows[0]["UserID"].ToString();
                        Session["GroupID"] = dtUserList.Rows[0]["GroupID"].ToString();
                        Session["G_user"]  = dtUserList.Rows[0]["UserName"].ToString();


                        string EmployeeCode = dtUserList.Rows[0]["EmployeeCode"].ToString();


                        Session["EmployeeCode"] = dtUserList.Rows[0]["EmployeeCode"].ToString();
                        #region 添加登录日志

                        BLL.BLLBase bll = new BLL.BLLBase();
                        bll.ExecNonQuery("Security.InsertOperatorLog", new DataParameter[] { new DataParameter("@LoginUser", Session["G_user"].ToString()), new DataParameter("@LoginTime", DateTime.Now),
                                                                                             new DataParameter("@LoginModule", "登录系统"), new DataParameter("@ExecuteOperator", "用户登录") });


                        DataTable dt = bll.FillDataTable("Security.SelectGroupRole", new DataParameter[] { new DataParameter("@GroupID", Session["GroupID"].ToString()), new DataParameter("@SystemName", "WMS") });
                        Session["DT_UserOperation"] = dt;

                        #endregion
                        TimeSpan stLogin = new TimeSpan(0, 0, System.Web.HttpContext.Current.Session.Timeout, 0, 0);
                        HttpContext.Current.Cache.Insert(key, Page.Request.UserHostAddress, null, DateTime.MaxValue, stLogin, System.Web.Caching.CacheItemPriority.NotRemovable, null);

                        Response.Redirect("Default.aspx", false);
                    }
                    else
                    {
                        BLL.BLLBase bll = new BLL.BLLBase();
                        bll.ExecNonQuery("Security.InsertOperatorLog", new DataParameter[] { new DataParameter("@LoginUser", this.txtUserName.Text.Trim()), new DataParameter("@LoginTime", DateTime.Now),
                                                                                             new DataParameter("@LoginModule", "登录页面"), new DataParameter("@ExecuteOperator", "登录(用户密码有误)") });
                        ltlMessage.Text = "对不起,您输入的密码有误!";
                    }
                }
                else
                {
                    ltlMessage.Text = "对不起,您输入的用户名不存在!";
                }
            }
            catch (Exception exp)
            {
                ltlMessage.Text = exp.Message;
            }
        }
        else
        {
            ltlMessage.Text = "请输入用户名!";
        }
    }
Exemplo n.º 31
0
 public async Task AddUser(UserBll userBll)
 {
     await this.tableTableStore.AddTableEntity(UserEntity.FromUserBll(userBll));
 }
Exemplo n.º 32
0
 public static void GoLoginPath_List(Page page)
 {
     HttpCookie cookie = new HttpCookie("UserCookie");
     UserBll bll = new UserBll();
     string script = "";
     if (((cookie != null) && (page.Request.Cookies["UserCookie"] != null)) && (page.Request.Cookies["UserCookie"].Values["pwd"] != null))
     {
         string str2 = QxRoom.QxConst.QxConst.Decrypt(page.Server.UrlDecode(page.Request.Cookies["UserCookie"].Values["pwd"]), "powerich");
         UserModel model = bll.Login(page.Server.UrlDecode(page.Request.Cookies["UserCookie"].Values["UserName"].Trim()));
         if (((model.UserName == page.Server.UrlDecode(page.Request.Cookies["UserCookie"].Values["UserName"].Trim())) && (model.Password != null)) && (QxRoom.QxConst.QxConst.Decrypt(model.Password, "powerich") == str2))
         {
             page.Session["User"] = model;
             page.Session["companyname"] = page.Server.UrlDecode(page.Request.Cookies["UserCookie"].Values["CompanyName"].Trim());
             page.Session["pk_corp"] = page.Server.UrlDecode(page.Request.Cookies["UserCookie"].Values["CompanyPK"].Trim());
             script = "window.location.reload();";
             ScriptManager.RegisterClientScriptBlock(page, page.GetType(), "login", script, true);
         }
         else
         {
             script = "window.parent.CloseXtit(); window.parent.ShowMsg_Login('index.aspx');";
         }
     }
     else
     {
         script = "window.parent.CloseXtit(); window.parent.ShowMsg_Login('index.aspx');";
     }
     ScriptManager.RegisterClientScriptBlock(page, page.GetType(), "login", script, true);
 }
Exemplo n.º 33
0
        //public HttpResponseBase Response { get; }
        // //public WeChatApiDispatch()
        // {
        // }
        /// <summary>
        /// 微信信息xml格式
        ///<xml>
        ///<ToUserName><![CDATA[toUser]]></ToUserName>
        ///<FromUserName><![CDATA[fromUser]]></FromUserName>
        ///<CreateTime>1348831860</CreateTime>
        ///<MsgType><![CDATA[image]]></MsgType>
        ///<PicUrl><![CDATA[this is a url]]></PicUrl>
        ///<MediaId><![CDATA[media_id]]></MediaId>
        ///<MsgId>1234567890123456</MsgId>
        ///</xml>
        /// </summary>
        /// <param name="postStr"></param>
        /// <returns></returns>
        public string Execute(string postStr)
        {
            XmlDocument doc = new XmlDocument();

            doc.LoadXml(postStr);

            XmlElement rootElement = doc.DocumentElement;

            XmlNode MsgType = rootElement.SelectSingleNode("MsgType");

            //RequestXML requestXML = new RequestXML();
            string ToUserName = rootElement.SelectSingleNode("ToUserName").InnerText;

            string FromUserName = rootElement.SelectSingleNode("FromUserName").InnerText;

            string CreateTime = rootElement.SelectSingleNode("CreateTime").InnerText;

            string msgType = MsgType.InnerText;

            string resxml = string.Empty;

            string replyMsg = string.Empty;

            string defaultMsg = string.Empty;

            UserDal u3 = new UserDal();
            //u3.Temp("全局XML数据:"+postStr);
                switch (msgType.ToLower())
                {
                    case "event":
                        #region 事件消息
                        string eventType = rootElement.SelectSingleNode("Event").InnerText;
                        if (!string.IsNullOrEmpty(eventType))
                        {
                            UserBll ubll = new UserBll();
                            if (eventType == "subscribe")
                            {
                                //ubll.AddOpenId(FromUserName);
                                replyMsg = @"世界那么大,我想去看看。钱包那么小,哪都去不了。既然如此,那就干脆来份水果,对自己好一点吧~ 新鲜水果,0元起送,30分钟极速送达,记得给老板一个赞哦~   果然快,果然!快!好东西一定要跟身边的小伙伴分享哦 。
            一大拨活动即将到达战场··· 敬请关注。";
                            }
                            else if (eventType == "unsubscribe")
                            {
                                //ubll.RemoveOpenId(FromUserName);//取消关注删除用户
                            }
                        }
                        if (eventType.ToUpper() == "LOCATION")
                        {
                            //<Latitude>23.137466</Latitude>
                            //<Longitude>113.352425</Longitude>
                            //<Precision>119.385040</Precision>
                            double Latitude =0;
                            double Longitude =0;
                            UserBll ubll = new UserBll();
                            try
                            {
                                Latitude = rootElement.SelectSingleNode("Latitude").InnerText.ToDouble();
                                Longitude = rootElement.SelectSingleNode("Longitude").InnerText.ToDouble();
                                if (!ubll.FindOpenId(FromUserName))
                                {
                                    ubll.AddOpenId(FromUserName);
                                }
                                if (ubll.SaveLocation(Longitude, Latitude, FromUserName))
                                {

                                }

                            }
                            catch (Exception e)
                            {

                            }
                        }

                        #endregion
                        break;
                    case "view":
                        break;
                    case "text":
                        string content = rootElement.SelectSingleNode("Content").InnerText;
                        replyMsg = "对不起,您先稍等一下,小果果马上就来了,么么哒";

                        //文字消息
                        break;
                    default:
                        replyMsg = "default" + msgType;
                        break;
                }

            #region 其他类型消息

            //                //无匹配消息
            //                resxml = @"<xml>
            //                                <ToUserName><![CDATA[" + FromUserName + @"]]></ToUserName>
            //                                <FromUserName><![CDATA[" + ToUserName + @"]]></FromUserName>
            //                                <CreateTime>" + DateTime.Now.DateTimeToInt() + @"</CreateTime>
            //                                <MsgType><![CDATA[text]]></MsgType>
            //                                <Content><![CDATA[" + defaultMsg + @"]></Content>
            //                                </xml>";
            //                //图文消息
            //                resxml = @"<xml>
            //                                    <ToUserName><![CDATA[" + FromUserName + @"]]></ToUserName>
            //                                    <FromUserName><![CDATA[" + ToUserName + @"]]></FromUserName>
            //                                    <CreateTime>" + DateTime.Now.DateTimeToInt() + @"</CreateTime>
            //                                    <MsgType><![CDATA[news]]></MsgType>
            //                                    <ArticleCount>1</ArticleCount>
            //                                    <Articles>
            //                                            <item>
            //                                                <Title><![CDATA[" + title + @"]]></Title>
            //                                                <Description><![CDATA[" + msg + @"]]></Description>
            //                                                <PicUrl><![CDATA[" + imgUrl + @"]]></PicUrl>
            //                                                <Url><![CDATA[" + url + @"]]></Url>
            //                                            </item>
            //                                    </Articles>
            //                                    </xml>";

            //                //关注后消息
            //                resxml = @"<xml>
            //                            <ToUserName><![CDATA[" + FromUserName + @"]]></ToUserName>
            //                            <FromUserName><![CDATA[" + ToUserName + @"]]></FromUserName>
            //                            <CreateTime>" + DateTime.Now.DateTimeToInt() + @"</CreateTime>
            //                            <MsgType><![CDATA[text]]></MsgType>
            //                            <Content><![CDATA[欢迎关注哦]]></Content>
            //                            </xml>";
            #endregion
            msgType = "222";
            resxml = @"<xml>
                                <ToUserName>
                                        <![CDATA[" + FromUserName + @"]]>
                                </ToUserName>
                                <FromUserName>
                                        <![CDATA[" + ToUserName + @"]]>
                                </FromUserName>
                                <CreateTime>
                                        " + DateTime.Now.DateTimeToInt() + @"
                                </CreateTime>
                                <MsgType>
                                        <![CDATA[text]]>
                                </MsgType>
                                <Content>
                                        <![CDATA[" + replyMsg + @"]]>
                                </Content></xml>";
            return resxml;

            //ResponseText response = new ResponseText(info);
            //response.Content = "抱歉,此功能暂未开通。";
            //result = response.ToXml();
        }