Esempio n. 1
0
        /// <summary>
        /// 批量插入数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnGo_Click(object sender, EventArgs e)
        {
            var result = MessageBox.Show("确认批量插入数据?", "逆天友情提醒", MessageBoxButtons.YesNo);

            if (result == DialogResult.Yes)
            {
                var typeStr   = shopMenuType.SelectedItem as string;
                var shopModel = shopType.SelectedItem as ShopModel;
                if (!string.IsNullOrEmpty(typeStr) && shopModel != null)
                {
                    ShopMenuModel model = new ShopMenuModel()
                    {
                        MType = typeStr, MShopId = shopModel.SId, MCityId = tempModel.CityId
                    };
                    bool b = ShopMenuHelper.GetInsertCount(tempModel.ConnStr, path, model);
                    if (b)
                    {
                        ShowLog("批量插入成功!");
                    }
                    else
                    {
                        ShowLog("批量插入失败!");
                    }
                }
                else
                {
                    ShowLog("请选择分类!");
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 初始化
        /// </summary>
        /// <param name="model"></param>
        private void Init(TempModel model)
        {
            var msg = ShopMenuHelper.Init(model);

            if (msg != "初始化成功")
            {
                MessageBox.Show(msg);
            }
        }
Esempio n. 3
0
        /// <summary>
        /// 查询CityInfo
        /// </summary>
        /// <param name="comboBox"></param>
        /// <param name="pid"></param>
        private void BindCityInfoById(ComboBox comboBox, int pid)
        {
            var list = ShopMenuHelper.GetCityInfoList <CityModel>(tempModel.ConnStr, pid);

            if (list == null)
            {
                return;
            }
            comboBox.Items.Clear();
            foreach (var item in list)
            {
                comboBox.Items.Add(item);
            }
        }
Esempio n. 4
0
        /// <summary>
        /// 查询Shop
        /// </summary>
        /// <param name="comboBox"></param>
        /// <param name="list"></param>
        private void BindShopInfos()
        {
            var list = ShopMenuHelper.GetShopInfos(tempModel.ConnStr);

            if (list == null)
            {
                return;
            }
            shopType.Items.Clear();
            foreach (var item in list)
            {
                shopType.Items.Add(item);
            }
        }