using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Itlead.Architecture.Contract;
using Itlead.Architecture.Contract.DataContract;
using System.Text;
namespace Itlead.Architecture.WebUI.tools
{
///
/// Ajax_checkbox 的摘要说明
///
public class Ajax_checkbox : IHttpHandler
{
const string categoryService = "categoryService";
public void ProcessRequest(HttpContext context)
{
context.Response.Expires = 0;
context.Response.CacheControl = "no-cache";
context.Response.AddHeader("Pragma", "No-Cache");
context.Response.ContentType = "text/plain";
StringBuilder str = new StringBuilder();
string topicId = context.Request.QueryString["topicId"];
string categoryId = context.Request.QueryString["categoryId"];
var category = MyBasicLib.Utilities.ServiceInvoker.Invoke(categoryService, c => c.getCategoryall(new Guid(topicId)));
if (category.Count() > 0)
{
foreach (var item in category)
{
if (categoryId == "" || categoryId == null)
{
str.Append("" + item.CategoryName);
}
else
{
if (item.CategoryId == new Guid(categoryId))
{
str.Append("" + item.CategoryName);
}
else
{
str.Append("" + item.CategoryName);
}
}
}
context.Response.Write(str);
}
else
{
context.Response.Write("no");
}
// context.Response.Write("Hello World");
}
public bool IsReusable
{
get
{
return false;
}
}
}
}