예제 #1
0
파일: frmMain.cs 프로젝트: weimingtom/pap2
        void tvShopList_AfterSelect(object sender, TreeViewEventArgs e)
        {
            int shoplistid = (int)e.Node.Tag;

            if (shoplistid == App.AppVariables.INVALID_TREENODE)
            {
                return;//如果是根节点,则退出
            }
            if (shoplistid < 0)
            {
                //清理控件值
                dgvShopItems.Rows.Clear();
                txtShopConfigFile.Text = "";
                txtShopName.Text       = e.Node.Text;
                lblShopID.Text         = "";
            }
            ShopList shop = ShopListLogic.GetOneShopList(shoplistid);

            if (null != shop)
            {
                this.txtShopConfigFile.Text = shop.ConfigFile;
                this.chkShopCanFix.Checked  = shop.CanRepair;
                this.txtShopName.Text       = shop.ShopName;
                lblShopID.Text = shop.ShopTemplateID.ToString();
                _initShopItems(shop.ShopTemplateID, true);
            }
        }
예제 #2
0
파일: frmMain.cs 프로젝트: weimingtom/pap2
        /// <summary>
        /// 保存商店列表的设置
        /// </summary>
        private void _saveShopListSettings()
        {
            if (null == m_shopitems || m_shopitems.Count <= 0)
            {
                return;
            }
            int shopid = -1;

            Int32.TryParse(lblShopID.Text, out shopid);
            if (shopid >= 0)
            {
                ShopList shoplist = ShopListLogic.GetOneShopList(shopid);
                if (null != shoplist)
                {
                    shoplist.ShopName   = this.tvShopList.SelectedNode.Text;
                    shoplist.CanRepair  = this.chkShopCanFix.Checked;
                    shoplist.ConfigFile = this.txtShopConfigFile.Text;
                    ShopListLogic.UpdateShopList(shoplist);
                }
            }
        }