Handler/GoodsHandler.ashx.cs

(开头部分) 11KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using GoodsProject.DAL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Bowin.Common.Linq;
using Bowin.Common.Linq.Sql;
using GoodsProject.Model;

namespace GoodsProject.Handler
{
    /// <summary>
    /// GoodsHandler 的摘要说明
    /// </summary>
    public class GoodsHandler : IHttpHandler
    {
        GoodsDAL dal = new GoodsDAL();
        LogDAL Errordal = new LogDAL();
        CommodityDBDataContext db = new CommodityDBDataContext();
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            var action = context.Request["action"];
            switch (action)
            {
                case "list":
                    int count = 0;
                    var page = int.Parse(context.Request["page"]);
                    var rows = int.Parse(context.Request["rows"]);
                    var BrandID = context.Request["BrandID"];
                    var Name = context.Request["GoodsName"];
                    var data = dal.GetGoodsList(BrandID, Name,page, rows, out count);
                    string result = data.ToJson();
                    string returnJson = "{\"total\":" + count.ToString() + ",\"rows\":" + result + "}";
                    context.Response.Write(returnJson);
                    break;
                case "Export"://导出
                    context.Response.Write(GetExport(context));
                    break;
                case "sele":
                    context.Response.Write(GetGoodsInfo(context));
                    break;
                case "add":
                    context.Response.Write(AddInfo(context));
                    break;
                case "del":
                    context.Response.Write(Removelist(context));
                    break;
                default:
                    break;
            }
        }

        #region 查找商品
        public string GetGoodsInfo(HttpContext context)
        {
            //System.Threading.Thread.Sleep(1000);
            string ID = context.Request["ID"];
            var sql = from n in db.TB_Goods.Where(w => w.ID == ID).OrderBy(o => o.CreateDate)
                      select new GoodsInfo
后面还有 248 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。