Example #1
0
        /// <summary>
        /// 删除店铺按钮事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BT_DeletShop_Click(object sender, EventArgs e)
        {
            if (CB_City.SelectedIndex <= 0)
            {
                MessageBox.Show("为了精确定位到您选择的店铺,请指定好城市名称!");
                return;
            }
            DialogResult result = MessageBox.Show("该操作会删除该店铺以及该店铺下所有的成员关系,您确定要删除吗?", "警告!!", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2);

            if (result == DialogResult.OK)
            {
                int CityID = List_ShopInfo.Where(P => P.City_Name == CB_City.SelectedItem.ToString()).First().City_ID;
                UserManager_Client.UserDropShop_ShopID(List_ShopInfo.Where(P => P.Shop_Name == LB_Shop.SelectedItem.ToString()).First().Shop_ID);
                int ShopID = Shop_Client.SelectShop_Name(LB_Shop.SelectedItem.ToString(), CityID).Shop_ID;
                Shop_Client.DeleteShop(ShopID);
                List_ShopInfo = UserManager_Client.GetAllShops(null, null, null).ToList();
                LB_ShopBind();
            }
            else
            {
                return;
            }
        }