public static string OperateRecords(string ids, int op) { string[] array = ids.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); using (BLLJobType bll = new BLLJobType()) { foreach (string id in array) { switch (op) { case 7: SearchJobDetail cond = new SearchJobDetail(); cond.CpJobTypeID = Convert.ToInt32(id); using (BLLJobDetail jobbll = new BLLJobDetail()) { if (jobbll.GetList(cond).Count > 0) { return("有子类目不能删除;"); } else { bll.Delete(id); break; } } } } if (bll.IsFail) { return(ExceptionManager.GetErrorMsg(bll.DevNetException)); } } return(string.Empty); }
private void bindList() { SearchJobDetail con = new SearchJobDetail(); if (ddlJobType.SelectedValue != "") { con.CpJobTypeID = Convert.ToInt32(ddlJobType.SelectedValue); } if (rbtnIsChinese.Checked == true) { con.IsEnglish = 1; } else if (rbtnIsEnglish.Checked == true) { con.IsEnglish = 2; } Pagination pagina = new Pagination(pager.PageIndex, pager.PageSize, 0); using (BLLJobDetail bll = new BLLJobDetail()) { List <JobDetail> lists = bll.GetPageList(con, pagina, JobDetail.ID_FieldName, ScriptQuery.SortEnum.DESC); pager.RecordCount = pagina.RecordCount; pager.PageCount = pagina.PageCount; grid_friendlink.DataSource = lists; grid_friendlink.DataBind(); } }