根据条件删除

        /// <summary>
        /// 删除检测项目
        /// </summary>
        private void DelPBItem()
        {
            string msg = "0";
            string id = Request.Form["ipt_biotestplanheaderid"];
            string pbItemCode = Request.Form["ipt_pbitemcode"];
            if (!string.IsNullOrEmpty(id))
            {
                string strWhere = "BioTestPlanHeaderID=" + id + "AND PBItemCode=" + pbItemCode;                 
                DataSet ds = bioTestPlanBodyBll.GetList(strWhere);
                int count = ds.Tables[0].Rows.Count;
                for (int i = 0; i < count; i++)
                {
                    int reviewid = Convert.ToInt32(ds.Tables[0].Rows[i]["BioTestPlanBodyID"].ToString());
                    bioTestPlanBodyBll.Delete(reviewid);
                }
                //if (bioTestPlanBodyBll.DeleteList(id))
                // {
                msg = "操作成功";
                //}
            }
            WebCommon.WriteMsg(msg);
        }

posted @ 2015-11-11 14:54  怎能不累  阅读(215)  评论(0编辑  收藏  举报