Exemplo n.º 1
0
        protected void del_mingxi(object sender, EventArgs e)
        {
            MingxiModel mingxi = new MingxiModel();
            Boolean     result = true;

            try
            {
                List <yh_jinxiaocun_mingxi> list = Session["ming_xi_select_dd"] as List <yh_jinxiaocun_mingxi>;
                for (int i = 0; i < list.Count; i++)
                {
                    string name = Request["Checkbox_bd" + i];
                    if (name != null)
                    {
                        if (Convert.ToInt32(name) == i)
                        {
                            result = mingxi.del_mingxi(list[i]._id) > 0;
                        }
                    }
                }
                if (result)
                {
                    shuaxin();
                    Response.Write("<script>alert('删除成功');</script>");
                }
            }
            catch
            {
                Response.Write(" <script>alert('网络错误,请稍后再试!');</script>");
            }
        }