Example #1
0
 public static void ClearLowData()
 {
     charLowData              = null;
     itemLowData              = null;
     stringLowData            = null;
     resourceLowData          = null;
     partnerLowData           = null;
     monsterLowData           = null;
     npcLowData               = null;
     nonInteractiveNpcLowData = null;
     NewbieData               = null;
     skillLowData             = null;
     dungeonData              = null;
     etcData              = null;
     levelLowData         = null;
     mailLowData          = null;
     questLowData         = null;
     enchantLowData       = null;
     missionLowData       = null;
     mapLowData           = null;
     partnerLvLowData     = null;
     shopLowData          = null;
     priceLowData         = null;
     vipLowData           = null;
     iconLowData          = null;
     FormulaLowData       = null;
     guildLowData         = null;
     gatchaRewardLowData  = null;
     loadingLowData       = null;
     titleLowData         = null;
     welfareLowData       = null;
     achievementLowData   = null;
     activeLowData        = null;
     pvpAutoRewardLowData = null;
 }
        public IActionResult Vip()
        {
            ViewBag.Setting = _toursDbContext.Settings.First();
            Vip model = _toursDbContext.Vips.FirstOrDefault();

            return(View(model));
        }
Example #3
0
        protected void DoRefund(Vip entity)
        {
            var vipFee = _vipDal.GetAll <VipFee>().Where(p => p.VipId == entity.Id && p.Status == (int)PayStatus.支付成功).OrderByDescending(p => p.FeeTime).FirstOrDefault();

            if (vipFee != null && entity.FeeStatus == (int)PayStatus.支付成功)
            {
                var refundReqData = RefundRequestData.GetRefundRequestData((int)vipFee.Fee, vipFee.OrderCode, Server.MapPath("~/App_Data/apiclient_cert.p12"));
                _vipDal.Insert <VipFeeRefund>(new VipFeeRefund
                {
                    RtnOrderCode   = refundReqData.RtnOrderCode,
                    OrderCode      = vipFee.OrderCode,
                    VipId          = vipFee.VipId,
                    VipName        = entity.VipName,
                    RefundFee      = vipFee.Fee,
                    WXRtnOrderCode = refundReqData.WxRtnOrderCode,
                    Remark         = refundReqData.Remark
                });

                if (refundReqData.RefundResult.ToLower() == "success")
                {
                    //entity.IsReturnFee = true;
                    entity.FeeStatus = (int)PayStatus.待支付;
                }
            }
        }
Example #4
0
        private void setOnHook(int onHookType, User user, CqGroupMessageEventArgs e, string groupPath)
        {
            Vip vip = GetVipInfo(e, groupPath);

            if (vip.OnHookTime != "")
            {
                Common.CqApi.SendGroupMessage(e.FromGroup, "您已经处于挂机中,挂机时间:" + vip.OnHookTime);
                return;
            }


            DateTime nowTime = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
            DateTime endTime = Convert.ToDateTime(vip.endTime);

            TimeSpan timeSpan = endTime.Subtract(nowTime);

            int day = timeSpan.Days + 1;

            if (day < 7)
            {
                Common.CqApi.SendGroupMessage(e.FromGroup, "[" + user.Name + "] 您的会员即将到期,到期之后将不能享有会员服务,请及时购买会员!");
            }

            string type = onHookType == 2 ? "金币" : "经验";

            vip.OnHookTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            vip.OnHookType = type;

            SetVipInfo(vip, e, groupPath);

            Common.CqApi.SendGroupMessage(e.FromGroup, "挂机成功,时间:" + vip.OnHookTime);
            return;
        }
Example #5
0
        public async Task <IActionResult> Create([Bind("Id,ImagePath,ImageTitle,Title,SubTitle,Key,Value,Text,SubText,Phone,OtherPhone,Email,SiteAddress,Address,ServiceId")] Vip vip, IFormFile ImagePath)
        {
            CustomDateTimeFile customDateTimeFile = new CustomDateTimeFile();
            string             fileName           = customDateTimeFile.GetFileName(ImagePath.FileName);

            if (ModelState.IsValid)
            {
                vip.ImagePath = fileName;
                if (_IsAcceptedFormat(ImagePath.ContentType))
                {
                    string path = Path.Combine(hostingEnvironment.WebRootPath, "images", fileName);
                    byte[] data = new byte[ImagePath.Length];

                    using (FileStream fileStream = new FileStream(path, FileMode.Create))
                    {
                        await ImagePath.CopyToAsync(fileStream);
                    }
                }
                await _context.AddAsync(vip);

                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ServiceId"] = new SelectList(_context.Services, "Id", "Id", vip.ServiceId);
            return(View(vip));
        }
Example #6
0
        /// <summary>
        /// 微信注册
        /// </summary>
        /// <param name="openId"></param>
        /// <returns></returns>
        public bool WeChatRegist(Vip v, string openId)
        {
            var IsExist = !string.IsNullOrEmpty(_redisManage.StringGet(openId));

            if (IsExist)
            {
                return(true);
            }

            lock (locker)
            {
                //生产会员Id
                v.VipId = Guid.NewGuid().ToString();
                //生成会员编号
                v.VipCode = _vipRepository.QueryNewVipCode();
                v.VipCode = Utils.GetVipCode(v.VipCode);

                if (_vipRepository.InsertVip(v, openId))
                {
                    var vip = _vipRepository.QueryVipByOpenId(openId);
                    _redisManage.StringSet(openId, JsonConvert.SerializeObject(vip), TimeSpan.FromSeconds(600));
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
        }
Example #7
0
 public ActionResult ThemMoi(string tenLoaiVip, int moc, int giamHoaDon)
 {
     try
     {
         var vip = new Vip()
         {
             TenVip = tenLoaiVip,
             Moc    = moc,
             UuDai  = giamHoaDon
         };
         context.Vip.Add(vip);
         var result = context.SaveChanges();
         if (result > 0)
         {
             return(Json(new { Status = true, Message = "Thêm thành công!" }, JsonRequestBehavior.AllowGet));
         }
         else
         {
             return(Json(new { Status = false, Message = "Thất bại!" }, JsonRequestBehavior.AllowGet));
         }
     }
     catch
     {
         return(Json(new { Status = false, Message = "Trùng tên!" }, JsonRequestBehavior.AllowGet));
     }
 }
Example #8
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,ImagePath,ImageTitle,Title,SubTitle,Key,Value,Text,SubText,Phone,OtherPhone,Email,SiteAddress,Address,ServiceId")] Vip vip)
        {
            if (id != vip.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(vip);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!VipExists(vip.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ServiceId"] = new SelectList(_context.Services, "Id", "Id", vip.ServiceId);
            return(View(vip));
        }
Example #9
0
 ///<summary>
 /// 打开购买窗口
 /// </summary>
 private void openBuyWindow(Vip vip)
 {
     UiManager.Instance.openDialogWindow <BuyWindow> ((win) => {
         win.init(new LaddersChallengePrice(), Mathf.Min(LaddersManagement.Instance.currentChallengeTimes, vip.privilege.laddersCountBuyAdd - LaddersManagement.Instance.buyFightCount),
                  1, PrizeType.PRIZE_RMB, (msg) => {
             if (msg.msgEvent == msg_event.dialogOK)
             {
                 LaddersChallengePrice price = msg.msgInfo as LaddersChallengePrice;
                 if (price.getPrice(msg.msgNum) > UserManager.Instance.self.getRMB())
                 {
                     MessageWindow.ShowRecharge(LanguageConfigManager.Instance.getLanguage("s0158"));
                 }
                 else
                 {
                     FPortManager.Instance.getFPort <LaddersBuyChallengeFport> ().access(msg.msgNum, (success) => {
                         if (success)
                         {
                             LaddersManagement.Instance.currentChallengeTimes -= msg.msgNum;
                             LaddersManagement.Instance.buyFightCount         += msg.msgNum;
                             M_updateUserInfo();
                             UiManager.Instance.openDialogWindow <MessageLineWindow> ((showWin) => {
                                 showWin.Initialize(LanguageConfigManager.Instance.getLanguage("s0056", LanguageConfigManager.Instance.getLanguage("Arena01"), msg.msgNum.ToString()));
                             });
                         }
                     });
                 }
             }
         });
     });
 }
Example #10
0
    /*
     * protected void onChangePageHandler (int _currentPageIndex)
     * {
     *      vips = VipManagerment.Instance.getAllVip ();
     *      vipTitleLabel.text = "VIP " + vips [_currentPageIndex].vipLevel + LanguageConfigManager.Instance.getLanguage ("s0314");
     *      showGiftLevel = _currentPageIndex + 1;
     *      updateVipAwardInfo ();
     * }
     *
     * void Start ()
     * {
     *      radioScrollBar.onChangePage = onChangePageHandler;
     *      ResourcesManager.Instance.LoadAssetBundleTexture (UserManager.Instance.self.getIconPath (), icon);
     *      Vip[] vips = VipManagerment.Instance.getAllVip ();
     *      for (int i = 0; i < vipPages.Length && i < vips.Length; i++) {
     *              vipPages [i].vipinfo = vips [i];
     *              vipPages [i].updatePage ();
     *      }
     *      int level = UserManager.Instance.self.getVipLevel ();
     *      if (level > 0) {
     *              Vector3 currentVipPosition = vipPages [level - 1].transform.localPosition;
     *              Vector3 currentViewPosition = transform.localPosition;
     *              currentViewPosition.x = -currentVipPosition.x;
     *              SpringPanel.Begin (scrollView.gameObject, currentViewPosition, 1000f);
     *              sprite_vipIcon.gameObject.SetActive (true);
     *              sprite_vipIcon.spriteName = "vip" + level.ToString ();
     *              sprite_vipIcon.MakePixelPerfect ();
     *      } else {
     *              onChangePageHandler (0);
     *              sprite_vipIcon.gameObject.SetActive (false);
     *      }
     * }
     */
    public void updateInfo()
    {
        UserManager.Instance.setSelfHeadIcon(icon);

        int level = UserManager.Instance.self.getVipLevel();

        if (level > 0)
        {
            sprite_vipIcon.gameObject.SetActive(true);
            sprite_vipIcon.spriteName = "vip" + level;
            sprite_vipIcon.MakePixelPerfect();
        }
        else
        {
            sprite_vipIcon.gameObject.SetActive(false);
        }

        float exp     = (float)UserManager.Instance.self.getVipEXP() - (float)UserManager.Instance.self.getVipEXPDown();
        float expNeed = (float)UserManager.Instance.self.getVipEXPUp() - (float)UserManager.Instance.self.getVipEXPDown();

        if (UserManager.Instance.self.getVipLevel() == 0)
        {
            userVipInfo        = VipManagerment.Instance.getVipbyLevel(1);
            vipLevelLabel.text = LanguageConfigManager.Instance.getLanguage("s0319");
            nextLevelTip.text  = LanguageConfigManager.Instance.getLanguage("s0313", ((int)(expNeed - exp)).ToString(), (UserManager.Instance.self.getVipLevel() + 1).ToString());
        }
        else
        {
            userVipInfo = VipManagerment.Instance.getVipbyLevel(UserManager.Instance.self.vipLevel);
            //当前级别:VIP 1
            vipLevelLabel.text = LanguageConfigManager.Instance.getLanguage("s0317") + ":";             //VIP " + userVipInfo.vipLevel.ToString ();
            if (VipManagerment.Instance.getMaxLevel() == UserManager.Instance.self.vipLevel)
            {
                nextLevelTip.text = LanguageConfigManager.Instance.getLanguage("s0318");
            }
            else
            {
                //s0313|再充值 %1元可成为VIP%2
                nextLevelTip.text = LanguageConfigManager.Instance.getLanguage("s0313", ((int)(expNeed - exp)).ToString(), (UserManager.Instance.self.getVipLevel() + 1).ToString());
            }
        }

        //可能从隐藏回来调用,先重置
        expbar.reset();

        if (expNeed == 0)
        {
            //满级
            expbar.updateValue(1, 1);
            vipExpLabel.text = (int)UserManager.Instance.self.getVipEXP() + "/" + (int)UserManager.Instance.self.getVipEXPUp();
        }
        else
        {
            expbar.updateValue(UserManager.Instance.self.getVipEXP(), UserManager.Instance.self.getVipEXPUp());
            vipExpLabel.text = (int)UserManager.Instance.self.getVipEXP() + "/" + (int)UserManager.Instance.self.getVipEXPUp();
        }

        vipIcon.text = "VIP " + UserManager.Instance.self.vipLevel;
    }
Example #11
0
 /// <summary>
 /// 获取会员积分
 /// </summary>
 /// <param name="vipId"></param>
 /// <returns></returns>
 public List <CouponDto> GetVipCoupon(Vip vip)
 {
     if (vip != null)
     {
         return(_couponRepository.QueryCouponByVipId(vip.VipId));
     }
     return(null);
 }
Example #12
0
 /// <summary>
 /// 使用积分
 /// </summary>
 /// <param name="vipId"></param>
 /// <returns></returns>
 public bool UsePoint(Vip vip, int score)
 {
     if (vip != null)
     {
         return(_pointRepository.UpdatePoint(vip.VipId, score, "兑换优惠券"));
     }
     return(false);
 }
Example #13
0
 /// <summary>
 /// 获取会员积分
 /// </summary>
 /// <param name="vipId"></param>
 /// <returns></returns>
 public List <PointRecord> GetVipPointRecord(Vip vip)
 {
     if (vip != null)
     {
         return(_pointRepository.QueryPointRecordByVipId(vip.VipId));
     }
     return(null);
 }
Example #14
0
 /// <summary>
 /// 获取会员积分
 /// </summary>
 /// <param name="vipId"></param>
 /// <returns></returns>
 public Point GetVipPoint(Vip vip)
 {
     if (vip != null)
     {
         return(_pointRepository.QueryPointByVipId(vip.VipId));
     }
     return(null);
 }
Example #15
0
        public ActionResult Register(Vip vip, string verifyCode)
        {
            ViewBag.Title = "注册";

            if (string.IsNullOrEmpty(vip.MobileNo) || string.IsNullOrEmpty(vip.Password) || string.IsNullOrEmpty(vip.VipName))
            {
                ViewBag.Error = "请完善资料";
                return(View());
            }
            //验证手机号是否存在
            var isCheck = _dal.GetByMobile(vip.MobileNo);

            if (isCheck != null)
            {
                ViewBag.Error = "手机号已存在";
                return(View());
            }

            //验证身份证
            var user = _dal.GetByCardNo(vip.CardNo);

            if (user != null)
            {
                ViewBag.Error = "身份证号已存在";
                return(View());
            }

            //验证码
            if (Session["VerCode"] == null || Session["PhoneNo"] == null || Session["VerCode"].ToString() != verifyCode || Session["PhoneNo"].ToString() != vip.MobileNo)
            {
                ViewBag.Error = "验证码不正确";
                return(View());
            }

            var token = AccessTokenContainer.TryGetAccessToken(AppConfig.Instance.AppId, AppConfig.Instance.AppSecret);

            if (!string.IsNullOrEmpty(vip.CardImg))
            {
                var fileName = $"/upload/cardimg/{Guid.NewGuid().ToString("N")}.jpg";
                Senparc.Weixin.MP.AdvancedAPIs.MediaApi.Get(token, vip.CardImg, Server.MapPath("~" + fileName));

                vip.CardImg = fileName;
            }

            //添加用户
            vip.CreatedBy   = "system";
            vip.CreatedTime = DateTime.Now;
            vip.UpdatedBy   = "system";
            vip.UpdatedTime = DateTime.Now;
            vip.ImgPath     = "/assets/web/images/i_03.png";

            _dal.Insert(vip);

            OAuthHelper.DoOAuth(HttpContext, vip.MobileNo);

            return(new EmptyResult());
        }
Example #16
0
        public IActionResult UpdateUserRefund([FromForm] int key, [FromForm] string values)
        {
            var UserRefund = new UserRefund();

            UserRefund = _rUserRefund.GetById(key);
            var preStatus = UserRefund.Status;

            JsonConvert.PopulateObject(values, UserRefund);

            _rUserRefund.otherOperation += () =>
            {
                _rAuditRecord.InsertWithOutTransaction(new AuditRecord
                {
                    AuditId   = UserRefund.Id.ToString(),
                    AuditType = (int)AuditType.Refund,
                    AuditDate = DateTime.Now,
                    AuditorId = _loginUserProvider.GetUserID(),
                    Remark    = UserRefund.Remark,
                    PreStatus = preStatus,
                    ToStatus  = UserRefund.Status
                });
            };

            _rUserRefund.otherOperation += () =>
            {
                var UserOrders = new UserOrders();
                UserOrders        = _rUserOrders.List(m => m.OrderId == UserRefund.OrderId).FirstOrDefault();
                UserOrders.Status = UserRefund.Status == -1 ? 4 : 3;
                // 赚道会员
                if (UserOrders.OrderType == Vip.ToValue() && UserRefund.Status == 1)
                {
                    var userInfo = _rUserInfo.List(u => u.UserId == UserOrders.UserId).FirstOrDefault();
                    userInfo.Vip = 0;
                    _rUserInfo.UpdateWithOutTransaction(userInfo);
                }
                // 活动
                if (UserOrders.OrderType == Activity.ToValue() && UserRefund.Status == 1)
                {
                    var actInfo = _rActivityInfo.GetById(UserOrders.SourceId);
                    // 活动参加人数减一, 嘉宾表移除该用户
                    actInfo.Attendance -= 1;
                    var actguest = actInfo.ActivityGuests.FirstOrDefault(g => g.UserId == UserOrders.UserId);
                    actInfo.ActivityGuests.Remove(actguest);
                    _rActivityInfo.UpdateWithOutTransaction(actInfo);
                }
                _rUserOrders.UpdateWithOutTransaction(UserOrders);
            };

            int i = _rUserRefund.Update(UserRefund);

            if (i > 0)
            {
                return(new OkObjectResult(new { Message = "OK" }));
            }
            return(new OkObjectResult(new { Message = "False" }));
        }
Example #17
0
    //解析配置
    public override void parseConfig(string str)
    {
        Vip be = new Vip(str);

        if (list == null)
        {
            list = new List <Vip> ();
        }
        list.Add(be);
    }
Example #18
0
    void updateVipAwardInfo()
    {
        //awardButton.transform.localPosition = new Vector3(awardButton.transform.localPosition.x, awardButton.transform.localPosition.y - 11, awardButton.transform.localPosition.z);
        Vip vip = ActiveShowItem.getVip();

        awardButton.textLabel.text = vip.vipAwardName;
        awardButton.textLabel.gameObject.SetActive(false);
        alreadyGetAward.SetActive(false);
        titleLabel.text = "VIP " + vip.vipLevel + LanguageConfigManager.Instance.getLanguage("s0314");
    }
Example #19
0
        public int GetGoodIdByVipLevel(int vipLevel)
        {
            Vip vipByLevel = this.GetVipByLevel(vipLevel);

            if (vipByLevel == null)
            {
                return(0);
            }
            return(vipByLevel.goodId);
        }
Example #20
0
        public Vip GetVipById(int id)
        {
            Vip vip = null;

            if (!this.id_vipMap.TryGetValue(id, out vip))
            {
                return(null);
            }
            return(vip);
        }
Example #21
0
        public Vip createVip(Vip vip)
        {
            db.Insert(new Vip()
            {
                Name = vip.Name, Age = vip.Age, Country = vip.Country
            });

            // this is not good way but Jsonfile does not support  returning the auto id assigning, in "real" application with DB this should be implemented diffrently
            return(db.Select(p => p.Name == vip.Name && p.Age == vip.Age && p.Country == vip.Country).First <Vip>());
        }
Example #22
0
        public int GetGoodIdByVipId(int vipId)
        {
            Vip vipById = this.GetVipById(vipId);

            if (vipById == null)
            {
                return(0);
            }
            return(vipById.goodId);
        }
Example #23
0
 // Edit vip
 public HttpResponseMessage Put([FromBody] Vip entry)
 {
     if (db.updateVip(entry))
     {
         return(new HttpResponseMessage(HttpStatusCode.OK));
     }
     else
     {
         return(new HttpResponseMessage(HttpStatusCode.BadRequest));
     }
 }
Example #24
0
    public int recalculateSkillEXP()
    {
        int  exp      = 0;
        long skillExp = 0;

        foreach (SacrificeShowerCtrl each in castShowers)
        {
            if (each.card != null)
            {
                exp += each.card.getEatenExp();
                //主技能加分
                Skill[] mskill = each.card.getSkills();
                if (mskill != null && mskill.Length > 0)
                {
                    foreach (Skill emk in mskill)
                    {
                        skillExp += emk.getEXP();
                    }
                }
                //buff技能加分
                Skill[] bskill = each.card.getBuffSkills();
                if (bskill != null && bskill.Length > 0)
                {
                    foreach (Skill emk in bskill)
                    {
                        skillExp += emk.getEXP();
                    }
                }
                //被动技能加分
                Skill[] askill = each.card.getAttrSkills();
                if (askill != null && askill.Length > 0)
                {
                    foreach (Skill emk in askill)
                    {
                        skillExp += emk.getEXP();
                    }
                }
            }
        }
        double baseExp   = exp + skillExp;
        double rateValue = 1.0f;
        //vip额外经验值=10000+vip额外值)/10000
        int vipExpValue;

        if (UserManager.Instance.self.getVipLevel() > 0)
        {
            Vip vip = VipManagerment.Instance.getVipbyLevel(UserManager.Instance.self.getVipLevel());
            rateValue += (float)(vip.privilege.skillExpAdd) / 10000.0f;
        }
        double totalExp = (double)(baseExp * rateValue);

        return((int)totalExp);
    }
Example #25
0
        // 设置Vip信息
        protected void SetVipInfo(Vip vip, CqGroupMessageEventArgs e, string groupPath)
        {
            string userId = e.FromQQ.ToString();

            iniTool.IniWriteValue(groupPath, vipInfoIni, userId, "等级", vip.Level.ToString());
            iniTool.IniWriteValue(groupPath, vipInfoIni, userId, "到期时间", vip.endTime);
            iniTool.IniWriteValue(groupPath, vipInfoIni, userId, "保护", vip.Protect.ToString());
            iniTool.IniWriteValue(groupPath, vipInfoIni, userId, "成功率", vip.SuccessRate.ToString());
            iniTool.IniWriteValue(groupPath, vipInfoIni, userId, "挂机时间", vip.OnHookTime);
            iniTool.IniWriteValue(groupPath, vipInfoIni, userId, "挂机类型", vip.OnHookType);
            iniTool.IniWriteValue(groupPath, vipInfoIni, userId, "次数", vip.Number.ToString());
        }
Example #26
0
    public int getMaxCanBuyCount()
    {
        int addNum   = 0;
        int vipLevel = UserManager.Instance.self.vipLevel;
        Vip vip      = VipManagerment.Instance.getVipbyLevel(vipLevel);

        if (vip != null)
        {
//			addNum = vip.privilege.godsWarCountBuyAdd;
        }
        return(GodsWarInfoConfigManager.Instance().getSampleBySid(1001).num[0] + addNum);
    }
Example #27
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_xiugai_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.txt_phone.Text == "" || this.txt_name.Text == "" || this.txt_zhekou.Text == "")
                {
                    MessageBox.Show("信息不能为空", "温馨提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
                //else if (TextBoxBll.Intextnull(this.txt_name.Text, 1))
                //{
                //    MessageBox.Show("姓名过长", "温馨提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                //}
                else if (TextBoxBll.Intextnull(this.txt_phone.Text, 3))
                {
                    MessageBox.Show("请输入正确的电话号码", "温馨提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
                else if (TextBoxBll.Intextnull(this.txt_zhekou.Text, 2))//验证折扣是否为1~0之间的数字
                {
                    MessageBox.Show("积分必须是正整数", "温馨提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
                else
                {
                    //string sql = string.Format("update vip set VipName='{0}',Mobile='{1}',Gender='{2}',Discount={3} where vipID={4}) ", txt_name.Text, txt_phone.Text, this.cbo_gander.Text, this.txt_zhekou.Text, id);
                    Vip vip = new Vip()
                    {
                        VipID   = id,
                        Mobile  = this.txt_phone.Text,
                        jifen   = 0,
                        VipName = this.txt_name.Text,
                        Gender  = this.cbo_gander.Text
                    };
                    if (VipBll.UpdateVip(vip))
                    {
                        this.dgv_VIP.DataSource = VipBll.GetBooks();
                        MessageBox.Show("修改成功", "温馨提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                throw;
            }
            finally
            {
                this.dgv_VIP.DataSource = VipBll.GetBooks();

                this.txt_name.Text            = "";
                this.txt_phone.Text           = "";
                this.txt_zhekou.Text          = "";
                this.cbo_gander.SelectedIndex = 0;
            }
        }
Example #28
0
        private void endOnHook(User user, CqGroupMessageEventArgs e, string groupPath)
        {
            Vip vip = GetVipInfo(e, groupPath);

            if (vip.OnHookTime == "")
            {
                Common.CqApi.SendGroupMessage(e.FromGroup, "您未处于挂机中");
                return;
            }

            DateTime startTime = Convert.ToDateTime(vip.OnHookTime);

            DateTime nowTime = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));

            if (!user.isVip)
            {
                nowTime = Convert.ToDateTime(vip.endTime);
            }

            TimeSpan timeSpan = nowTime.Subtract(startTime);

            int mTime = (int)Math.Round(timeSpan.TotalMinutes);

            if (vip.OnHookType == "金币")
            {
                int coin = iniTool.ReadInt(devPath, vipIni, "挂机", "金币", 5);

                SetKnapsackItemNum("金币", coin * mTime, groupPath, e.FromQQ.ToString());

                Common.CqApi.SendGroupMessage(e.FromGroup, "共挂机:" + mTime + "分钟, 获得金币:" + mTime * coin);
            }
            else
            {
                int exp = iniTool.ReadInt(devPath, vipIni, "挂机", "经验", 10);

                user.Exp += exp * mTime;

                iniTool.IniWriteValue(groupPath, userInfoIni, e.FromQQ.ToString(), "经验", user.Exp.ToString());

                Common.CqApi.SendGroupMessage(e.FromGroup, "共挂机:" + mTime + "分钟, 获得经验:" + mTime * exp);

                eventManage.OnIsUplevel(user, groupPath, e);
            }

            vip.OnHookTime = "";
            vip.OnHookType = "";

            SetVipInfo(vip, e, groupPath);

            return;
        }
Example #29
0
    //统一处理vip升级特权情况
    public void updateLevel(int oldLevel, int newLevel)
    {
        vipPrivilege _vipPrivilege1 = getVipbyLevel(newLevel).privilege;
        Vip          _vip2          = getVipbyLevel(oldLevel);
        vipPrivilege _vipPrivilege2 = _vip2 == null ? null : _vip2.privilege;

        //增加讨伐次数
//		if (FuBenManagerment.Instance.getWarInfos () != null)
//			FuBenManagerment.Instance.getWarChapter ().addNum (_vipPrivilege2 == null ? _vipPrivilege1.bossCountAdd : _vipPrivilege1.bossCountAdd - _vipPrivilege2.bossCountAdd);
        StorageManagerment.Instance.updateRoleStorageMaxSpace(_vipPrivilege2 == null ? _vipPrivilege1.cardStoreAdd : _vipPrivilege1.cardStoreAdd - _vipPrivilege2.cardStoreAdd);
        StorageManagerment.Instance.updateEquipStorageMaxSpace(_vipPrivilege2 == null ? _vipPrivilege1.equipStoreAdd : _vipPrivilege1.equipStoreAdd - _vipPrivilege2.equipStoreAdd);
        UserManager.Instance.self.updatePvEPointMax(_vipPrivilege2 == null ? _vipPrivilege1.pveAdd : _vipPrivilege1.pveAdd - _vipPrivilege2.pveAdd);
        FriendsManagerment.Instance.getFriends().addMaxSize(_vipPrivilege2 == null ? _vipPrivilege1.friendAdd : _vipPrivilege1.friendAdd - _vipPrivilege2.friendAdd);
    }
Example #30
0
        private Vip LoadVipFromXml(SecurityElement element)
        {
            Vip vip = new Vip {
                id      = StrParser.ParseHexInt(element.Attribute("Id"), 0),
                level   = StrParser.ParseDecInt(element.Attribute("Level"), 1),
                costRMB = StrParser.ParseDecInt(element.Attribute("CostRMB"), 0),
                goodId  = StrParser.ParseHexInt(element.Attribute("GoodId"), 0)
            };

            if (element.Children != null)
            {
                foreach (SecurityElement element2 in element.Children)
                {
                    string tag = element2.Tag;
                    if (tag != null)
                    {
                        if (tag != "Privilege")
                        {
                            if (tag == "VipLimitCount")
                            {
                                goto Label_00E1;
                            }
                            if (tag == "VipLotteryCount")
                            {
                                goto Label_00F5;
                            }
                            if (tag == "OpenFunction")
                            {
                                goto Label_0109;
                            }
                        }
                        else
                        {
                            vip.privileges.Add(this.LoadPrivilegesFromXml(element2));
                        }
                    }
                    continue;
Label_00E1:
                    vip.vipLimitCount.Add(this.LoadVipLimitCountFromXml(element2));
                    continue;
Label_00F5:
                    vip.vipLotteryCount.Add(this.LoadVipLotteryCountFromXml(element2));
                    continue;
Label_0109:
                    vip.openFuncitons.Add(TypeNameContainer <_OpenFunctionType> .Parse(element2.Text, 0));
                }
            }
            return(vip);
        }
Example #31
0
        public void RegistrarSelos(Vip vip)
        {

        }