public static string OperateRecords(string ids, int op) { string[] array = ids.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); using (BLLComBannerType bll = new BLLComBannerType()) { foreach (string id in array) { switch (op) { case 7: using (BLLComBanner blls1 = new BLLComBanner()) { SearchComBanner con3 = new SearchComBanner(); con3.ComBannerTypeID = Convert.ToInt32(id); if (blls1.GetList(con3).Count > 0) { return("此Banner类型下有相应的Banner,不能删除!"); } } bll.Delete(id); break; } } if (bll.IsFail) { return(ExceptionManager.GetErrorMsg(bll.DevNetException)); } } return(string.Empty); }
private void bindList() { SearchComBannerType con = new SearchComBannerType(); con.ComBannerTypeName = txtNewsTypeName.Text.Trim().ToString(); 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 (BLLComBannerType bll = new BLLComBannerType()) { List <ComBannerType> lists = bll.GetPageList(con, pagina, ComBannerType.ID_FieldName, ScriptQuery.SortEnum.DESC); pager.RecordCount = pagina.RecordCount; pager.PageCount = pagina.PageCount; grid_friendlink.DataSource = lists; grid_friendlink.DataBind(); } }
private void getProtypeList() { SearchComBannerType search = new SearchComBannerType(); using (BLLComBannerType bll = new BLLComBannerType()) { DataTable dt = bll.GetTable(search);//ScriptQuery.SortEnum.DESC if (dt != null) { ddlNewsType.DataSource = dt; ddlNewsType.DataTextField = ComBannerType.ComBannerTypeName_FieldName; ddlNewsType.DataValueField = ComBannerType.ID_FieldName; ddlNewsType.DataBind(); } } }
/// <summary> /// 获取Banner类别名称 /// </summary> protected string GetBannerTypeName(int proinfotype) { using (BLLComBannerType bll = new BLLComBannerType()) { ComBannerType obj = new ComBannerType(); if (proinfotype > 0) { obj = bll.GetSingle(proinfotype); if (obj != null) { return(obj.ComBannerTypeName.ToString()); } } return(""); } }
protected void btnSubmit_Click(object sender, EventArgs e) { using (BLLComBannerType bll = new BLLComBannerType()) { ComBannerType obj = new ComBannerType(); if (id > 0) { obj = bll.GetSingle(id); obj.ID = id; } obj.ComBannerTypeName = txtNewsTypeName.Text.Trim().ToString(); obj.Remarks = txtRemarks.Text.ToString(); if (rbtnIsChinese.Checked == true) { obj.IsEnglish = 1; } else if (rbtnIsEnglish.Checked == true) { obj.IsEnglish = 2; } else { ShowMsg("请选择语言类别!"); return; } bll.Save(obj); if (bll.IsFail) { ExceptionManager.ShowErrorMsg(this, bll.DevNetException); } else { JSMsg.ShowWinRedirect(this, "保存成功", "cpComBannerTypeList.aspx"); } } }
private void setInfo() { if (id > 0) { using (BLLComBannerType bll = new BLLComBannerType()) { ComBannerType cpinfor = bll.GetSingle(id); if (cpinfor != null) { if (cpinfor.IsEnglish == 1) { rbtnIsChinese.Checked = true; } else if (cpinfor.IsEnglish == 2) { rbtnIsEnglish.Checked = true; } txtNewsTypeName.Text = cpinfor.ComBannerTypeName; txtRemarks.Text = cpinfor.Remarks; } } } }