Exemple #1
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btndelete_Click(object sender, EventArgs e)
        {
            bool Result = false;

            if (txt_types.Value == "0")
            {
                Result = fmgeust.Delete(Convert.ToInt32(txt_id.Value));
            }
            if (txt_types.Value == "1")
            {
                Result = fmunit.Delete(Convert.ToInt32(txt_id.Value));
            }
            if (txt_types.Value == "2")
            {
                Result = fmfea.Delete(Convert.ToInt32(txt_id.Value));
            }
            if (txt_types.Value == "3")
            {
                Result = fmmety.Delete(Convert.ToInt32(txt_id.Value));
            }
            if (txt_types.Value == "4")
            {
                Result = fmcdtype.Delete(Convert.ToInt32(txt_id.Value));
            }
            if (txt_types.Value == "5")
            {
                Result = fmroom.Delete(Convert.ToInt32(txt_id.Value));
            }
            if (txt_types.Value == "6")
            {
            }

            if (txt_types.Value == "7")
            {
                BLL.customerState bllcs = new BLL.customerState();
                Result = bllcs.Delete(Convert.ToInt32(txt_id.Value));
            }
            if (txt_types.Value == "8")
            {
                BLL.customerType bllcs = new BLL.customerType();
                Result = bllcs.Delete(Convert.ToInt32(txt_id.Value));
            }
            if (txt_type.Value == "9")
            {
                BLL.cIndustry bllcs = new BLL.cIndustry();
                Result = bllcs.Delete(Convert.ToInt32(txt_id.Value));
            }
            if (txt_type.Value == "10")
            {
                BLL.cpType bllcs = new BLL.cpType();
                Result = bllcs.Delete(Convert.ToInt32(txt_id.Value));
            }
            if (txt_type.Value == "11")
            {
                BLL.csysType bllcs = new BLL.csysType();
                Result = bllcs.Delete(Convert.ToInt32(txt_id.Value));
            }
            if (txt_type.Value == "12")
            {
                BLL.cDepartment bllcs = new BLL.cDepartment();
                Result = bllcs.Delete(Convert.ToInt32(txt_id.Value));
            }
            if (txt_type.Value == "13")
            {
                BLL.cPost bllcs = new BLL.cPost();
                Result = bllcs.Delete(Convert.ToInt32(txt_id.Value));
            }
            if (txt_type.Value == "14")
            {
                BLL.cCall bllcs = new BLL.cCall();
                Result = bllcs.Delete(Convert.ToInt32(txt_id.Value));
            }
            if (Result)
            {
                txt_name.Value = "";
                ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "click", "alert('删除成功');", true);
            }
            else
            {
                ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "click", "alert('删除失败');", true);
            }
            btnSercher_Click(null, null);
        }