/// <summary> /// 是否常用(不常用) /// </summary> public bool isCy2(string id) { AusTypeInfo typeInfo = AusTypeInfoManager.getAusTypesById(Convert.ToInt32(id)); if (typeInfo.iscy == "y") { return(true); } else { return(false); } }
private void loadAusType() { int id = Convert.ToInt32(Request.QueryString["id"]); AusTypeInfo typeInfo = AusTypeInfoManager.getAusTypesById(id); txtTypeName.Text = typeInfo.typename; if (typeInfo.iscy == "y") { this.iscy.Checked = true; } else { this.iscy.Checked = false; } }
protected void cuslist_ItemCommand(object source, RepeaterCommandEventArgs e) { string id = e.CommandArgument.ToString(); switch (e.CommandName) { case "Delete": AusTypeInfo typeInfo = AusTypeInfoManager.getAusTypesById(Convert.ToInt32(id)); string typeName = typeInfo.typename; int count = AusDetialInfoManager.getAusDetialInfoByAusType(typeName); if (count > 0) { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('费用类别正在使用中,无法删除!');", true); } else { bool del = AusTypeInfoManager.Delete(Convert.ToInt32(id)); if (del == true) { Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "add", "<script>alert('删除成功');window.location='AusTypeList.aspx'</script>", false); } else { Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "add", "<script>alert('删除失败')</script>", true); } } break; case "Update": Response.Redirect("UpdateAusType.aspx?id=" + id); break; case "Tick": AusTypeInfo typeInfo1 = AusTypeInfoManager.getAusTypesById(Convert.ToInt32(id)); typeInfo1.iscy = "y"; AusTypeInfoManager.Update(typeInfo1); break; case "TurnBack": AusTypeInfo typeInfo2 = AusTypeInfoManager.getAusTypesById(Convert.ToInt32(id)); typeInfo2.iscy = "n"; AusTypeInfoManager.Update(typeInfo2); break; } dataBind(); }