コード例 #1
0
ファイル: Utility.cs プロジェクト: kener1985/MyGitHubProj
        public static void InvokeAction(string action, string cmd, StrDictionary sd)
        {
            string module;

            bool bHint = false;
            if (String.IsNullOrEmpty(action.Trim()) == true)
            {
                action = "Default";
            }
            module = action.Replace('.', '\\') + "Action";

            AssemblyName an = new AssemblyName();
            an.CodeBase = "file:///" + GlobalVar.AppPath + "actions\\" + module + ".dll";
            try
            {
                Assembly ass = Assembly.Load(an);
                Type[] types = ass.GetExportedTypes();

                foreach (Type t in types)
                {
                    Type intf = t.GetInterface("BaseLib.IAction");

                    if (intf != null)
                    {
                        BaseLib.IAction act = ass.CreateInstance(t.FullName) as BaseLib.IAction;
                        if (act != null)
                        {
                            if (act.IsMe(cmd) == true)
                            {
                                try
                                {
                                    act.DoAction(sd);
                                }
                                catch (Exception ex)
                                {
                                    string msg = "Action:" + module + "执行" + action + "时发生内部错误\r\n";
                                    msg += ex.Message;
                                    throw new Exception(msg);
                                }

                                bHint = true;
                                break;
                            }
                        }
                    }
                }
                if (bHint == false)
                    GlobalVar.Log.LogWarm("Action未命中", "在" + module + "中没有找到" + action + "对应的Action:" + cmd);
            }
            catch (System.Exception ex)
            {
                //System.Windows.Forms.MessageBox.Show(ex.Message);
                System.Windows.Forms.MessageBox.Show("Action : [" + module + "] 发生错误");
                GlobalVar.Log.LogError("加载Action失败!", ex.Message);
            }
        }
コード例 #2
0
 void InitCondition(Tab_StoryCopyScene tBook)
 {
     for (int nIndex = 0; nIndex < tBook.getStarDescribCount(); ++nIndex)
     {
         if (nIndex >= 0 && nIndex < m_ConditionText.Length)
         {
             string temp = "#{" + tBook.GetStarDescribbyIndex(nIndex).ToString() + "}";
             m_ConditionText[nIndex].text = StrDictionary.GetClientDictionaryString(temp);
         }
     }
 }
コード例 #3
0
 void MakeShenQi_CurEquip_Ok()
 {
     if (IsNeedWaringHaveLowShenQiEquip())
     {
         MessageBoxLogic.OpenOKCancelBox(StrDictionary.GetClientDictionaryString("#{5220}"), "", MakeItemOK, MakeItemCancel);
     }
     else
     {
         MakeItemOK();
     }
 }
コード例 #4
0
    void Reset()
    {
        m_LblVipLevel.text = VipData.GetVipLv().ToString();
        int nRemainNum = VipData.GetVipCopySceneRemainBuyNum(m_nBuyCopySceneId, m_bIsSinglePlayerCopyScene);

        m_LbLBuyNum.text    = nRemainNum.ToString();
        m_LblRemainNum.text = nRemainNum.ToString();
        int nPointNum = Utils.GetSceneBuyPoint(m_nBuyCopySceneId, m_bIsSinglePlayerCopyScene);

        m_LblBuyPointNum.text = StrDictionary.GetClientDictionaryString("#{5395}", nPointNum * nRemainNum);
    }
コード例 #5
0
    //点击 解散师门
    void OnClickDissolve()
    {
        //掌门才能解散
        if (GameManager.gameManager.PlayerDataPool.IsMasterChief() == false)
        {
            return;
        }
        string dicStr = StrDictionary.GetClientDictionaryString("#{3186}");

        MessageBoxLogic.OpenOKCancelBox(dicStr, "", ClickDissolveOK, null);
    }
コード例 #6
0
 void ClickWashAgain()
 {
     if (m_bNewAttrImport)
     {
         //是否继续培养
         MessageBoxLogic.OpenOKCancelBox(StrDictionary.GetClientDictionaryString("#{5201}"), "", WashAgainOK);
     }
     else
     {
         WashAgainOK();
     }
 }
コード例 #7
0
 void CancelNewAttr()
 {
     if (m_bNewAttrImport)
     {
         //是否回退
         MessageBoxLogic.OpenOKCancelBox(StrDictionary.GetClientDictionaryString("#{4954}"), "", GiveUpOK);
     }
     else
     {
         GiveUpOK();
     }
 }
コード例 #8
0
 void SaveNewAttr()
 {
     if (m_bOldAttrImport)
     {
         //是否替换
         MessageBoxLogic.OpenOKCancelBox(StrDictionary.GetClientDictionaryString("#{4953}"), "", SaveOk);
     }
     else
     {
         SaveOk();
     }
 }
コード例 #9
0
    void Buy()
    {
        if (!m_nIsItemCanBuy)
        {
            Singleton <ObjManager> .GetInstance().MainPlayer.SendNoticMsg(false, "#{3194}");

            return;
        }

        NumChooseController.OpenWindow(m_nShopItemChangeMin, m_nShopItemChangeMax,
                                       StrDictionary.GetClientDictionaryString("#{2837}"), MsgBoxBuyGuildItemOK, 1);
    }
コード例 #10
0
    void OnLoadChannelListItem(GameObject resItem, object param)
    {
        for (int i = 0; i < SceneData.SceneInstList.Count; i++)
        {
            ChannelListItem.CreateItem(ChannelListGrid, resItem, SceneData.SceneInstList[i].ToString(), this, StrDictionary.GetClientDictionaryString("#{1177}", (SceneData.SceneInstList[i] + 1).ToString()));
        }

        ChannelListGrid.GetComponent <UIGrid>().repositionNow = true;
        int nLine = SceneData.SceneInst + 1;

        m_CurLineLable.text = StrDictionary.GetClientDictionaryString("#{3192}", nLine);
    }
コード例 #11
0
ファイル: GuildMission.cs プロジェクト: kimch2/PackageClient
    public void UpdateGuildData(GC_RET_GUIDMISSION_DATA pak)
    {
        PlayerData MyPlayerData = GameManager.gameManager.PlayerDataPool;

        if (MyPlayerData == null)
        {
            return;
        }
        if (MyPlayerData.GuildInfo == null)
        {
            return;
        }
        if (false == MyPlayerData.IsHaveGuild())
        {
            return;
        }

        // 帮主才能看见
        if (true == MyPlayerData.IsGuildChief())
        {
            m_OpenButton.isEnabled = true;
        }

        Tab_GuildMissionGuild guildMisGuild = TableManager.GetGuildMissionGuildByID(MyPlayerData.GuildInfo.GuildLevel, 0);

        if (guildMisGuild == null)
        {
            LogModule.ErrorLog("Can not find guidMissionGuid {0}", MyPlayerData.GuildInfo.GuildLevel);
            return;
        }

        // 发布次数
        if (m_GuildMisAssignTimesLabel && pak.HasAssignTimes)
        {
            m_GuildMisAssignTimesLabel.text = pak.AssignTimes + "/" + guildMisGuild.CanAssignTime;
        }
        // 可接次数
        if (m_GuildMisCanAcptTimesLabel && pak.HasAcceptTimes)
        {
            m_GuildMisCanAcptTimesLabel.text = pak.AcceptTimes + "/" + guildMisGuild.CanAcceptTimesOnce;/*((guildMisGuild.CanAssignTime - pak.AssignTimes) * guildMisGuild.CanAcceptTimesOnce);*/
        }
        // 帮会财富
        if (m_GuildWealthLabel && pak.HasGuildWeath)
        {
            m_GuildWealthLabel.text = pak.GuildWeath.ToString();
        }

        // 开启信息
        if (m_OpenInfoLabel)
        {
            m_OpenInfoLabel.text = StrDictionary.GetClientDictionaryString("#{5421}", guildMisGuild.ConsumeWealth, guildMisGuild.CanAcceptTimesOnce);
        }
    }
コード例 #12
0
    //点击 技能激活按钮
    void OnClickSkillActive()
    {
        if (m_CurSelectSkill < 0)
        {
            //Singleton<ObjManager>.GetInstance().MainPlayer.SendNoticMsg(true, "请先选择技能");
            Singleton <ObjManager> .GetInstance().MainPlayer.SendNoticMsg(true, StrDictionary.GetClientDictionaryString("#{2803}"));

            return;
        }

        m_SkillNameInputObject.gameObject.SetActive(true);
    }
コード例 #13
0
    // 剩余时间更新
    void UpdateLeftTime()
    {
        int nHour = m_LeftTime / (60 * 60);
        int nMin  = (m_LeftTime % (60 * 60)) / 60;
        int nSec  = m_LeftTime % 60;

        if (m_LeftTimeText != null)
        {
            //m_LeftTimeText.text = "距离下次领奖:" + nHour/10 + nHour%10 + ":" + nMin/10 + nMin%10 + ":" + nSec/10 + nSec%10;
            m_LeftTimeText.text = StrDictionary.GetClientDictionaryString("#{2868}", nHour / 10, nHour % 10, nMin / 10, nMin % 10, nSec / 10, nSec % 10);
        }
    }
コード例 #14
0
 public void CleanUp()
 {
     m_GuildAName.text      = StrDictionary.GetClientDictionaryString("#{3334}"); //"??????";
     m_GuildBName.text      = StrDictionary.GetClientDictionaryString("#{3334}"); //"??????";
     m_GuildABak.spriteName = "changtai";
     m_GuildABak.transform.localPosition = new Vector3(0, 0, 0);
     m_GuildABak.MakePixelPerfect();
     m_GuildBBak.spriteName = "changtai";
     m_GuildBBak.MakePixelPerfect();
     m_GuildBBak.transform.localPosition = new Vector3(0, 0, 0);
     gameObject.SetActive(false);
 }
コード例 #15
0
ファイル: FlyWingDream.cs プロジェクト: kimch2/PackageClient
    public void showDreamBtn()
    {
        if (m_CurClickItemId != GlobeVar.INVALID_ID && m_CurClickItemId == GameManager.gameManager.FlyWingMananger.CurDreamFlyWingId)
        {
            m_DreamText.text = StrDictionary.GetClientDictionaryString("#{3876}");
        }

        else
        {
            m_DreamText.text = StrDictionary.GetClientDictionaryString("#{1492}");
        }
    }
コード例 #16
0
 public void UpdatePlayerDecorationInfo()
 {
     m_LablePlayerDecoration.text = StrDictionary.GetClientDictionaryString("#{3480}", ChristmasTreeData.m_nPlayerDecoration);
     if (ChristmasTreeData.m_nMeDecorationRank >= 0)
     {
         m_LablePlayerDecorationRank.text = StrDictionary.GetClientDictionaryString("#{3479}", ChristmasTreeData.m_nMeDecorationRank + 1);
     }
     else
     {
         m_LablePlayerDecorationRank.text = StrDictionary.GetClientDictionaryString("#{3356}");
     }
 }
コード例 #17
0
 public string InsertLinkSymbols(string text)
 {
     if (m_eChatLinkType != ChatInfoLogic.LINK_TYPE.LINK_TYPE_INVALID && m_eChatLinkType != ChatInfoLogic.LINK_TYPE.LINK_TYPE_INVALID1)
     {
         text = text.Replace(m_LinkText, "<a>" + m_LinkText + "</a>");
         if (m_eChatLinkType == ChatInfoLogic.LINK_TYPE.LINK_TYPE_GUILD)
         {
             text = StrDictionary.GetClientDictionaryString("#{3111}", GameManager.gameManager.PlayerDataPool.GuildInfo.GuildName) + text;
         }
     }
     return(text);
 }
コード例 #18
0
    private void UpdateCountTip(int nMoneyTreeID)
    {
        if (m_CountTipText)
        {
            m_CountTipText.text = StrDictionary.GetClientDictionaryString("#{2479}", MoneyTreeFreeAwardTimes - nMoneyTreeID, MoneyTreeFreeAwardTimes);
        }

        //if (nMoneyTreeID >= MoneyTreeFreeAwardTimes)
        //{
        //    m_FreeAwardButton.isEnabled = false;
        //}
    }
コード例 #19
0
    void UpdateButtons()
    {
        if (m_Mode == PARADE_MODE)
        {
            m_Button1.SetActive(true);
            m_Button2.SetActive(true);
            m_Button1Text.text = StrDictionary.GetClientDictionaryString("#{3137}");
            m_Button2Text.text = StrDictionary.GetClientDictionaryString("#{3138}");
            m_NPCTalk.text     = StrDictionary.GetClientDictionaryString("#{3136}");
        }

        if (m_Mode == MARRY_MODE)
        {
            m_Button1.SetActive(true);
            m_Button2.SetActive(true);
            m_Button1Text.text = StrDictionary.GetClientDictionaryString("#{2724}");
            m_Button2Text.text = StrDictionary.GetClientDictionaryString("#{2725}");
        }
        if (m_Mode == DIVORCE_MODE)
        {
            m_Button1.SetActive(true);
            m_Button2.SetActive(true);
            m_Button1Text.text = StrDictionary.GetClientDictionaryString("#{2726}");
            m_Button2Text.text = StrDictionary.GetClientDictionaryString("#{2725}");;
        }
        if (m_Mode == DIVORCE_MODE_STEP1)
        {
            m_Button1.SetActive(true);
            m_Button2.SetActive(true);
            m_Button1Text.text = StrDictionary.GetClientDictionaryString("#{2729}");
            m_Button2Text.text = StrDictionary.GetClientDictionaryString("#{2730}");
            m_NPCTalk.text     = StrDictionary.GetClientDictionaryString("#{2728}");
        }
        if (m_Mode == DIVORCE_MODE_STEP2)
        {
            m_Button1.SetActive(true);
            m_Button2.SetActive(true);

            int nProfession = GameManager.gameManager.PlayerDataPool.Profession;
            if (nProfession % 2 == 1)
            {
                //m_Button1Text.text = StrDictionary.GetClientDictionaryString("#{2732}","他");
                m_Button1Text.text = StrDictionary.GetClientDictionaryString("#{2862}");
            }
            else
            {
                //m_Button1Text.text = StrDictionary.GetClientDictionaryString("#{2732}","她");
                m_Button1Text.text = StrDictionary.GetClientDictionaryString("#{2863}");
            }
            m_Button2Text.text = StrDictionary.GetClientDictionaryString("#{2733}");
            m_NPCTalk.text     = StrDictionary.GetClientDictionaryString("#{2731}");
        }
    }
コード例 #20
0
    //点击 技能遗忘按钮
    void OnClickSkillForget()
    {
        if (m_CurSelectSkill < 0)
        {
            //Singleton<ObjManager>.GetInstance().MainPlayer.SendNoticMsg(false, "请先选择技能");
            Singleton <ObjManager> .GetInstance().MainPlayer.SendNoticMsg(false, StrDictionary.GetClientDictionaryString("#{2803}"));

            return;
        }

        Singleton <ObjManager> .GetInstance().MainPlayer.ReqForgetMasterSkill(m_CurSelectSkill);
    }
コード例 #21
0
 void OnEnable()
 {
     m_Instance = this;
     m_LoudSpeakerInput.defaultText = StrDictionary.GetClientDictionaryString("#{4350}");
     labelChatText = labelChatText2;
     m_LinkRoot    = m_LinkRoot2;
     m_EmotionRoot = m_EmotionRoot2;
     InitCurLoudSpeaker();
     UpdateRemainText();
     InitAnoymousTabBtn();
     UpdateLouderSpeakerCount();
 }
コード例 #22
0
    void OnLoadAwardItem(GameObject gAwardItem)
    {
        if (null == gAwardItem)
        {
            LogModule.ErrorLog("can not load award activeItem");
            return;
        }
        int nMaxRecordCount = TableManager.GetActivenessAward().Count;

        for (int i = 0; i < nMaxRecordCount; i++)
        {
            Tab_ActivenessAward pAward = TableManager.GetActivenessAwardByID(i, 0);
            if (pAward == null)
            {
                LogModule.DebugLog("ActivenessAward: ActivenessAward.txt can't find line " + i);
                continue;
            }

            string     strName    = i.ToString();
            AwardState awardState = AwardState.AWARD_CANNNTHAVE;
            bool       bFlag      = GameManager.gameManager.PlayerDataPool.AwardActivityData.GetActivenessAwardFlag(i);
            if (bFlag == false && Activeness >= pAward.MiniActiveness)
            {
                awardState = AwardState.AWARD_CANHAVE;
            }
            else if (bFlag == false && Activeness < pAward.MiniActiveness)
            {
                awardState = AwardState.AWARD_NOTHAVEDONE;
            }
            else if (bFlag == true)
            {
                awardState = AwardState.AWARD_HAVEDONE;
            }
            else
            {
                awardState = AwardState.AWARD_CANNNTHAVE;
            }

            ActivenessAwardItem AwardItem = ActivenessAwardItem.CreateAwardItem(strName, m_ItemGrid.gameObject, gAwardItem);
            if (AwardItem)
            {
                AwardItem.AddAwardUI(pAward.Exp, pAward.Money, pAward.BindYuanbao, pAward.AwardSkillExp, pAward.AwardReputation);
                AwardItem.AddItemUI(pAward.ItemDataID, pAward.ItemCount);
                AwardItem.AddAwardUIRepution(pAward.AwardReputation);
                AwardItem.AwardInfoText    = StrDictionary.GetClientDictionaryString("#{1634}", pAward.MiniActiveness);
                AwardItem.AwardButtonState = awardState;
                AwardItem.TurnID           = pAward.Id;
            }
        }// end for

        m_ItemGrid.repositionNow = true;
        m_ItemGrid.sorted        = true;
    }
コード例 #23
0
    void RecordOver()
    {
        /*byte[] buffer = Encoding.GetEncoding("utf-8").GetBytes("发送到asdf\0发送asdfasdf到\0发123");
         * if (m_eCurChannelType == CHANNEL_TYPE.CHAT_TYPE_FRIEND)
         * {
         *  m_GameChatInput.SubmitTextAndVoice("/" + m_FriendChatReceiverName + " " + "123", buffer);
         * }
         * else
         * {
         *  m_GameChatInput.SubmitTextAndVoice("123阿斯蒂芬发生大发违法若违反23人23人23日前付清飞", buffer);
         * }
         * OnSpeechTaskOver("123", buffer);*/

        if (m_ForceStopRecord)
        {
            return;
        }

        if (m_eCurChannelType != ChatInfoLogic.CHANNEL_TYPE.CHAT_TYPE_FRIEND &&
            m_eCurChannelType != ChatInfoLogic.CHANNEL_TYPE.CHAT_TYPE_TEAM &&
            m_eCurChannelType != ChatInfoLogic.CHANNEL_TYPE.CHAT_TYPE_GUILD &&
            m_eCurChannelType != ChatInfoLogic.CHANNEL_TYPE.CHAT_TYPE_MASTER &&
            m_eCurChannelType != ChatInfoLogic.CHANNEL_TYPE.CHAT_TYPE_TELL)
        {
            return;
        }

        Vector3 vecReleasePos = new Vector3(0, 0, 0);

#if !UNITY_EDITOR && (UNITY_IPHONE || UNITY_ANDROID || UNITY_WP8)
        vecReleasePos = Input.GetTouch(0).position;
#else
        vecReleasePos = Input.mousePosition;
#endif

        m_VoiceTitle.SetActive(false);

        LogModule.DebugLog("PressRelease " + m_TouchVoiceChatPos + "=====" + vecReleasePos);

        if (vecReleasePos.y - m_TouchVoiceChatPos.y > 50)
        {
            m_SpeeachLogic.Cancel();
            GUIData.AddNotifyData2Client(false, StrDictionary.GetClientDictionaryString("#{5046}"));
        }
        else
        {
            m_SpeeachLogic.StopSpeaking();
            GUIData.AddNotifyData2Client(false, StrDictionary.GetClientDictionaryString("#{3326}"));
        }

        m_isSpeech = false;
    }
コード例 #24
0
ファイル: PopMenuLogic.cs プロジェクト: kimch2/PackageClient
    //////////////////////////////////////////////////////////////////////////
    //目标头像PopMenu点击相关函数以及其专属菜单项函数
    //////////////////////////////////////////////////////////////////////////
    void ShowTargetFramePopMenu()
    {
        //如果非玩家,则无效
        if (null == TargetFrameLogic.Instance() || GlobeVar.INVALID_GUID == TargetFrameLogic.Instance().TargetGuid)
        {
            return;
        }

        bool isteammate = false;//是否对友

        TeamMember[] member = GameManager.gameManager.PlayerDataPool.TeamInfo.teamMember;
        if (m_PopMenuSelectGuid != GlobeVar.INVALID_GUID)
        {
            for (int i = 0; i < member.Length; ++i)
            {
                //如果队员的GUID为非空,并且和主角不一样,则显示
                if (member[i].Guid == m_PopMenuSelectGuid)
                {
                    isteammate = true;
                    break;
                }
            }
        }
        //如果目标是自己也不发送加好友
        if (Singleton <ObjManager> .GetInstance().MainPlayer.GUID == TargetFrameLogic.Instance().TargetGuid)
        {
            return;
        }

        m_PopMenuSelectGuid = TargetFrameLogic.Instance().TargetGuid;
        m_PopMenuSelectName = TargetFrameLogic.Instance().StrTargetName;

        //添加菜单项.部分菜单暂时隐藏

        AddMenuItem(m_MenuItemsNum, StrDictionary.GetClientDictionaryString("#{1299}"), PopMenuAddFriend);    //加好友
        //AddMenuItem(m_MenuItemsNum, StrDictionary.GetClientDictionaryString("#{1300}"), PopMenuChat);         //私聊
        if (!isteammate)
        {
            AddMenuItem(m_MenuItemsNum, StrDictionary.GetClientDictionaryString("#{1301}"), PopMenuInviteTeam);   //邀请入队
            AddMenuItem(m_MenuItemsNum, StrDictionary.GetClientDictionaryString("#{1302}"), PopMeunJoinTeam);     //申请入队
        }
        //AddMenuItem(m_MenuItemsNum, StrDictionary.GetClientDictionaryString("#{1657}"), PopMenuDuel);         //申请切磋
        AddMenuItem(m_MenuItemsNum, StrDictionary.GetClientDictionaryString("#{2181}"), PopMenuView);         //申请查看信息
        //AddMenuItem(m_MenuItemsNum, StrDictionary.GetClientDictionaryString("#{2554}"), PopMenuConsignSaleInfo);//申请查看寄售信息
        //AddMenuItem(m_MenuItemsNum, StrDictionary.GetClientDictionaryString("#{1156}"), PopMenuInviteGuild);     //邀请入帮
        //AddMenuItem(m_MenuItemsNum, StrDictionary.GetClientDictionaryString("#{3093}"), PopMeunJoinGuild);     //申请入帮
        if (GlobalData.IsOpenCharmRankFlag)
        {
            //AddMenuItem(m_MenuItemsNum, StrDictionary.GetClientDictionaryString("#{5298}"), PopMenuSendFlower);     ////送花
            //AddMenuItem(m_MenuItemsNum, StrDictionary.GetClientDictionaryString("#{5299}"), PopMenuSendEgg);     //砸蛋
        }
    }
コード例 #25
0
    void ShowOpponentView()
    {
        UIStage       = 1;
        SearchSecond  = 0;
        progress.text = WuLinData.WuLinRounderTip();
        if (WuLinData.OppoViewInfo.guid == Games.GlobeDefine.GlobeVar.INVALID_GUID)
        {
            string text = "";
            if (WuLinData.Rounder == 1)
            {
                text = StrDictionary.GetClientDictionaryString("#{4813}");
            }
            else
            {
                string roundTips = WuLinData.WuLinRoundTipPrefix();
                text = StrDictionary.GetClientDictionaryString("#{4814}", roundTips);
            }

            searchTip.text = text;
            Countdown.text = text;
        }
        else
        {
            searchTip.text = Utils.GetDicByID(1845);
            Countdown.text = Utils.GetDicByID(1845);
            int id = (int)WuLinData.OppoViewInfo.profession;
            Tab_RoleBaseAttr roleBaseAttr = TableManager.GetRoleBaseAttrByID(id, 0);
            if (roleBaseAttr != null)
            {
                Tab_CharModel charModel = TableManager.GetCharModelByID(roleBaseAttr.CharModelID, 0);
                if (charModel != null)
                {
                    HeadIcon.spriteName = charModel.HeadPic;
                }
            }
            // if( id >= 0 && id <  CharacterDefine.PROFESSION_DICNUM.Length)
            {
                Profession.text = Utils.GetProfessionNameByType(id);
                //Utils.GetDicByID(CharacterDefine.PROFESSION_DICNUM[id]);
            }
        }

        Name.text      = WuLinData.OppoViewInfo.name;
        CombatNum.text = WuLinData.OppoViewInfo.combat.ToString();
        HP.text        = WuLinData.OppoViewInfo.hp.ToString();
        MP.text        = WuLinData.OppoViewInfo.mp.ToString();
        Attack.text    = WuLinData.OppoViewInfo.atk.ToString();
        Defense.text   = WuLinData.OppoViewInfo.def.ToString();
        Critical.text  = WuLinData.OppoViewInfo.cri.ToString();
        Speed.text     = WuLinData.OppoViewInfo.spd.ToString();
        dodge.text     = WuLinData.OppoViewInfo.dge.ToString();
    }
コード例 #26
0
    void ShowCompareStrengthenLevel(GameItem equip)
    {
        int nStrengthenLevel = equip.EnchanceLevel;
        //string strStrengthenLevel = "[FFFF33]强化 +{0}";
        string strStrengthenLevel = StrDictionary.GetClientDictionaryString("#{2830}", nStrengthenLevel);

        m_CompareStrengthenLevelLabel.text = strStrengthenLevel;
        //腰带不显示强化等级
        if (equip.IsBelt())
        {
            m_CompareStrengthenLevelLabel.text = "";
        }
    }
コード例 #27
0
 public void ShowHelpInfo()
 {
     if (m_HelpInfo == null)
     {
         return;
     }
     if (m_Help == null)
     {
         return;
     }
     m_HelpInfo.text = StrDictionary.GetClientDictionaryString("#{11295}");
     m_Help.SetActive(!m_Help.activeSelf);
 }
コード例 #28
0
    void RefreshCreateRolePanelInfo(int chooseIndex)
    {
        ROLE_PROFESSION m_ChooseProType = (ROLE_PROFESSION)chooseIndex;

        if (ROLE_PROFESSION.ROLE_SJS == m_ChooseProType)
        {
            m_ProTitle.text = StrDictionary.GetClientDictionaryString("#{1700}");
        }
        else if (ROLE_PROFESSION.ROLE_KZS == m_ChooseProType)
        {
            m_ProTitle.text = StrDictionary.GetClientDictionaryString("#{1699}");
        }
    }
コード例 #29
0
    void OnEnable()
    {
        LoginData.ServerListData lastServerData = LoginData.GetServerListDataByID(PlayerPreferenceData.LastServer);

        if (null != lastServerData)
        {
            SetCurServerInfo(lastServerData);
        }
        else
        {
            labelLastServer.text = StrDictionary.GetClientDictionaryString("#{1006}");
        }
    }
コード例 #30
0
    public void SetData(BelleGetItemWindow parentWindow, Tab_BelleGetItemWay belleGetItemWay)
    {
        if (null == belleGetItemWay)
        {
            return;
        }
        m_parentWindow = parentWindow;

        gameObject.name = belleGetItemWay.Id.ToString();

        m_belleItemGetDesc.text  = StrDictionary.GetClientDictionaryString("#{" + belleGetItemWay.WayDescDictId + "}");
        m_getItemIcon.spriteName = belleGetItemWay.WayIcon;
    }
コード例 #31
0
    public void InitElementSkill_Baby()
    {
        m_FlagLabel.text = StrDictionary.GetClientDictionaryString("#{10535}");
        m_FlagLabel.gameObject.SetActive(true);

        m_LockSprite.SetActive(true);
        m_NameLabel.gameObject.SetActive(false);
        m_ExpLabel.gameObject.SetActive(false);
        m_SkillIcon.gameObject.SetActive(false);
        m_QualityPic.spriteName = "white-jinengkuang";
        m_LevelLabel.gameObject.SetActive(false);
        m_LevelUpButton.SetActive(false);
    }
コード例 #32
0
ファイル: FormBrowser.cs プロジェクト: kener1985/MyGitHubProj
        void CallInFrame(StrDictionary sd)
        {
            try
            {
                HtmlDocument doc = GlobalVar.Container;
                StringBuilder sz = new StringBuilder();
                foreach (KeyValuePair<string, string> kv in sd)
                {
                    sz.Append(kv.Key).Append('=').Append(kv.Value).Append('&');

                }
                doc.InvokeScript(sd["invoke"], new object[] { sz.ToString().Substring(0,sz.Length-1) });
            }catch(Exception )
            {
                MessageBox.Show("frame 无效!");
            }
        }
コード例 #33
0
        public void Generate(StrDictionary sd)
        {
            string file = GlobalVar.AppPath + "__debug_html.html";
            char[] sep = { ',' };
            string[] js = (sd["script"] + ",common").Split(sep);
            string[] css = sd["css"].Split(sep);
            string body = this._wb.Document.Body.OuterHtml;

            StringBuilder sz = new StringBuilder(256);
            sz.AppendLine("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">");

            sz.AppendLine("<HTML>");
            sz.AppendLine(" <HEAD>");
            sz.AppendLine("  <TITLE> Debug page </TITLE>\r\n");
            AddCss(sz, css);
            AddScript(sz, js);
            sz.AppendLine(body);
            sz.AppendLine("</HTML>");
            System.IO.File.WriteAllText(file, sz.ToString(), Encoding.UTF8);
        }
コード例 #34
0
ファイル: Action.cs プロジェクト: kener1985/MyGitHubProj
 public void DoAction(StrDictionary sd)
 {
     GlobalVar.MainFrame.Hide();
 }
コード例 #35
0
ファイル: FormBrowser.cs プロジェクト: kener1985/MyGitHubProj
        void wb_BeforeNavigate2(object pDisp, ref object URL, ref object Flags, ref object TargetFrameName, ref object PostData, ref object Headers, ref bool Cancel)
        {
            //_RequestId = "";
            StrDictionary sd = new StrDictionary();
            byte[] b = PostData as byte[];
            string surl = URL as string;
            int flag = (int)Flags;
            if (TargetFrameName != null)
                currentFrameName = TargetFrameName.ToString();
            if (b == null)//post 或 get时,该值不为0
                return;

            //sd.Add("pageid", _PageId);
            int i = surl.IndexOf('?');
            if (GlobalVar.Container == null)
                GlobalVar.Container = GetCurrentContainer(TargetFrameName.ToString());
            try
            {
                if (i != -1)
                    Utility.ParseQuery(surl.Substring(i + 1), sd);

                string action = GlobalVar.Container.InvokeScript("GetAction") as string;
                if (sd.ContainsKey("action"))
                    action = sd["action"];

                if (String.IsNullOrEmpty(action))
                    action = "Default";

                if (b != null)
                {
                    string post = Encoding.UTF8.GetString(b).Trim(new char[]{'\0'});

                    Utility.ParseQuery(post, sd);
                    //GlobalVar.Actions["post"].DoAction(url, sd);
                    GlobalVar.Log.LogDebug("InvokeAction [post]", surl);
                    Utility.InvokeAction(action, "post", sd);
                    Cancel = true;
                }
                else if (flag != 0) //GET方法
                {
                    Utility.InvokeAction(action,"get", sd);
                    GlobalVar.Log.LogDebug("InvokeAction [get]", surl);
                    Cancel = true;
                }
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
コード例 #36
0
ファイル: Action.cs プロジェクト: kener1985/MyGitHubProj
 public void DoAction(StrDictionary sd)
 {
     AddProductFrm frm = new AddProductFrm();
     frm.ShowDialog();
 }
コード例 #37
0
ファイル: Action.cs プロジェクト: kener1985/MyGitHubProj
        public void DoAction(StrDictionary sd)
        {
            AbstractDbHelper helper  = GlobalVar.DBHelper;
            helper.AddCustomParam("@seqnbr",sd["seqnbr"]);
            DataTable tbl = helper.MultiTableSelect("select bi.seqnbr,bi.num,bi.c_num,bi.type,bi.saleoff,bi.saleprice,bi.mark,p.id,p.colornum,p.innerid,p.productid,p.size " +
            "from billitem bi,products p where bi.seqnbr=@seqnbr and p.id=bi.productid", true);

            EasyUITable etb = new EasyUITable();
            etb.Table = tbl;
            GlobalVar.Container.InvokeScript(sd["invoke"], new Object []{ etb.ToJson()});
        }
コード例 #38
0
ファイル: Action.cs プロジェクト: kener1985/MyGitHubProj
        public void DoAction(StrDictionary sd)
        {
            GlobalVar.DBHelper.BeginBatch();
            string oriId = null;//原id
            //修改订单,先将之前的信息冲掉
            if (sd["oprtype"].Equals("modify"))
            {
                //保存原id
                GlobalVar.DBHelper.AddCustomParam("@seqnbr", sd["seqnbr"]);
                oriId = Convert.ToString(GlobalVar.DBHelper.ExcuteForUnique("select id from bills where seqnbr=@seqnbr", true));

                if (!restoreBalance(sd["seqnbr"]))
                {
                    MessageBox.Show("修改订单失败");
                    GlobalVar.DBHelper.EndBatch(true);//异常强制回滚
                    return;
                }
            }else if(sd["oprtype"].Equals("delete"))
            {
                //删除账单,并回滚库存及相关记录

                bool success = restoreBalance(sd["seqnbr"]);
                GlobalVar.DBHelper.EndBatch(!success);

                GlobalVar.Container.InvokeScript(sd["invoke"],new object[]{success});
                return;
            }

            string oprcode = sd["operator"];
            GlobalVar.DBHelper.AddInsert("billitem", "productid,num,type,saleoff,mark,seqnbr,saleprice,c_num");
            GlobalVar.DBHelper.AddInsert("bills", "id,seqnbr,payer,purunit,mobile,pid,operator,pagecode,type");

            //billitem表
            EasyUITable etb = new EasyUITable();
            etb.Parse(sd["data"]);
            DateTime dtNow = DateTime.Now;
            long billseq = dtNow.Ticks;
            if (sd.ContainsKey("seqnbr") && sd["seqnbr"] != null && !sd["seqnbr"].Equals(String.Empty))
            {
                billseq = Convert.ToInt64(sd["seqnbr"]);
            }

            etb.Table.Columns.Add("seqnbr");
            foreach (DataRow r in etb.Table.Rows)
            {
                r.SetField<long>("seqnbr", billseq);
                r.AcceptChanges();
                r.SetAdded();
            }

            etb.Table.TableName = "billitem";

            //bills 表
            DataTable tbBill = new DataTable();
            tbBill.Init("bills", "id,seqnbr,operator,mobile,payer,pid,purunit,pagecode,type");
            DataRow row = tbBill.NewRow();
            if (oriId != null)
                row.SetField<long>("id", Convert.ToInt64(oriId));
            row.SetField<long>("seqnbr", billseq);
            row.SetField<string>("operator", oprcode);
            row.SetField<string>("mobile", sd["mobile"]);
            row.SetField<string>("payer", sd["payer"]);
            row.SetField<string>("purunit", sd["purunit"]);
            row.SetField<string>("pid", sd["pid"]);
            row.SetField<string>("pagecode", sd["pagecode"]);
            row.SetField<string>("type", sd["type"]);
            tbBill.Rows.Add(row);

            //products 表
            string idset = GetIdSet(etb.Table, "productid");
            DataTable tbProd = new DataTable("products");
            GlobalVar.DBHelper.AddSelectWithLimit("products", "id,storenum", "id IN " + idset);
            GlobalVar.DBHelper.AddUpdate("products", "id,storenum,size,position", "id");
            GlobalVar.DBHelper.Fill(ref tbProd);

            //storehistory表
            GlobalVar.DBHelper.AddInsert("storenumhistory", "mark,num,billseqnbr,seqnbr,type,productid,finalstore,opr,customer");
            DataTable tblHis = new DataTable();
            tblHis.Init("storenumhistory", "mark,num,billseqnbr,seqnbr,type,productid,finalstore,opr,customer");

            //账务明细表
            GlobalVar.DBHelper.AddInsert("debtdetail", "main_seqnbr,billseq,opr,mark,seqnbr,amount,type");
            DataTable tblDebt = new DataTable();
            tblDebt.Init("debtdetail", "main_seqnbr,billseq,seqnbr,opr,mark,date,amount,type");
            DataRow debtrow = tblDebt.NewRow();
            debtrow.SetField<string>("opr", oprcode);
            debtrow.SetField<long>("seqnbr", dtNow.Ticks);
            debtrow.SetField<string>("amount", sd["amount"]);
            debtrow.SetField<string>("type", sd["type"]);
            debtrow.SetField<string>("main_seqnbr", billseq.ToString());
            debtrow.SetField<string>("billseq", billseq.ToString());

            if (sd["pid"] != "0")
            {
                string mainSeqnbr = GlobalVar.DBHelper.ExcuteForUnique<string>("select seqnbr from bills where id=" + sd["pid"]);
                debtrow.SetField<string>("main_seqnbr", mainSeqnbr);
            }

            tblDebt.Rows.Add(debtrow);
            //平衡货品数量
            Balance(etb.Table, tbProd, tblHis, sd, billseq);
            DataSet ds = new DataSet();
            ds.Tables.AddRange(new DataTable[] { etb.Table, tbProd, tbBill, tblHis, tblDebt });

            //新增账单数据 更新货品数据
            int ret = GlobalVar.DBHelper.Update(ds, "billitem,products,bills,storenumhistory,debtdetail");
            //int ret = GlobalVar.DBHelper.Update(ds, "billitem,bills,debtdetail");
            if (ret == -1)
            {
                GlobalVar.DBHelper.EndBatch(true);
                GlobalVar.Container.InvokeScript("resultCallback", new object[] { false });
                return;
            }
            //若更新主单,需同时更新关联的子单
            /*if (oriPid != null)
            {
                try
                {
                    GlobalVar.DBHelper.AddCustomParam("@seqnbr", billseq);
                    string newPid = Convert.ToString(GlobalVar.DBHelper.ExcuteForUnique("select id from bills where seqnbr=@seqnbr", true));
                    GlobalVar.DBHelper.AddCustomParam("@newPid", newPid);
                    GlobalVar.DBHelper.AddCustomParam("@oldPid", oriPid);
                    GlobalVar.DBHelper.ExcuteNonQuery("update bills set pid=@newPid where pid=@oldPid");

                    GlobalVar.DBHelper.AddCustomParam("@newSeqnbr", dtNow.Ticks);
                    GlobalVar.DBHelper.AddCustomParam("@oldSeqnbr", sd["seqnbr"]);
                    GlobalVar.DBHelper.ExcuteNonQuery("update debtdetail set main_seqnbr=@newSeqnbr where main_seqnbr=@oldSeqnbr");
                }
                catch (Exception e)
                {
                    GlobalVar.DBHelper.EndBatch(true);
                    GlobalVar.Container.InvokeScript("resultCallback", new object[] { false });
                    return;
                }
            }*/
            bool noErr = Utility.ProcessSqlError(ds);
            GlobalVar.DBHelper.EndBatch(noErr == false);
            //账单录入版暂不进行打印
            //if (noErr)
            //    BillPrinter.Print(etb.Table, sd);
            GlobalVar.Container.InvokeScript("resultCallback", new object[] { noErr });
        }
コード例 #39
0
ファイル: Action.cs プロジェクト: kener1985/MyGitHubProj
        public void DoAction(StrDictionary sd)
        {
            //StrDictionary sd = Utility.ParseQuery(url.OriginalString);
            //int iData = sDec.IndexOf("?");
            //    string sDec = System.Web.HttpUtility.UrlDecode(sd["data"]);

            //    string json = "{\"data\":" + sDec + "}";
            //    MessageBox.Show(json);
            //    Package p = new Package();

            //    try
            //    {
            //        p = UtilHelper.Converter.JSonXmlConverter.Json2Obj<Package>(json);

            //    }
            //    catch (System.Exception ex)
            //    {
            //        MessageBox.Show(ex.Message);
            //    }
            //}

            //public override void ParseQuery(Uri url, out StrDictionary sd)
            //{
            //    sd = Utility.ParseQuery(url.OriginalString);
        }
コード例 #40
0
ファイル: Action.cs プロジェクト: kener1985/MyGitHubProj
        public void DoAction(StrDictionary sd)
        {
            AbstractDbHelper helper = GlobalVar.DBHelper;

            string name = sd["table"];
            if (sd.ContainsKey("limit") && String.IsNullOrEmpty(sd["limit"]) == false)
                helper.AddSelectWithLimit(name, sd["fields"], sd["limit"]);
            else
                helper.AddSelect(name, sd["fields"]);
            //helper.AddSelect(name, sd["fields"]);
            EasyUITable tbl = new EasyUITable();
            DataTable t = new DataTable(name);
            helper.Fill(ref t);
            GlobalVar.transferCodeToName(t, "opr");
            tbl.Table = t;
            bool isLong = (sd.ContainsKey("longdate") && sd["longdate"].Equals("true")) ? true : false;
            GlobalVar.AddDateFildFromSeqnbr(tbl.Table, isLong);
            GlobalVar.Container.InvokeScript(sd["invoke"], new object[] { tbl.ToJson() });
        }
コード例 #41
0
ファイル: Action.cs プロジェクト: kener1985/MyGitHubProj
        private DataTable FilterForsingle(DataTable tbl)
        {
            DataTable rst = new DataTable();
            StrDictionary sd = new StrDictionary();
            rst.Init("", "item,price");
            foreach (DataRow r in tbl.Rows)
            {
                string item = r.Field<string>("innerid");
                if (String.IsNullOrEmpty(item))
                    item = r.Field<string>("productid");

                item += " - ";
                item += r.Field<string>("colornum");

                if (sd.ContainsKey(item) == false)
                {
                    sd[item] = "";
                    DataRow nr = rst.NewRow();
                    nr.SetField<string>("item", item);
                    nr.SetField<decimal>("price", r.Field<decimal>("saleprice"));
                    rst.Rows.Add(nr);
                }
            }
            return rst;
        }
コード例 #42
0
ファイル: Action.cs プロジェクト: kener1985/MyGitHubProj
        public void DoAction(StrDictionary sd)
        {
            EasyUITable etb = new EasyUITable();
            DataTable tbl = new DataTable("products");
            string keyword = sd["data"].Trim();
            GlobalVar.DBHelper.AddSelectWithLimit("products", "productid", "productid LIKE @keyword AND status!='1' GROUP BY productid");
            GlobalVar.DBHelper.AddCustomParam("@keyword", "%" + keyword + "%");
            GlobalVar.DBHelper.Fill(ref tbl);
            etb.Table = tbl;

            GlobalVar.Container.InvokeScript(sd["invoke"], new object[] { etb.ToJson() });
        }
コード例 #43
0
ファイル: Action.cs プロジェクト: kener1985/MyGitHubProj
 public void DoAction(StrDictionary sd)
 {
     GlobalVar.Container.InvokeScript(sd["invoke"], new object[] { GlobalVar.LogInfo.Role, GlobalVar.LogInfo.Name });
 }
コード例 #44
0
ファイル: Action.cs プロジェクト: kener1985/MyGitHubProj
 public void DoAction(StrDictionary sd)
 {
     EasyUITable etb = new EasyUITable();
     etb.Parse(sd["data"]);
     BillPrinter.Print(etb.Table, sd);
 }
コード例 #45
0
ファイル: Action.cs プロジェクト: kener1985/MyGitHubProj
        public void DoAction(StrDictionary sd)
        {
            StringBuilder sb = new StringBuilder();
            string cus = sd["customer"].Trim();
            string mark = sd["mark"].Trim();

            bool hasCon = false;
            string sql = "SELECT p.id as pid,p.name,p.colornum,p.innerid,p.productid,s.id,s.mark,s.type,s.num,s.finalstore,s.opr,s.customer,s.seqnbr " +
               "FROM products as p,storenumhistory as s WHERE p.id=s.productid";
            if (String.IsNullOrEmpty(cus) == false)
            {
                hasCon = true;
                sb.Append(" AND s.customer LIKE @customer");
                GlobalVar.DBHelper.AddCustomParam("@customer", "%" + cus + "%");
            }
            if (String.IsNullOrEmpty(mark) == false)
            {
                hasCon = true;
                sb.Append(" AND s.mark LIKE @mark");
                GlobalVar.DBHelper.AddCustomParam("@mark", "%" + mark + "%");
            }
            if (hasCon == false)
            {
                MessageBox.Show("请输入客户名称或备注");
                return;
            }
            string lmt = sb.ToString();
            lmt += @" ORDER BY s.id DESC";
            DataTable tbl = GlobalVar.DBHelper.MultiTableSelect(sql + lmt, true);

            GlobalVar.transferCodeToName(tbl, "opr");
            EasyUITable eut = new EasyUITable();
            GlobalVar.AddDateFildFromSeqnbr(tbl, true);
            eut.Table = tbl;
            GlobalVar.Container.InvokeScript(sd["invoke"], new object[] { eut.ToJson() });
        }
コード例 #46
0
ファイル: Action.cs プロジェクト: kener1985/MyGitHubProj
        public void DoAction(StrDictionary sd)
        {
            string qs = "";
            if (String.IsNullOrEmpty(sd["data"]))
            {
                qs = MakeQueryBillStr(sd);
                if (qs == null)
                {
                    GlobalVar.Container.InvokeScript(sd["invoke"], new object[] { "" });
                    return;
                }
            }
            else//查明细
            {
                StringBuilder sz = new StringBuilder();
                string id = sd["data"];
                if (sd.ContainsKey("main") && sd["main"] == "true")//记录为主单
                {
                    sz.Append("id=").Append(id).Append(" OR pid=").Append(id);
                }
                else//记录为副单,先查出主单id
                {
                    object pid = GlobalVar.DBHelper.ExcuteForUnique("select pid from bills where id=" + id);
                    sz.Append("id=").Append(pid).Append(" OR pid=").Append(pid);
                }
                sz.Append(" ORDER BY seqnbr DESC");
                qs = sz.ToString();
            }

            EasyUITable etb = new EasyUITable();
            DataTable tbl = new DataTable("bills");
            string fields = "id,payer,seqnbr,purunit,operator,mobile,pid,pagecode,type";

            //MessageBox.Show(qs);
            GlobalVar.DBHelper.AddSelectWithLimit("bills", fields, qs);

            GlobalVar.DBHelper.Fill(ref tbl);
            //MessageBox.Show(tbl.Rows.Count.ToString());
            etb.Table = tbl;
            GlobalVar.AddDateFildFromSeqnbr(etb.Table, false);
            GlobalVar.transferCodeToName(etb.Table, "operator");
            GlobalVar.Container.InvokeScript(sd["invoke"], new object[] { etb.ToJson(), sd["data"] });
        }
コード例 #47
0
ファイル: FormBrowser.cs プロジェクト: kener1985/MyGitHubProj
        /** 初始都是open命令打开的容器 **/
        private void wb_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
            //if (e.Url.OriginalString != _RequestId)
            //    return;

            //_RequestId = "";
            HtmlDocument doc = GlobalVar.Container;
            //页面初始化
            if (doc == null && this.Document != null)
            {
                string param = "";
                int idx = e.Url.OriginalString.IndexOf('?');
                if (idx != -1)
                    param = e.Url.OriginalString.Substring(idx);

                this.Document.InvokeScript("InitPage", new object[] { param });

            }
            if (doc == null || doc.Url.Scheme == "res")
            {
                FormBrowser fb = sender as FormBrowser;
                if (fb != null && fb.Document != null)
                {
                    fb.Document.ContextMenuShowing += new HtmlElementEventHandler(Document_ContextMenuShowing);
                }

                return;
            }
            //屏蔽鼠标右键
            doc.ContextMenuShowing += new HtmlElementEventHandler(Document_ContextMenuShowing);
            StrDictionary sd = new StrDictionary();

            try
            {

                Utility.ParseQuery(Utility.GetQueryStr(e.Url.OriginalString), sd);

                //加载javascript脚本
                //bool noError = true;
                //noError = ScriptUtility.LoadJsFile(doc, "baselib,basefunc");
                mshtml.IHTMLDocument2 d = doc.DomDocument as mshtml.IHTMLDocument2;

                //容器不允许出现脚本,主要考虑代码安全(尚待改进,脚本还可以在元素的事件中执行)
                //if (!noError || d.scripts.length != 0)
                //{
                   // MessageBox.Show("脚本异常");
                    //这里可以跳到错误页面
                    //this.Navigate("about:blank");
                    //this.DocumentText = "";
                //}

                //if (sd.ContainsKey("script"))
                //    ScriptUtility.LoadJsFile(doc, sd["script"]);

                //加载css文件,必须在脚本加载完毕后加载
                //if (sd.ContainsKey("css"))
                //{
                //    string[] csses = sd["css"].Split(new char[] { ',' });
                //    foreach (string css in csses)
                //    {
                //        string path = GlobalVar.AppPath + css + ".css";
                //        if (System.IO.File.Exists(path))
                //            doc.InvokeScript("LoadCssFile", new object[] { path });
                //    }
                //}
                //回调脚本函数
                if (sd.ContainsKey("invoke") && sd["invoke"] != "")
                {
                    CallInFrame(sd);
                }
                //当前页面缓存用
                CacheManager.ClearPageCache(PageId);
                PageId = DateTime.Now.Ticks.ToString();
                GlobalVar.Container = null;

            #if DEBUG
                DebugPageGenerator dpg = new DebugPageGenerator(this);
                dpg.Generate(sd);

            #else
                ScriptUtility.ExecScript(this.Document,"window.alert = function(){}");
            #endif
                GC.Collect();
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
コード例 #48
0
ファイル: Action.cs プロジェクト: kener1985/MyGitHubProj
        public void DoAction(StrDictionary sd)
        {
            OpenFileDialog ofd = new OpenFileDialog();
            ofd.Multiselect = false;
            ofd.Filter = "图像文件 (*.jpg)|*.jpg";

            if (ofd.ShowDialog() == DialogResult.OK)
            {
                string filename = DateTime.Now.ToString("yyyyMMddhhmmssfff") + ".jpg";
                string prefix = GlobalVar.AppPath + "views\\images\\";
                if (String.IsNullOrEmpty(sd["src"]) == false)//删除原有样版
                {
                    File.Delete(prefix + sd["src"]);
                }

                string dest = prefix + filename;
                File.Copy(ofd.FileName, dest);
                GlobalVar.Container.InvokeScript("setSelectedPicture", new object[] { filename });
            }
        }
コード例 #49
0
ファイル: FormBrowser.cs プロジェクト: kener1985/MyGitHubProj
        private void wb_Navigating(object sender, WebBrowserNavigatingEventArgs e)
        {
            //if (String.IsNullOrEmpty(_RequestId) == false && _RequestId != e.Url.OriginalString)
            //    return;

            if (_bInited == false)
            {
                SHDocVw.WebBrowser shwb = (SHDocVw.WebBrowser)this.ActiveXInstance;
                shwb.BeforeNavigate2 += new SHDocVw.DWebBrowserEvents2_BeforeNavigate2EventHandler(wb_BeforeNavigate2);
                _bInited = true;
            }
            //MessageBox.Show(e.Url.ToString());
            GlobalVar.Container = GetCurrentContainer(e.TargetFrameName);
            if (e.Url.Scheme.ToLower().Equals("receipt") == true)
            {
                e.Cancel = true;
                StrDictionary sd = new StrDictionary();
                try
                {
                    Utility.ParseQuery(Utility.GetQueryStr(e.Url.OriginalString), sd);
                    //sd.Add("pageid", _PageId);
                    GlobalVar.Log.LogDebug("InvokeAction", e.Url.OriginalString);
                    string action = e.Url.Host;

                    string cmd = e.Url.LocalPath;
                    if(String.IsNullOrEmpty(cmd))
                    {
                        GlobalVar.Log.LogError("invalid action!");
                        return;
                    }
                    Utility.InvokeAction(action,cmd.Trim(new char[]{'/','\\'}), sd);
                }
                catch (System.Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }else
            {
                //_RequestId = e.Url.OriginalString;
            }
        }
コード例 #50
0
ファイル: Action.cs プロジェクト: kener1985/MyGitHubProj
        public void DoAction(StrDictionary sd)
        {
            int num = Convert.ToInt32(sd["num"]);
            string fields = "mark,num,seqnbr,type,productid,finalstore,opr,customer";
            GlobalVar.DBHelper.AddInsert("storenumhistory", fields);
            GlobalVar.DBHelper.AddUpdate("products", "id,storenum", "id");
            DefaultAction.StoreChangeFrm frm = new DefaultAction.StoreChangeFrm(num);
            if (frm.ShowDialog() == DialogResult.OK)
            {
                DataTable his = new DataTable();
                DataTable upt = new DataTable();
                his.Init("storenumhistory", fields);
                upt.Init("products", "id,storenum,actcnt");

                //Products表更新
                DataRow r = upt.NewRow();
                decimal final = frm.Value;
                if (frm.OprType == 'I')//进货
                    final = num + frm.Value;
                else if (frm.OprType == 'O')//出货
                    final = num - frm.Value;

                r.SetField<string>("id", sd["data"]);
                r.SetField<decimal>("storenum", final);
                upt.Rows.Add(r);
                r.AcceptChanges();
                r.SetModified();
                DataSet ds = new DataSet();
                int want = 2;//理想影响条数
                r = his.NewRow();
                //storenumhistory 表增加记录

                r.SetField<string>("mark", frm.Mark);
                r.SetField<decimal>("finalstore", final);

                if (frm.OprType == 'M')
                    r.SetField<decimal>("num", num);
                else
                    r.SetField<decimal>("num", frm.Value);

                r.SetField<long>("seqnbr", DateTime.Now.Ticks);
                r.SetField<char>("type", frm.OprType);
                r.SetField<string>("productid", sd["data"]);
                r.SetField<string>("opr", GlobalVar.LogInfo.WorkCode);
                r.SetField<string>("customer", frm.Customer);

                his.Rows.Add(r);

                ds.Tables.Add(his);
                ds.Tables.Add(upt);

                int rst = GlobalVar.DBHelper.Update(ds, "storenumhistory,products");
                try
                {
                    GlobalVar.DBHelper.ExcuteNonQuery("update products set actcnt=actcnt+1 where id=" + sd["data"]);
                }
                catch (Exception) { }
                GlobalVar.Container.InvokeScript("updateStoreNum", new object[] { final, rst == want });
            }
        }
コード例 #51
0
ファイル: Utility.cs プロジェクト: kener1985/MyGitHubProj
        public static void ParseQuery(string query, StrDictionary sd)
        {
            string[] pairs = query.Split(new char[] { '&' });
            foreach (string p in pairs)
            {
                string[] kv = p.Split(new char[] { '=' });
                if (kv.Length < 2)
                    continue;

                sd.Add(kv[0], System.Web.HttpUtility.UrlDecode(kv[1]));
            }
        }
コード例 #52
0
ファイル: Action.cs プロジェクト: kener1985/MyGitHubProj
 public void DoAction(StrDictionary sd)
 {
     DefaultAction.PopupFrm frm = new DefaultAction.PopupFrm(sd);
     frm.ShowDialog();
 }
コード例 #53
0
ファイル: Action.cs プロジェクト: kener1985/MyGitHubProj
        public void DoAction(StrDictionary sd)
        {
            string date = DateTime.Now.ToString("yyyy-MM-dd");
            string phis = String.Empty;
            int pagecode = 1;

            //查询该订单操作人工号
            GlobalVar.DBHelper.AddSelect("members","name,code");
            GlobalVar.DBHelper.AddSelect("bills","operator,pagecode","id");
            DataSet ds = new DataSet();
            ds.Tables.Add(new DataTable("members"));
            ds.Tables.Add(new DataTable("bills"));
            GlobalVar.DBHelper.AddCustomParam("@id",sd["id"]);
            GlobalVar.DBHelper.Fill(ds);

            EasyUITable etblMembers = new EasyUITable();
            etblMembers.Table = ds.Tables["members"];
            string code = null;
            if(ds.Tables["bills"].Rows.Count == 1)
            {
                DataRow row = ds.Tables["bills"].Rows[0];
                code = row.Field<string>("operator");
                pagecode = row.Field<int>("pagecode");
            }

            //查询所有员工工号
            if (sd.ContainsKey("id") == false || sd["id"].Equals(String.Empty) || sd["id"].Equals("0"))
            {
                pagecode = 1;
            }else
            {
                //初始化页码
                //主单id
                string mainId = sd["id"];
                object result = GlobalVar.DBHelper.ExcuteForUnique("select pid from bills where id=" + sd["id"]);
                long pid = 0;
                if (result != null)
                    pid = Convert.ToInt64(result);

                if (pid != -1 && pid != 0)
                    mainId = pid.ToString();

                if (!sd.ContainsKey("type") || sd["type"].Equals("append"))
                {
                    DbDataReader r = GlobalVar.DBHelper.ExcuteSQL("select max(pagecode) from bills where pid=" + mainId);
                    r.Read();
                    if (r.IsDBNull(0))
                        pagecode = 2;
                    else
                        pagecode = r.GetInt32(0) + 1;
                    r.Close();
                }
                //初始化历史价格
                string lmt = "id=" + mainId + " OR pid=" + mainId;
                DataTable tblBill = new DataTable("bills");
                GlobalVar.DBHelper.AddSelectWithLimit("bills", "seqnbr,operator", lmt);
                GlobalVar.DBHelper.Fill(ref tblBill);
                string seqset = GetSeqnbrSet(tblBill);
                StringBuilder sz = new StringBuilder();
                sz.Append("SELECT p.productid,p.innerid,p.colornum,b.saleprice,b.seqnbr")
                    .Append(" FROM billitem as b,products as p where p.id=b.productid AND b.seqnbr IN ")
                    .Append(seqset);
                EasyUITable etb = new EasyUITable();
                etb.Table = GlobalVar.DBHelper.MultiTableSelect(sz.ToString(), false);
                GlobalVar.AddDateFildFromSeqnbr(etb.Table, false);
                phis = etb.ToJson();
            }

            GlobalVar.Container.InvokeScript(sd["invoke"], new object[] {etblMembers.ToJson(),code, date, pagecode, phis });
        }
コード例 #54
0
ファイル: Action.cs プロジェクト: kener1985/MyGitHubProj
 public void DoAction(StrDictionary sd)
 {
     PaybackFrm frm = new PaybackFrm(sd["mainseqnbr"]);
     frm.ShowDialog();
 }
コード例 #55
0
ファイル: Action.cs プロジェクト: kener1985/MyGitHubProj
        public void DoAction(StrDictionary sd)
        {
            string p = GlobalVar.AppPath + "temp/tmp.tmp";

            if (sd["type"] == "save")
            {
                File.WriteAllText(p, sd["data"], Encoding.UTF8);
                MessageBox.Show("保存好了");
            }
            else if (File.Exists(p))
            {
                string s = File.ReadAllText(p, Encoding.UTF8);
                GlobalVar.Container.InvokeScript("restoreList", new object[] { s });

            }
        }
コード例 #56
0
ファイル: MainForm.cs プロジェクト: kener1985/MyGitHubProj
        private void ParseAttr(XmlReader r,out StrDictionary sd)
        {
            sd = new StrDictionary();
            StringBuilder sz = new  StringBuilder();
            while(r.MoveToNextAttribute())
            {
                //r.GetAttribute()
                //r.AttributeCount

                    sd.Add(r.Name, r.Value);
            }

            r.MoveToElement();
        }
コード例 #57
0
ファイル: Action.cs プロジェクト: kener1985/MyGitHubProj
        private string MakeQueryBillStr(StrDictionary sd)
        {
            string b = sd["begdat"];
            string e = sd["enddat"];
            string punit = sd["purunit"];
            string opr = sd["operator"];
            bool mo = sd["mainonly"] == "true";
            StringBuilder sz = new StringBuilder();
            if (String.IsNullOrEmpty(b) == false && String.IsNullOrEmpty(e) == false)
            {
                long bt = Utility.MakeDate(b, true).Ticks;
                long et = Utility.MakeDate(e, false).Ticks;
                sz.Append("seqnbr>@begdat AND seqnbr<@enddat");
                GlobalVar.DBHelper.AddCustomParam("@begdat", bt.ToString());
                GlobalVar.DBHelper.AddCustomParam("@enddat", et.ToString());
            }
            if (String.IsNullOrEmpty(punit) == false)
            {
                if (sz.Length > 0)
                    sz.Append(" AND ");

                sz.Append("purunit LIKE @punit");
                GlobalVar.DBHelper.AddCustomParam("@punit", "%" + punit + "%");
            }

            if (String.IsNullOrEmpty(opr) == false)
            {
                if (sz.Length > 0)
                    sz.Append(" AND ");

                sz.Append("operator = @operator");
                GlobalVar.DBHelper.AddCustomParam("@operator", opr);
            }

            if (mo)//只查询主单
            {
                if (sz.Length > 0)
                    sz.Append(" AND ");
                sz.Append("pid=0");
            }

            if (sz.Length == 0)
                sz.Append("1=1");
            sz.Append(" ORDER BY seqnbr DESC");
            return sz.ToString();
        }
コード例 #58
0
ファイル: Action.cs プロジェクト: kener1985/MyGitHubProj
 public void DoAction(StrDictionary sd)
 {
     EasyUITable etb = new EasyUITable();
     string mainSeqnbr = sd["seqnbr"];
     string ivk = String.Empty;
     if (mainSeqnbr[0] == '#')//查账务统计表
     {
         mainSeqnbr = mainSeqnbr.Substring(1);
         GlobalVar.DBHelper.AddSelectWithLimit("debtdetail", "amount,seqnbr,mark,opr,type", "main_seqnbr=@seq");
         GlobalVar.DBHelper.AddCustomParam("@seq", mainSeqnbr);
         DataTable tbl = new DataTable("debtdetail");
         GlobalVar.DBHelper.Fill(ref tbl);
         GlobalVar.AddDateFildFromSeqnbr(tbl, true);
         etb.Table = tbl;
         ivk = "showDebtSummary";
     }
     else
     {
         GlobalVar.DBHelper.AddCustomParam("@seqnbr", sd["seqnbr"]);
         StringBuilder sz = new StringBuilder();
         sz.Append("SELECT p.name,p.productid,p.innerid,p.position,p.colornum,p.packagenum,p.size,b.c_num,b.num,b.saleprice,b.type,b.mark,b.saleoff")
         .Append(" FROM billitem as b,products as p where p.id=b.productid AND b.seqnbr=@seqnbr");
         etb.Table = GlobalVar.DBHelper.MultiTableSelect(sz.ToString(), false);//第二个参数无作用
         ivk = "showDetail";
     }
     GlobalVar.transferCodeToName(etb.Table, "opr");
     GlobalVar.Container.InvokeScript(ivk, new object[] { etb.ToJson() });
 }
コード例 #59
0
ファイル: Action.cs プロジェクト: kener1985/MyGitHubProj
 public void DoAction(StrDictionary sd)
 {
     string action = "default";
     if (sd.ContainsKey("action") && !String.IsNullOrEmpty(sd["action"]))
         action = sd["action"];
     Utility.InvokeAction(action, sd["cmd"], sd);
 }
コード例 #60
0
ファイル: Action.cs プロジェクト: kener1985/MyGitHubProj
        public void DoAction(StrDictionary sd)
        {
            EasyUITable etb = new EasyUITable();
            DataTable tbl = new DataTable("products");

            GlobalVar.DBHelper.AddSelectWithLimit("products", sd["fields"], "productid=@productid AND status!='1'");

            GlobalVar.DBHelper.AddCustomParam("@productid", sd["data"]);

            GlobalVar.DBHelper.Fill(ref tbl);
            etb.Table = tbl;
            GlobalVar.Container.InvokeScript(sd["invoke"], new object[] { etb.ToJson() });
        }