private void bindList() { SearchCompanyInformationDetails con = new SearchCompanyInformationDetails(); if (ddlCompanyInforType.SelectedValue != "") { con.CpInforType = Convert.ToInt32(ddlCompanyInforType.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 (BLLCompanyInformationDetails bll = new BLLCompanyInformationDetails()) { List <CompanyInformationDetails> lists = bll.GetPageList(con, pagina, CompanyInformationType.ID_FieldName, ScriptQuery.SortEnum.DESC); pager.RecordCount = pagina.RecordCount; pager.PageCount = pagina.PageCount; grid_friendlink.DataSource = lists; grid_friendlink.DataBind(); } }
public static string OperateRecords(string ids, int op) { string[] array = ids.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); using (BLLCompanyInformationType bll = new BLLCompanyInformationType()) { foreach (string id in array) { switch (op) { case 7: using (BLLCompanyInformationDetails blls1 = new BLLCompanyInformationDetails()) { SearchCompanyInformationDetails con3 = new SearchCompanyInformationDetails(); con3.CpInforType = Convert.ToInt32(id); if (blls1.GetList(con3).Count > 0) { return("此公司信息类别下有相应的信息,不能删除!"); } } bll.Delete(id); break; } } if (bll.IsFail) { return(ExceptionManager.GetErrorMsg(bll.DevNetException)); } } return(string.Empty); }