Exemple #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["spcId"] != null)
            {
                spcId = Request.QueryString["spcId"].ToString();
            }
            if (!currentAdmin.validationSpcAdmin(spcId))
            {
                adminOpers.ShowNoPower();
                return;
            }
            if (Request.QueryString["action"] != null && Request.QueryString["action"].ToString() == "delete" && Request.QueryString["typeid"] != null)
            {
                string typeids = string.Empty;
                typeids = bllarticletype.DeleteNode(Convert.ToInt32(Request.QueryString["typeid"]));
                DataTable dt = bllarticletype.GetList("id in(" + typeids + ")").Tables[0];
                bllarticle.DeleteArticlesByTypeids(typeids);


                string spcDir = sys.getSpcDir(Convert.ToInt32(spcId));
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    sys.deleteArticleFile(Convert.ToInt32(dt.Rows[i]["id"].ToString()), spcDir, Convert.ToDateTime(dt.Rows[i]["dbo_ptime"]));
                }
                Response.Redirect("typeList.aspx?spcId=" + spcId);
            }
            else
            {
                showTypeList();
            }
        }
Exemple #2
0
        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool RealDelete(int ID)
        {
            DataTable dt = bllarticletype.GetList("dbo_fatherid=0 and dbo_specialityId=" + ID).Tables[0];

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                string typeids = bllarticletype.DeleteNode(Convert.ToInt32(dt.Rows[i]["id"]));
                bllarticle.DeleteArticlesByTypeids(typeids);
            }
            return(dal.Delete(ID));
        }