コード例 #1
0
    void _ME(ModuleEvent <Module_Shop> e)
    {
        if (moduleShop.curShopPos != ShopPos.NpcDating)
        {
            return;
        }
        switch (e.moduleEvent)
        {
        case Module_Shop.EventShopData:
            var list = e.param1 as List <ShopMessage>;
            if (list == null || list.Count < 1)
            {
                break;
            }
            moduleShop.SetCurrentShop(list[0]);
            break;

        case Module_Shop.EventTargetShopData:
            m_shopMessage = (ShopMessage)e.param1;
            List <PShopItem> tempList = new List <PShopItem>(m_shopMessage.items);
            moduleNPCDating.HotelShopItemList = tempList;

            _Index(1);    //默认刷新第一页
            break;

        case Module_Shop.EventPaySuccess:
            Window_ItemTip.Show(ConfigText.GetDefalutString(TextForMatType.TravalShopUIText, 13), moduleShop.curClickItem);
            Hide <Window_DatingRestaurant>();   //关闭菜单界面
            break;

        default:
            break;
        }
    }
コード例 #2
0
        protected void btnPostMessage_Click(object sender, EventArgs e)
        {
            string   newMessageContent = txtNewMessageContent.Text.Trim();
            int      expireHours       = Parsers.ParseInt(drpMessageExpiry.SelectedValue);
            DateTime messageExpires    = DateTime.Now.AddHours(expireHours);
            bool     isImportant       = chkIsHighPriority.Checked;
            string   icon = drpIcon.SelectedValue;

            if (icon.Length <= 0)
            {
                icon = "default.png";
            }

            if (newMessageContent.Length > 0)
            {
                // Get the current logged in user
                LoginSessionRepository loginRepository = new LoginSessionRepository();
                string foundUserSessionID = loginRepository.GetSessionIDFromCookies(Request);

                LoginSession currentUser = loginRepository.LoadIfValid(foundUserSessionID, Request.ServerVariables["REMOTE_ADDR"], Request.ServerVariables["HTTP_USER_AGENT"]);
                if (currentUser != null)
                {
                    ShopMessageRepository messageRepo = new ShopMessageRepository();
                    ShopMessage           msg         = messageRepo.Add(currentUser.Username, newMessageContent, DateTime.Now, messageExpires, isImportant, icon);
                    tblActiveMessages.Rows.Add(addMessageTableRow(msg));
                }
            }
        }
コード例 #3
0
    protected override void OnHide(bool forward)
    {
        m_shopMessage = null;
        m_segmentDataDic.Clear();
        m_itemDataDic.Clear();

        moduleNPCDating.ContinueBehaviourCallBack();
    }
コード例 #4
0
    void _ME(ModuleEvent <Module_Shop> e)
    {
        if (!actived || moduleShop.curShopPos != ShopPos.Traval)
        {
            return;
        }
        ShopMessage msg = null;

        switch (e.moduleEvent)
        {
        case Module_Shop.EventShopData:
            var list = e.param1 as List <ShopMessage>;
            if (list == null || list.Count < 1)
            {
                break;
            }
            CreateToggles(list);
            EnterShop(m_subTypeLock);
            break;

        case Module_Shop.EventTargetShopData:
            msg = e.param1 as ShopMessage;
            if (msg != null)
            {
                dataSource.SetItems(msg.items);
                view.progress = 0;
            }
            else
            {
                dataSource.SetItems(null);
            }
            break;

        case Module_Shop.EventPaySuccess:
            payBtn.interactable = true;
            SetRefreshBtnState();
            Window_ItemTip.Show(ConfigText.GetDefalutString(TextForMatType.TravalShopUIText, 13), moduleShop.curClickItem);
            if (moduleShop.curShopMsg.isRandom)
            {
                SetSelectDefault();
            }
            int page = view.currentPage;
            dataSource.UpdateItems();
            view.ScrollToPage(page);
            break;

        case Module_Shop.EventPromoChanged:
            msg = e.param1 as ShopMessage;
            if (msg != null && msg.pos == ShopPos.Traval)
            {
                OnValueChangeCheck(true);
            }
            break;

        default: break;
        }
    }
コード例 #5
0
        private void UpdateShop()
        {
            _selectedShop.ShopName    = txtShopName.Text;
            _selectedShop.PhoneNumber = txtShopPhoneNumber.Text;
            _selectedShop.Email       = txtShopEmail.Text;
            _selectedShop.Address     = rtxtShopAddress.Text;

            _shopManager.Update(_selectedShop);
            MessageBox.Show(ShopMessage.UpdateMessage());
        }
コード例 #6
0
ファイル: Module_Shop.cs プロジェクト: NoeCalmness/CoreFrame
 public void SetCurrentShop(ShopMessage msg)
 {
     if (msg == null)
     {
         return;
     }
     lastShopMsg  = m_curShopMsg;
     m_curShopMsg = msg;
     curItmes     = msg.items;
     Logger.LogDetail("当前商店的ID={0},位置={1},", m_curShopMsg.shopId, m_curShopMsg.pos);
     DispatchModuleEvent(EventTargetShopData, m_curShopMsg);
 }
コード例 #7
0
    void _ME(ModuleEvent <Module_Shop> e)
    {
        if (!actived || moduleShop.curShopPos != ShopPos.Maze)
        {
            return;
        }
        ShopMessage msg = null;

        switch (e.moduleEvent)
        {
        case Module_Shop.EventShopData:
            var list = e.param1 as List <ShopMessage>;
            if (list == null || list.Count < 1)
            {
                break;
            }
            moduleShop.SetCurrentShop(list[0]);
            InitExchangePanel();
            break;

        case Module_Shop.EventTargetShopData:
            msg = e.param1 as ShopMessage;
            if (msg != null)
            {
                dataSource.SetItems(msg.items);
                view.progress = 0;
            }
            else
            {
                dataSource.SetItems(null);
            }
            break;

        case Module_Shop.EventPaySuccess:
            Window_ItemTip.Show(ConfigText.GetDefalutString(TextForMatType.TravalShopUIText, 13), moduleShop.curClickItem);
            InitExchangePanel();
            dataSource.UpdateItems();
            break;

        case Module_Shop.EventPromoChanged:
            msg = e.param1 as ShopMessage;
            if (msg != null && msg.pos == ShopPos.Maze)
            {
                InitExchangePanel();
                int page = view.currentPage;
                dataSource.UpdateItems();
                view.ScrollToPage(page);
            }
            break;

        default: break;
        }
    }
コード例 #8
0
        private void AddShop()
        {
            Shop shop = new Shop();

            shop.ShopName    = txtShopName.Text;
            shop.PhoneNumber = txtShopPhoneNumber.Text;
            shop.Email       = txtShopEmail.Text;
            shop.Address     = rtxtShopAddress.Text;

            _shopManager.Add(shop);
            MessageBox.Show(ShopMessage.AddMessage());
        }
コード例 #9
0
ファイル: Module_Shop.cs プロジェクト: NoeCalmness/CoreFrame
    public ShopMessage GetTargetShop(ushort _shopId)
    {
        ShopMessage msg = null;

        foreach (var item in m_allShops)
        {
            var list = item.Value;
            msg = list.Find(p => p.shopId == _shopId);
            if (msg != null)
            {
                return(msg);
            }
        }

        return(null);
    }
コード例 #10
0
ファイル: Module_Shop.cs プロジェクト: NoeCalmness/CoreFrame
 protected override void OnGameDataReset()
 {
     base.OnGameDataReset();
     m_curShopPos   = ShopPos.None;
     curFashionType = FashionType.None;
     m_allShops.Clear();
     m_allPromo.Clear();
     m_FashionShop.Clear();
     m_changeFashion.Clear();
     m_receiveTime.Clear();
     curClickItem  = null;
     lastClickItem = null;
     m_curShopMsg  = null;
     changedCloth  = false;
     curItmes?.Clear();
     m_npcShop.Clear();
     lastShopMsg = null;
 }
コード例 #11
0
        TableRow addMessageTableRow(ShopMessage msg)
        {
            TableRow returnMe = new TableRow();

            string iconPath = Settings.IconURL + "default.png";

            if (!string.IsNullOrEmpty(msg.Icon))
            {
                iconPath = Settings.IconURL + msg.Icon;
            }

            returnMe.Cells.Add(new TableCell()
            {
                Text = "<img src=\"" + iconPath + "\" style=\"width: 100px;background-color: black; border-radius: 5px;\">"
            });
            returnMe.Cells.Add(new TableCell()
            {
                Text = msg.Content
            });
            returnMe.Cells.Add(new TableCell()
            {
                Text = msg.Start.ToString()
            });
            returnMe.Cells.Add(new TableCell()
            {
                Text = msg.Sender
            });
            returnMe.Cells.Add(new TableCell()
            {
                Text = msg.End.ToString()
            });
            returnMe.Cells.Add(new TableCell()
            {
                Text = "<a href=\"?Remove=" + msg.ID + "\">Remove</a>"
            });

            return(returnMe);
        }
コード例 #12
0
ファイル: ShopItem.cs プロジェクト: NoeCalmness/CoreFrame
    public void RefreshUiData(ShopMessage msg, PShopItem data)
    {
        IniteCompent();

        var info = ConfigManager.Get <PropItemInfo>(data.itemTypeId);

        if (info == null)
        {
            return;
        }
        Util.SetItemInfoSimple(wupin, info);
        if (msg.pos == ShopPos.Npc)
        {
            AtlasHelper.SetIcons(wupin?.Find("icon"), info.mesh != null && info.mesh.Length > 1 ? info.mesh[1] : info.icon);
        }
        _name.text = info.itemName;
        count.text = "×" + data.num.ToString();
        Util.SetText(alreadyHave, (int)TextForMatType.TravalShopUIText, 9);
        Util.SetText(alreadySelled, (int)TextForMatType.TravalShopUIText, 10);
        Util.SetText(discountImage, (int)TextForMatType.TravalShopUIText, 12);
        cost_panel.SafeSetActive(true);
        grayPanel.SafeSetActive(false);
        //正常
        var currencyType = ConfigManager.Get <PropItemInfo>(data.currencyType);

        if (currencyType && payType)
        {
            payType.SafeSetActive(true);
            AtlasHelper.SetItemIcon(payType, currencyType);
        }
        cost.text = "×" + data.currencyNum.ToString();

        tip_btn.onClick.RemoveAllListeners();
        tip_btn.onClick.AddListener(() => { Module_Global.instance.UpdateGlobalTip(data.itemTypeId, true); });
        //促销
        int hash = Module_Shop.instance.GetPromoHash(msg.shopId, data.itemTypeId, data.num);

        PShopPromotion promotion = Module_Shop.instance.allPromo.Get(hash);

        if (promotion != null)
        {
            discountCostPanel.SafeSetActive(true);
            originalCost.text = "×" + data.currencyNum.ToString();
            if (promotion != null)
            {
                nowCost.text = "×" + promotion.price.ToString();
            }
            discountImage.transform.parent.SafeSetActive(true);
            cost.SafeSetActive(false);
        }
        else
        {
            discountCostPanel.SafeSetActive(false);
            cost.SafeSetActive(true);
            discountImage.transform.parent.SafeSetActive(false);
        }
        isHaved  = false;
        isSelled = false;

        //随机商店显示已售罄
        if (msg.isRandom)
        {
            isSelled = data.buy == 1;

            cost_panel.SafeSetActive(!isSelled);
            grayPanel.SafeSetActive(isSelled);
            alreadyHave.SafeSetActive(false);
            alreadySelled.SafeSetActive(isSelled);
        }

        //如果是时装显示已拥有&&不能是子类型为8的时装,为8的要显示已售罄
        var have = (info.itemType == PropType.FashionCloth && (FashionSubType)info.subType != FashionSubType.FourPieceSuit) || (info.itemType == PropType.HeadAvatar && info.subType == 1);

        if (have)
        {
            isHaved = Module_Equip.instance.HasProp(data.itemTypeId);

            cost_panel.SafeSetActive(!isHaved);
            grayPanel.SafeSetActive(isHaved);
            alreadyHave.SafeSetActive(isHaved);
            alreadySelled.SafeSetActive(false);
        }

        if (msg.pos == ShopPos.Npc && Module_Npc.instance.curNpc != null && Module_Npc.instance.curNpc.npcInfo != null)
        {
            isEquip = Module_Npc.instance.curNpc._mode == data.itemTypeId;
            isHaved = Module_Equip.instance.HasProp(data.itemTypeId) || isEquip || Module_Npc.instance.curNpc.npcInfo.cloth == data.itemTypeId;

            cost_panel.SafeSetActive(!isHaved);
            grayPanel.SafeSetActive(isHaved);
            grayPanel.enabled = !isHaved;
            alreadyHave.SafeSetActive(isHaved);
            alreadySelled.SafeSetActive(false);
            offImage.SafeSetActive(!isHaved);
            alreadyEquip.SafeSetActive(isEquip);
            //选中框
            if (isEquip && Module_Shop.instance.lastClickItem == null)
            {
                Module_Shop.instance.curClickItem = data;
            }
        }

        selectBox.SafeSetActive(Module_Shop.instance.curClickItem != null && Module_Shop.instance.curClickItem == data);
    }
コード例 #13
0
 private void DeleteShop()
 {
     _shopManager.Delete(_selectedShop);
     MessageBox.Show(ShopMessage.DeleteMessage());
 }