Exemple #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                pageinfo pdata = new pageinfo();
                int page;
                if (Request.QueryString["page"] != null)
                {
                    page = TypeParse.DbObjToInt(Request.QueryString["page"].ToString(), 1);
                }
                else
                {
                    page = 1;
                }

                pdata.curpageindex = page;
                pdata.pagesize = 10;
                pdata.where = "news.ntid=newstype.ntid";
                pdata.recordcount = news.getnewscount();
                pdata.tablename = "news ,newstype";
                pdata.fieldlist = "news.newsid,news.newstitle,news.newswriter,news.newsfrom,news.newsnote,news.adddate,news.ntid,newstype.newstype,news.ninfo,news.istop,news.newsimg,news.userid";
                pdata.sorttype = 2;
                pdata.primarykey = "newsid";
                pdata.totalpagecount = (pdata.recordcount % pdata.pagesize == 0 ? pdata.recordcount / pdata.pagesize : pdata.recordcount / pdata.pagesize + 1);
                if (pdata.totalpagecount == 0)
                {
                    pdata.totalpagecount = 1;
                }

                List<newsinfo> newslist = news.getnews(pdata);

                StringBuilder sb = new StringBuilder();
                foreach (newsinfo item in newslist)
                {
                    string template = "<tr><td height=\"20\" bgcolor=\"#FFFFFF\"><div align=\"center\" >{0}</div></td><td height=\"20\" bgcolor=\"#FFFFFF\" style=\"padding:0 0 0 5px;\"><div align=\"left\">{1}</div></td><td height=\"20\" bgcolor=\"#FFFFFF\"><div align=\"left\" style=\"padding:0 0 0 5px;\">{2}</div></td><td height=\"20\" bgcolor=\"#FFFFFF\"><div align=\"center\">{3}</div></td><td height=\"20\" bgcolor=\"#FFFFFF\"><div align=\"center\">{4}</div></td><td height=\"20\" bgcolor=\"#FFFFFF\"><div align=\"center\"><a href=\"/Manager/EditNews.aspx/?newsid={5}\" style=\"color:blue;cursor:pointer;\">编辑</a> | <a href=\"javascript:delnews('{6}','{7}')\" style=\"color:blue;cursor:pointer;\">删除</a></div></td></tr>";
                    sb.AppendFormat(template, item.adddate, comm.SubStr(item.newstitle, 17), item.newsfrom, item.newswriter, item.istop, item.newsid, item.newsid, pdata.curpageindex);
                }
                newslistHTML = sb.ToString();
                pageHTML = pagehelper.Pager(pdata.curpageindex, pdata.pagesize, pdata.recordcount, PageMode.Numeric, 5);
            }
        }
Exemple #2
0
        /// <summary>
        /// 得到订单列表
        /// </summary>
        /// <param name="pdata"></param>
        /// <returns></returns>
        public static List<orderinfo> getorderlist(pageinfo pdata)
        {
            List<orderinfo> list = new List<orderinfo>();
            try
            {
                DataTable dt = pagehelper.getpagedt(pdata);
                if (dt != null)
                {
                    foreach (DataRow dr in dt.Rows)
                    {
                        orderinfo item = new orderinfo();
                        item.orderid = TypeParse.DbObjToString(dr["orderid"].ToString(),"0");
                        item.tel = TypeParse.DbObjToString(dr["tel"].ToString(), "");
                        item.mobile = TypeParse.DbObjToString(dr["mobile"].ToString(), "");
                        item.address = TypeParse.DbObjToString(dr["address"].ToString(), "");
                        item.contact = TypeParse.DbObjToString(dr["contact"].ToString(), "");
                        item.allmoney =Decimal.Parse(TypeParse.DbObjToString(dr["allmoney"].ToString(), "0.00"));
                        item.paymoney =Decimal.Parse(TypeParse.DbObjToString(dr["paymoney"].ToString(), "0.00"));
                        item.orderstate = TypeParse.DbObjToInt(dr["orderstate"].ToString(), 0);
                        item.orderdate = TypeParse.DbObjToDateTime(dr["orderdate"].ToString(), DateTime.Now);
                        item.deliverydate = TypeParse.DbObjToDateTime(dr["deliverydate"].ToString(), DateTime.Now);
                        item.ordernumber = TypeParse.DbObjToString(dr["ordernumber"].ToString(), "");
                        item.deliveryI = TypeParse.DbObjToString(dr["deliveryI"].ToString(), "");
                        item.deliveryII = TypeParse.DbObjToString(dr["deliveryII"].ToString(), "");
                        switch (item.orderstate)
                        {
                            case 0:
                                item.orderstatestr = "进行中";
                                break;
                            case 10:
                                  item.orderstatestr = "已完成";
                                break;
                            case 44:
                                item.orderstatestr = "待处理";
                                break;
                            default:
                                item.orderstatestr = "进行中";
                                break;
                        }
                        list.Add(item);
                    }
                }

            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            finally
            {
            }
            return list;
        }
Exemple #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                string uid = "";
                if (Request.Cookies["tfuid"] != null)
                {
                    uid = TypeParse.DbObjToString(Request.Cookies["tfuid"].Value, "");
                }
                else
                {
                    Response.Redirect("/UserLog");
                }
                int page = 1;
                if (Request.QueryString["page"] != null)
                {
                    page = TypeParse.DbObjToInt(Request.QueryString["page"].ToString(), 1);
                }
                pageinfo pdata = new pageinfo();
                pdata.curpageindex = page;
                pdata.pagesize = 10;
                if (RouteData.Values["orderstate"] != null)
                {
                    pdata.where = "a.deliveryIid=c.deliveryIid and a.deliveryIIid=d.deliveryIIid  and a.orderstate=" + RouteData.Values["orderstate"].ToString() + " and a.userid='" + uid + "'";
                    pdata.recordcount = order.getcountbycondition("userorder.orderstate=" + RouteData.Values["orderstate"].ToString()+"  and userorder.userid='"+uid+"'");
                    if (RouteData.Values["orderstate"].ToString() == "0")
                    {
                        orderh3HTML = "我的进行中的订单";
                    }
                    else if (RouteData.Values["orderstate"].ToString() == "10")
                    {
                        orderh3HTML = "我的已完成的订单";
                    }
                    else if (RouteData.Values["orderstate"].ToString() == "44")
                    {
                        orderh3HTML = "我的待处理的订单";
                    }
                    else
                    {
                        orderh3HTML = "我的订单";
                    }

                }
                else
                {
                    pdata.where = "a.deliveryIid=c.deliveryIid and a.deliveryIIid=d.deliveryIIid and  a.userid='" + uid + "'";
                    pdata.recordcount = order.getcountbycondition("userorder.userid='" + uid + "'");
                    orderh3HTML = "我的订单";
                }
                pdata.tablename = "userorder a,deliveryI c,deliveryII d";
                pdata.fieldlist = "a.orderid,a.orderstate,a.ordernumber,a.orderdate,a.deliverydate,a.allmoney,a.paymoney,a.contact,a.tel,a.mobile,a.address,c.deliveryI,d.deliveryII";
                pdata.sorttype = 2;
                pdata.primarykey = "orderid";
                pdata.totalpagecount = (pdata.recordcount % pdata.pagesize == 0 ? pdata.recordcount / pdata.pagesize : pdata.recordcount / pdata.pagesize + 1);
                if (pdata.totalpagecount == 0)
                {
                    pdata.totalpagecount = 1;
                }

                List<orderinfo> list = order.getorderlist(pdata);
                StringBuilder sb = new StringBuilder();
                foreach (orderinfo item in list)
                {
                    string template = " <table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" class=\"otb\"><tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td colspan=\"6\" style=\"padding-left: 10px;\"><span class=\"fb\">订单编号:{0}</span>&nbsp;&nbsp;下单日期:{1}&nbsp;&nbsp;送货日期:{2}</td></tr><tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td colspan=\"6\" style=\"padding-left: 10px;\">收货人:{3}&nbsp;&nbsp;手机号码:{4}&nbsp;&nbsp;固定电话:{5}</td></tr><tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td colspan=\"3\" style=\"padding-left: 10px;\">地址:{6}</td><td colspan=\"2\" align=\"center\">产品总额:¥{7}元</td><td align=\"center\">应付总额:<span class=\"fb red\">¥{8}元</span></td></tr><tr style=\"height: 30px; line-height: 30px; background-color:#efefef\"><td style=\"padding-left: 10px;\">序号</td><td align=\"center\">产品图片</td><td align=\"center\">产品名称</td><td align=\"center\">购买数量</td><td align=\"center\">产品单价 </td><td align=\"center\">小计</td></tr> ";
                    sb.AppendFormat(template,item.ordernumber,item.orderdate,item.deliverydate,item.contact,item.tel,item.mobile,item.address,item.allmoney.ToString("f2"),item.paymoney.ToString("f2"));
                    List<orderinfo> plist = order.getcartlistbyordernumber(item.ordernumber);
                    for (int k = 0; k < plist.Count;k++ )
                    {
                        string ptemplate = "<tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td style=\"padding-left: 10px;\">{0}</td><td align=\"center\" class=\"oimg\"><a href=\"/PInfo/{1}\" target=\"_blank\"><img src=\"/Files/Product/{2}\" /></a></td><td align=\"center\">{3}</td><td align=\"center\">{4}</td><td align=\"center\">{5}</td><td align=\"center\">{6}</td></tr>";
                        sb.AppendFormat(ptemplate, k + 1, plist[k].productid, plist[k].productimg, plist[k].productname, plist[k].buynum, plist[k].vipprice.ToString("f2"), (plist[k].vipprice * plist[k].buynum).ToString("f2"));
                    }

                }
                sb.Append("</table>");
                orderlistHTML = sb.ToString();
                pageHTML = pagehelper.Pager(pdata.curpageindex, pdata.pagesize, pdata.recordcount, PageMode.Numeric, 5);
            }
        }
Exemple #4
0
 /// <summary>
 /// 得到资讯列表
 /// </summary>
 /// <param name="pdata"></param>
 /// <returns></returns>
 public static List<newsinfo> getnews(pageinfo pdata)
 {
     List<newsinfo> newslist = new List<newsinfo>();
     try
     {
         DataTable dt = pagehelper.getpagedt(pdata);
         if (dt != null)
         {
             foreach (DataRow dr in dt.Rows)
             {
                 newsinfo item = new newsinfo();
                 item.newsid = TypeParse.DbObjToInt(dr["newsid"].ToString(), 0);
                 item.newstitle = TypeParse.DbObjToString(dr["newstitle"].ToString(), "");
                 item.newswriter = TypeParse.DbObjToString(dr["newswriter"].ToString(), "");
                 item.ntid = TypeParse.DbObjToInt(dr["ntid"].ToString(), 1);
                 item.istop = TypeParse.DbObjToInt(dr["istop"].ToString(), 0);
                 item.newsfrom = TypeParse.DbObjToString(dr["newsfrom"].ToString(), "");
                 item.newsnote = TypeParse.DbObjToString(dr["newsnote"].ToString(), "");
                 item.ninfo = TypeParse.DbObjToString(dr["ninfo"].ToString(), "");
                 item.newstype = TypeParse.DbObjToString(dr["newstype"].ToString(), "");
                 item.adddate = TypeParse.DbObjToDateTime(dr["adddate"].ToString(), DateTime.Now);
                 item.newsimg = TypeParse.DbObjToString(dr["newsimg"].ToString(), "noimg.jpg");
                 item.userid = TypeParse.DbObjToString(dr["userid"].ToString(), "");
                 newslist.Add(item);
             }
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
     finally
     {
     }
     return newslist;
 }
Exemple #5
0
        /// <summary>
        /// 得到用户信息列表
        /// </summary>
        /// <param name="pdata"></param>
        /// <returns></returns>
        public static List<userinfo> getUserList(pageinfo pdata)
        {
            List<userinfo> userlist = new List<userinfo>();
            try
            {
                DataTable dt = pagehelper.getpagedt(pdata);
                if (dt != null)
                {
                    foreach (DataRow reader in dt.Rows)
                    {
                        userinfo data = new userinfo();
                        data.userid = TypeParse.DbObjToString(reader["userid"], "");
                        data.email = TypeParse.DbObjToString(reader["email"], "");
                        data.accounts = TypeParse.DbObjToString(reader["accounts"], "");

                        data.tel = TypeParse.DbObjToString(reader["tel"], "");
                        data.mobile = TypeParse.DbObjToString(reader["mobile"], "");

                        data.headerimg = TypeParse.DbObjToString(reader["headerimg"], "noimg.jpg");
                        data.atid = TypeParse.DbObjToInt(reader["atid"], 1);
                        data.accountstype = TypeParse.DbObjToString(reader["accountstype"], "");
                        data.truename = TypeParse.DbObjToString(reader["truename"], "");
                        data.qq = TypeParse.DbObjToString(reader["qq"], "");

                        data.company = TypeParse.DbObjToString(reader["company"], "");
                        data.address = TypeParse.DbObjToString(reader["address"], "");
                        data.adddate = TypeParse.DbObjToDateTime(reader["adddate"], DateTime.Now);
                        userlist.Add(data);
                    }
                }
                return userlist;
            }
            catch (Exception E)
            {
                throw new Exception(E.Message);
            }
            finally
            { }
        }
Exemple #6
0
        public static List<admininfo> getAdminListPage(pageinfo item)
        {
            List<admininfo> adminlist = new List<admininfo>();

            try
            {
                DataTable dt = pagehelper.getpagedt(item);
                if (dt != null)
                {
                    foreach (DataRow reader in dt.Rows)
                    {
                        admininfo data = new admininfo();
                        data.adminid = TypeParse.DbObjToInt(reader["adminid"], 0);
                        data.adminname = TypeParse.DbObjToString(reader["adminname"], "");
                        data.adddate = TypeParse.DbObjToDateTime(reader["adddate"], DateTime.Now);
                        data.updatedate = TypeParse.DbObjToDateTime(reader["updatedate"], DateTime.Now);
                        adminlist.Add(data);
                    }
                }

                return adminlist;
            }
            catch (Exception E)
            {
                throw new Exception(E.Message);
            }
            finally
            { }
        }
Exemple #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                List<webimagesinfo> itlist = webimages.getimagestype();
                itID.DataSource = itlist;
                itID.DataTextField = "imagestype";
                itID.DataValueField = "itid";
                itID.DataBind();

                pageinfo pdata = new pageinfo();
                int page;
                if (Request.QueryString["page"] != null)
                {
                    page = TypeParse.DbObjToInt(Request.QueryString["page"].ToString(), 1);
                }
                else
                {
                    page = 1;
                }

                pdata.curpageindex = page;
                pdata.pagesize = 10;
                pdata.where = "webimages.itid=imagestype.itid";
                pdata.recordcount = webimages.getwebimagecount();
                pdata.tablename = "webimages ,imagestype";
                pdata.fieldlist = "webimages.wiid,webimages.imgurl,webimages.imginfo,webimages.itid,webimages.imgname,webimages.imgcor,imagestype.imagestype";
                pdata.sorttype = 2;
                pdata.primarykey = "wiid";
                pdata.totalpagecount = (pdata.recordcount % pdata.pagesize == 0 ? pdata.recordcount / pdata.pagesize : pdata.recordcount / pdata.pagesize + 1);
                if (pdata.totalpagecount == 0)
                {
                    pdata.totalpagecount = 1;
                }

                List<webimagesinfo> imageslist = webimages.getwebimages(pdata);
                StringBuilder imgsb = new StringBuilder();
                foreach (webimagesinfo item in imageslist)
                {
                    string template = "<tr><td height=\"20\" bgcolor=\"#FFFFFF\"><div align=\"center\" style=\"padding:5px 0;\"><img src=\"/Files/WebImages/{0}\" style=\"width:120px;height:100px;\"/></div></td><td height=\"20\" bgcolor=\"#FFFFFF\" style=\"padding:0 0 0 5px;\"><div align=\"left\">{1}</div></td><td height=\"20\" bgcolor=\"#FFFFFF\"><div align=\"left\" style=\"padding:0 0 0 5px;\">{2}</div></td><td height=\"20\" bgcolor=\"#FFFFFF\"><div align=\"center\">{3}</div></td><td height=\"20\" bgcolor=\"#FFFFFF\"><div align=\"center\"><a href=\"/Manager/EditWebImage.aspx/?wiid={4}\"  style=\"color:blue;cursor:pointer;\">编辑</a> | <a href=\"javascript:delwebimages('{5}','{6}')\" style=\"color:blue;cursor:pointer;\">删除</a></div></td></tr>";
                    imgsb.AppendFormat(template, item.imgname, item.imgurl, item.imginfo, item.imagestype, item.wiid, item.wiid, pdata.curpageindex);
                }
                imageslistHTML = imgsb.ToString();

                pageHTML = pagehelper.Pager(pdata.curpageindex, pdata.pagesize, pdata.recordcount, PageMode.Numeric, 5);
            }
        }
Exemple #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                //大目录
                List<categoryinfo> alist = category.getbigcategory();
                StringBuilder aselectsb = new StringBuilder();
                aselectsb.Append("<select id=\"bcselect\" style=\"width:100px; border:solid 1px #cacaca; height:20px;z-index:100;\">");
                foreach (categoryinfo item in alist)
                {
                    string template = "<option value=\"{0}\">{1}</option>";
                    aselectsb.AppendFormat(template, item.bigcategoryid, item.bigcategory);
                }
                aselectsb.Append("</select>");
                bcHTML = aselectsb.ToString();

                int page = 1;
                if (Request.QueryString["page"] != null)
                {
                    page = TypeParse.DbObjToInt(Request.QueryString["page"].ToString(), 1);
                }
                pageinfo pdata = new pageinfo();
                pdata.curpageindex = page;
                pdata.pagesize = 20;
                if (Request.QueryString["pinfo"] != null)
                {
                    string pname = HttpUtility.UrlDecode(Request.QueryString["pinfo"].ToString());
                    pdata.where = "smallcategory.smallcategoryid=product.smallcategoryid and bigcategory.bigcategoryid=smallcategory.bigcategoryid and place.placeid=product.placeid and product.productname like'%"+pname+"%'";
                    pdata.recordcount = product.getproductcountbycondition(" product.productname like '%"+pname+"%'");
                }
                else if (Request.QueryString["bcid"] != null)
                {
                    int bcid = TypeParse.DbObjToInt(Request.QueryString["bcid"].ToString(), 0);
                    pdata.where = "smallcategory.smallcategoryid=product.smallcategoryid and bigcategory.bigcategoryid=smallcategory.bigcategoryid and place.placeid=product.placeid and product.bigcategoryid=" +bcid;
                    pdata.recordcount = product.getproductcountbycondition(" product.bigcategoryid=" + bcid);
                }
                else if (Request.QueryString["state"] != null)
                {
                    int state = TypeParse.DbObjToInt(Request.QueryString["state"].ToString(), 0);
                    pdata.where = "smallcategory.smallcategoryid=product.smallcategoryid and bigcategory.bigcategoryid=smallcategory.bigcategoryid and place.placeid=product.placeid and product.salestate=" + state;
                    pdata.recordcount = product.getproductcountbycondition(" product.salestate=" + state);
                }
                else
                {
                    pdata.where = "smallcategory.smallcategoryid=product.smallcategoryid and bigcategory.bigcategoryid=smallcategory.bigcategoryid and place.placeid=product.placeid";
                    pdata.recordcount = product.getproductcount();
                }

                pdata.tablename = "smallcategory,product,bigcategory,place";
                pdata.fieldlist = "product.productid,product.productname,product.productprice,product.productcode,product.productbrief,product.productintroduce,product.vipprice,product.productimg,product.smallcategoryid,product.bigcategoryid,product.brand,product.punit,product.adddate,product.editdate,product.salestate,product.placeid,smallcategory.smallcategory,bigcategory.bigcategory,place.place";
                pdata.sorttype = 2;
                pdata.primarykey = "productid";
                pdata.totalpagecount = (pdata.recordcount % pdata.pagesize == 0 ? pdata.recordcount / pdata.pagesize : pdata.recordcount / pdata.pagesize + 1);
                if (pdata.totalpagecount == 0)
                {
                    pdata.totalpagecount = 1;
                }

                List<productinfo> list = product.getproduct(pdata);
                StringBuilder sb = new StringBuilder();
                foreach (productinfo item in list)
                {
                    string template = "<tr><td height=\"20\" bgcolor=\"#FFFFFF\"><div align=\"center\" style=\"padding:5px 0;\"><img src=\"/Files/product/{0}\" style=\"width:120px;height:100px;\"/></div></td><td height=\"20\" bgcolor=\"#FFFFFF\" style=\"padding:0 0 0 5px;\"><div align=\"left\">{1}</div></td><td height=\"20\" bgcolor=\"#FFFFFF\"><div align=\"center\" style=\"padding:0 0 0 5px;\">{2}</div></td><td height=\"20\" bgcolor=\"#FFFFFF\"><div align=\"center\" style=\"padding:0 0 0 5px;\">{3}</div></td><td height=\"20\" bgcolor=\"#FFFFFF\"><div align=\"center\"><a href=\"javascript:ChangeSalestate('{4}','{5}','{6}')\" style=\"color:blue;cursor:pointer;\">{7}</a> | <a href=\"/Manager/EditProduct.aspx/?productid={8}\" style=\"color:blue;cursor:pointer;\">编辑</a> | <a href=\"javascript:delproduct('{9}','{10}')\" style=\"color:blue;cursor:pointer;\">删除</a></div></td></tr>";
                    sb.AppendFormat(template, item.productimg, item.productname, item.vipprice, item.salestate == 0 ? "<span style=\"color:green\">销售中</span>" : "<span style=\"color:red\">已下架</span>", item.productid, item.salestate == 0 ? "1" : "0", pdata.curpageindex, item.salestate == 1 ? "上架" : "下架", item.productid, item.productid, pdata.curpageindex);
                }
                productlistHTML = sb.ToString();
                pageHTML = pagehelper.Pager(pdata.curpageindex, pdata.pagesize, pdata.recordcount, PageMode.Numeric, 5);
            }
        }
Exemple #9
0
 /// <summary>
 /// 得到广告图片
 /// </summary>
 /// <param name="pdata"></param>
 /// <returns></returns>
 public static List<webimagesinfo> getwebimages(pageinfo pdata)
 {
     List<webimagesinfo> webimageslist = new List<webimagesinfo>();
     try
     {
         DataTable dt = pagehelper.getpagedt(pdata);
         if (dt != null)
         {
             foreach (DataRow dr in dt.Rows)
             {
                 webimagesinfo item = new webimagesinfo();
                 item.wiid = TypeParse.DbObjToInt(dr["wiid"].ToString(), 0);
                 item.imgurl = TypeParse.DbObjToString(dr["imgurl"].ToString(), "");
                 item.imginfo = TypeParse.DbObjToString(dr["imginfo"].ToString(), "");
                 item.imgname = TypeParse.DbObjToString(dr["imgname"].ToString(), "noimgs.jpg");
                 item.itid = TypeParse.DbObjToInt(dr["itid"].ToString(), 0);
                 item.imagestype = TypeParse.DbObjToString(dr["imagestype"].ToString(), "");
                 item.imgcor = TypeParse.DbObjToString(dr["imgcor"].ToString(), "");
                 webimageslist.Add(item);
             }
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
     finally
     {
     }
     return webimageslist;
 }
Exemple #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                int page = 1;
                if (Request.QueryString["page"] != null)
                {
                    page = TypeParse.DbObjToInt(Request.QueryString["page"].ToString(), 1);
                }
                pageinfo pdata = new pageinfo();
                pdata.curpageindex = page;
                pdata.pagesize = 20;
                if (RouteData.Values["bcid"] != null && RouteData.Values["bcid"].ToString() != "0")
                {
                    pdata.where = "smallcategory.smallcategoryid=product.smallcategoryid and bigcategory.bigcategoryid=smallcategory.bigcategoryid and place.placeid=product.placeid and product.bigcategoryid="+RouteData.Values["bcid"].ToString();
                    pdata.recordcount = product.getproductcountbycondition("product.bigcategoryid=" + RouteData.Values["bcid"].ToString());
                    categoryinfo data=category.getbigcategoryinfo(TypeParse.DbObjToInt(RouteData.Values["bcid"].ToString(),0));
                    ptypeHTML = data.bigcategory;
                }
                else if (RouteData.Values["scid"] != null && RouteData.Values["scid"].ToString() != "0")
                {
                    pdata.where = "smallcategory.smallcategoryid=product.smallcategoryid and bigcategory.bigcategoryid=smallcategory.bigcategoryid and place.placeid=product.placeid and product.smallcategoryid=" + RouteData.Values["scid"].ToString();
                    pdata.recordcount = product.getproductcountbycondition("product.smallcategoryid=" + RouteData.Values["scid"].ToString());
                    categoryinfo data = category.getsmallcategoryinfo(TypeParse.DbObjToInt(RouteData.Values["scid"].ToString(), 0));
                    ptypeHTML = data.smallcategory;
                }
                else if (RouteData.Values["placeid"] != null && RouteData.Values["placeid"].ToString() != "0")
                {
                    pdata.where = "smallcategory.smallcategoryid=product.smallcategoryid and bigcategory.bigcategoryid=smallcategory.bigcategoryid and place.placeid=product.placeid and product.placeid=" + RouteData.Values["placeid"].ToString();
                    pdata.recordcount = product.getproductcountbycondition("product.placeid=" + RouteData.Values["placeid"].ToString());
                    categoryinfo data = category.getplaceinfo(TypeParse.DbObjToInt(RouteData.Values["placeid"].ToString(), 0));
                    ptypeHTML ="水果产地:"+ data.place;
                }
                else if (RouteData.Values["price"] != null && RouteData.Values["price"].ToString() != "0")
                {
                    switch (RouteData.Values["price"].ToString())
                    {
                        case "1":
                            pdata.where = "smallcategory.smallcategoryid=product.smallcategoryid and bigcategory.bigcategoryid=smallcategory.bigcategoryid and place.placeid=product.placeid and product.vipprice>0 and product.vipprice<=50";
                            pdata.recordcount = product.getproductcountbycondition("product.vipprice>0 and product.vipprice<=50");
                            ptypeHTML = "价格0到50元水果";
                            break;
                        case "2":
                            pdata.where = "smallcategory.smallcategoryid=product.smallcategoryid and bigcategory.bigcategoryid=smallcategory.bigcategoryid and place.placeid=product.placeid and product.vipprice>50 and product.vipprice<=100";
                            pdata.recordcount = product.getproductcountbycondition("product.vipprice>50 and product.vipprice<=100");
                            ptypeHTML = "价格50到100元水果";
                            break;
                        case "3":
                            pdata.where = "smallcategory.smallcategoryid=product.smallcategoryid and bigcategory.bigcategoryid=smallcategory.bigcategoryid and place.placeid=product.placeid and product.vipprice>100 and product.vipprice<=200";
                            pdata.recordcount = product.getproductcountbycondition("product.vipprice>100 and product.vipprice<=200");
                            ptypeHTML = "价格100到200元水果";
                            break;
                        case "4":
                            pdata.where = "smallcategory.smallcategoryid=product.smallcategoryid and bigcategory.bigcategoryid=smallcategory.bigcategoryid and place.placeid=product.placeid and product.vipprice>200 and product.vipprice<=500";
                            pdata.recordcount = product.getproductcountbycondition("product.vipprice>200 and product.vipprice<=500");
                            ptypeHTML = "价格200到500元水果";
                            break;
                        case "5":
                            pdata.where = "smallcategory.smallcategoryid=product.smallcategoryid and bigcategory.bigcategoryid=smallcategory.bigcategoryid and place.placeid=product.placeid and product.vipprice>500";
                            pdata.recordcount = product.getproductcountbycondition("product.vipprice>500");
                            ptypeHTML = "价格500元以上水果";
                            break;
                        default:
                            pdata.where = "smallcategory.smallcategoryid=product.smallcategoryid and bigcategory.bigcategoryid=smallcategory.bigcategoryid and place.placeid=product.placeid";
                            pdata.recordcount = product.getproductcount();
                            break;
                    }

                }
                else if (RouteData.Values["pname"] != null && RouteData.Values["pname"].ToString() != "")
                {
                    string pname=RouteData.Values["pname"].ToString();
                    pdata.where = "smallcategory.smallcategoryid=product.smallcategoryid and bigcategory.bigcategoryid=smallcategory.bigcategoryid and place.placeid=product.placeid and product.productname like'%" + RouteData.Values["pname"].ToString()+"%'";
                    pdata.recordcount = product.getproductcountbycondition("product.productname like '%" + RouteData.Values["pname"].ToString()+"%'");
                    categoryinfo data = category.getplaceinfo(TypeParse.DbObjToInt(RouteData.Values["placeid"].ToString(), 0));
                    ptypeHTML = "商品名称:" +pname ;
                }
                else
                {
                    pdata.where = "smallcategory.smallcategoryid=product.smallcategoryid and bigcategory.bigcategoryid=smallcategory.bigcategoryid and place.placeid=product.placeid";
                    pdata.recordcount = product.getproductcount();
                }
                pdata.tablename = "smallcategory,product,bigcategory,place";
                pdata.fieldlist = "product.productid,product.productname,product.productprice,product.productcode,product.productbrief,product.productintroduce,product.vipprice,product.productimg,product.smallcategoryid,product.bigcategoryid,product.brand,product.punit,product.adddate,product.editdate,product.salestate,product.placeid,smallcategory.smallcategory,bigcategory.bigcategory,place.place";
                pdata.sorttype = 2;
                pdata.primarykey = "productid";
                pdata.totalpagecount = (pdata.recordcount % pdata.pagesize == 0 ? pdata.recordcount / pdata.pagesize : pdata.recordcount / pdata.pagesize + 1);
                if (pdata.totalpagecount == 0)
                {
                    pdata.totalpagecount = 1;
                }

                List<productinfo> list = product.getproduct(pdata);
                StringBuilder sb = new StringBuilder();
                foreach (productinfo item in list)
                {
                    string template = "<div class=\"productlistli\"><a href=\"/PInfo/{0}.html\" class=\"plistimg\" title=\"{1}\" target=\"_blank\"><img src=\"/Files/Product/{2}\" /></a> <a href=\"/PInfo/{3}.html\" class=\"plisttitle\" title=\"{4}\"  target=\"_blank\">{5}</a> <a href=\"/PInfo/{6}.html\" class=\"plistsite\"  target=\"_blank\">规格:{7}</a>  <a href=\"/PInfo/{8}.html\" class=\"plistprice\"  target=\"_blank\"><span class=\"pricecss1\">¥{9}</span><span class=\"pricecss2\">¥{10}</span>{11}</a></div>";
                    sb.AppendFormat(template,item.productid,item.productname, item.productimg,item.productid, item.productname,comm.SubStr(item.productname,15),item.productid,item.punit,item.productid,item.productprice,item.vipprice,item.salestate == 1 ? "<span class=\"sstate\">已售完</span>" : "");
                }
                productlistHTML = sb.ToString();
                pageHTML = pagehelper.Pager(pdata.curpageindex, pdata.pagesize, pdata.recordcount, PageMode.Numeric, 5);
            }
        }
Exemple #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (Request.Cookies["g_adminid"] != null)
                {

                    //大区下拉菜单
                    List<categoryinfo> d1list = category.getdeliveryI();
                    StringBuilder d1sb = new StringBuilder();
                    d1sb.Append("<select id=\"odIid\" class=\"orderselect\"  onchange=\"changeodI()\"><option value=\"0\">不限</option>");
                    foreach (categoryinfo pitem in d1list)
                    {
                        string template = "<option value=\"{0}\">{1}</option>";
                        d1sb.AppendFormat(template, pitem.deliveryIid, pitem.deliveryI);
                    }
                    d1sb.Append("</select>");
                    d1sbHTML = d1sb.ToString();

                    //大区下拉菜单
                    List<categoryinfo> podlist = category.getdeliveryI();
                    StringBuilder podsb = new StringBuilder();
                    podsb.Append("<select id=\"podIid\" class=\"orderselect\"  onchange=\"changepodI()\"><option value=\"0\">不限</option>");
                    foreach (categoryinfo pitem in podlist)
                    {
                        string template = "<option value=\"{0}\">{1}</option>";
                        podsb.AppendFormat(template, pitem.deliveryIid, pitem.deliveryI);
                    }
                    podsb.Append("</select>");
                    podsbHTML = podsb.ToString();

                    //大区下拉菜单
                    List<categoryinfo> phodlist = category.getdeliveryI();
                    StringBuilder phodsb = new StringBuilder();
                    phodsb.Append("<select id=\"phodIid\" class=\"orderselect\"  onchange=\"changephodI()\"><option value=\"0\">不限</option>");
                    foreach (categoryinfo pitem in phodlist)
                    {
                        string template = "<option value=\"{0}\">{1}</option>";
                        phodsb.AppendFormat(template, pitem.deliveryIid, pitem.deliveryI);
                    }
                    phodsb.Append("</select>");
                    phodsbHTML = phodsb.ToString();

                    if (Request.QueryString["type"] != null)
                    {
                        StringBuilder dysb = new StringBuilder();
                        string type = Request.QueryString["type"].ToString();
                        switch (type)
                        {
                            //第一列导航
                            case "1":
                                if (Request.QueryString["n"] != null)
                                {
                                    string n = Request.QueryString["n"].ToString();
                                    switch (n)
                                    {
                                        #region 第一列导航明细

                                        //今日配货总览
                                        case "1":
                                            List<orderinfo> list = order.getphlist(" and userorder.orderstate=0 and DateDiff(dd,userorder.deliverydate,GetDate())=0");
                                            dysb.Append(" <h2>今日(" + DateTime.Now.ToString("yyyy-MM-dd") + ")配货总览</h2>");
                                            dysb.Append(" <table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" class=\"otb\"><tr style=\"height: 30px; line-height: 30px; background-color:#efefef\"><td align=\"center\">产品编号</td><td align=\"center\">产品名称</td> <td align=\"center\">产品图片</td><td align=\"center\">配货数量</td><td align=\"center\">配货日期</td></tr>");
                                            foreach (orderinfo item in list)
                                            {
                                                string template = "<tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td align=\"center\">{0}</td><td align=\"center\" class=\"oimg\"><img src=\"/Files/Product/{1}\" /></td><td align=\"center\">{2}</td><td align=\"center\"><span class=\"fb\">{3}</span></td><td align=\"center\">{4}</td></tr>";
                                                dysb.AppendFormat(template, item.productcode, item.productimg, item.productname, item.tjbuynum, DateTime.Now.ToString("yyyy-MM-dd"));
                                            }
                                            dysb.Append("</table>");

                                            List<categoryinfo> clist = category.getdeliveryI();
                                            foreach (categoryinfo citem in clist)
                                            {
                                                List<orderinfo> olist1 = order.getphlist(" and userorder.orderstate=0  and DateDiff(dd,userorder.deliverydate,GetDate())=0 and userorder.deliveryIid=" + citem.deliveryIid);
                                                dysb.Append(" <h2>今日(" + DateTime.Now.ToString("yyyy-MM-dd") + ")" + citem.deliveryI + "配货总览</h2>");
                                                dysb.Append(" <table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" class=\"otb\"><tr style=\"height: 30px; line-height: 30px; background-color:#efefef\"><td align=\"center\">产品编号</td><td align=\"center\">产品名称</td> <td align=\"center\">产品图片</td><td align=\"center\">配货数量</td><td align=\"center\">配货日期</td></tr>");
                                                foreach (orderinfo item in olist1)
                                                {
                                                    string template = "<tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td align=\"center\">{0}</td><td align=\"center\" class=\"oimg\"><img src=\"/Files/Product/{1}\" /></td><td align=\"center\">{2}</td><td align=\"center\"><span class=\"fb\">{3}</span></td><td align=\"center\">{4}</td></tr>";
                                                    dysb.AppendFormat(template, item.productcode, item.productimg, item.productname, item.tjbuynum, DateTime.Now.ToString("yyyy-MM-dd"));
                                                }
                                                dysb.Append("</table>");
                                            }

                                            dyHTML = dysb.ToString();
                                            id1.Style.Value = "background:url(/Images/a.gif) no-repeat 0 -33px;color:White;";
                                            break;

                                        //今日配货订单
                                        case "2":
                                            int page = 1;
                                            if (Request.QueryString["page"] != null)
                                            {
                                                page = TypeParse.DbObjToInt(Request.QueryString["page"].ToString(), 1);
                                            }
                                            pageinfo pdata = new pageinfo();
                                            pdata.curpageindex = page;
                                            pdata.pagesize = 100000;
                                            pdata.where = " a.orderstate=0 and  a.deliveryIid=c.deliveryIid and a.deliveryIIid=d.deliveryIIid and DateDiff(dd,a.deliverydate,GetDate())=0";
                                            pdata.recordcount = order.getcountbycondition(" DateDiff(dd,userorder.deliverydate,GetDate())=0");
                                            pdata.tablename = "userorder a,deliveryI c,deliveryII d";
                                            pdata.fieldlist = "a.orderid,a.orderstate,a.ordernumber,a.orderdate,a.deliverydate,a.allmoney,a.paymoney,a.contact,a.tel,a.mobile,a.address,c.deliveryI,d.deliveryII";
                                            pdata.sorttype = 2;
                                            pdata.primarykey = "orderid";
                                            pdata.totalpagecount = (pdata.recordcount % pdata.pagesize == 0 ? pdata.recordcount / pdata.pagesize : pdata.recordcount / pdata.pagesize + 1);
                                            if (pdata.totalpagecount == 0)
                                            {
                                                pdata.totalpagecount = 1;
                                            }

                                            List<orderinfo> list2 = order.getorderlist(pdata);
                                            StringBuilder sb = new StringBuilder();
                                            sb.Append(" <h2>今日(" + DateTime.Now.ToString("yyyy-MM-dd") + ")配货订单</h2>");
                                            foreach (orderinfo item in list2)
                                            {
                                                string template = " <table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" class=\"otb\"><tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td colspan=\"6\" style=\"padding-left: 10px;\"><span class=\"fb\">订单编号:{0}</span>&nbsp;&nbsp;下单日期:{1}&nbsp;&nbsp;送货日期:{2}</td></tr><tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td colspan=\"6\" style=\"padding-left: 10px;\">收货人:{3}&nbsp;&nbsp;手机号码:{4}&nbsp;&nbsp;固定电话:{5}&nbsp;&nbsp;大区:{6}&nbsp;&nbsp;小区:{7}<span class=\"fr\"><a href=\"javascript:editorder('{8}')\" class=\"cb mr5\">编辑</a></span></td></tr><tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td colspan=\"3\" style=\"padding-left: 10px;\">地址:{9}</td><td colspan=\"2\" align=\"center\">产品总额:¥{10}元</td><td align=\"center\">应付总额:<span class=\"fb red\">¥{11}元</span></td></tr><tr style=\"height: 30px; line-height: 30px; background-color:#efefef\"><td style=\"padding-left: 10px;\">序号</td><td align=\"center\">产品图片</td><td align=\"center\">产品名称</td><td align=\"center\">购买数量</td><td align=\"center\">产品单价 </td><td align=\"center\">小计</td></tr> ";
                                                sb.AppendFormat(template, item.ordernumber, item.orderdate, item.deliverydate.ToString("yyyy-MM-dd"), item.contact, item.mobile, item.tel, item.deliveryI, item.deliveryII, item.orderid, item.address, item.allmoney.ToString("f2"), item.paymoney.ToString("f2"));
                                                List<orderinfo> plist = order.getcartlistbyordernumber(item.ordernumber);
                                                for (int k = 0; k < plist.Count; k++)
                                                {
                                                    string ptemplate = "<tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td style=\"padding-left: 10px;\">{0}</td><td align=\"center\" class=\"oimg\"><a href=\"/PInfo/{1}\" target=\"_blank\"><img src=\"/Files/Product/{2}\" /></a></td><td align=\"center\">{3}</td><td align=\"center\">{4}</td><td align=\"center\">{5}</td><td align=\"center\">{6}</td></tr>";
                                                    sb.AppendFormat(ptemplate, k + 1, plist[k].productid, plist[k].productimg, plist[k].productname, plist[k].buynum, plist[k].vipprice.ToString("f2"), (plist[k].vipprice * plist[k].buynum).ToString("f2"));
                                                }

                                            }
                                            sb.Append("</table>");
                                            dyHTML = sb.ToString();
                                            id2.Style.Value = "background:url(/Images/a.gif) no-repeat 0 -33px;color:White;";
                                            break;

                                        //今日订单明细
                                        case "3":
                                            int page2 = 1;
                                            if (Request.QueryString["page"] != null)
                                            {
                                                page2 = TypeParse.DbObjToInt(Request.QueryString["page"].ToString(), 1);
                                            }
                                            pageinfo pdata2 = new pageinfo();
                                            pdata2.curpageindex = page2;
                                            pdata2.pagesize = 100000;
                                            pdata2.where = "a.deliveryIid=c.deliveryIid and a.deliveryIIid=d.deliveryIIid and DateDiff(dd,a.orderdate,GetDate())=0";
                                            pdata2.recordcount = order.getcountbycondition(" DateDiff(dd,userorder.orderdate,GetDate())=0");
                                            pdata2.tablename = "userorder a,deliveryI c,deliveryII d";
                                            pdata2.fieldlist = "a.orderid,a.orderstate,a.ordernumber,a.orderdate,a.deliverydate,a.allmoney,a.paymoney,a.contact,a.tel,a.mobile,a.address,c.deliveryI,d.deliveryII";
                                            pdata2.sorttype = 2;
                                            pdata2.primarykey = "orderid";
                                            pdata2.totalpagecount = (pdata2.recordcount % pdata2.pagesize == 0 ? pdata2.recordcount / pdata2.pagesize : pdata2.recordcount / pdata2.pagesize + 1);
                                            if (pdata2.totalpagecount == 0)
                                            {
                                                pdata2.totalpagecount = 1;
                                            }

                                            List<orderinfo> list3 = order.getorderlist(pdata2);
                                            StringBuilder sb3 = new StringBuilder();
                                            sb3.Append(" <h2>今日(" + DateTime.Now.ToString("yyyy-MM-dd") + ")订单明细</h2>");
                                            foreach (orderinfo item in list3)
                                            {
                                                string template = " <table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" class=\"otb\"><tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td colspan=\"6\" style=\"padding-left: 10px;\"><span class=\"fb\">订单编号:{0}</span>&nbsp;&nbsp;下单日期:{1}&nbsp;&nbsp;送货日期:{2}</td></tr><tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td colspan=\"6\" style=\"padding-left: 10px;\">收货人:{3}&nbsp;&nbsp;手机号码:{4}&nbsp;&nbsp;固定电话:{5}&nbsp;&nbsp;大区:{6}&nbsp;&nbsp;小区:{7}&nbsp;&nbsp;订单状态:{8}<span class=\"fr\"><a href=\"javascript:editorder('{9}')\" class=\"cb mr5\">编辑</a></span></td></tr><tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td colspan=\"3\" style=\"padding-left: 10px;\">地址:{10}</td><td colspan=\"2\" align=\"center\">产品总额:¥{11}元</td><td align=\"center\">应付总额:<span class=\"fb red\">¥{12}元</span></td></tr><tr style=\"height: 30px; line-height: 30px; background-color:#efefef\"><td style=\"padding-left: 10px;\">序号</td><td align=\"center\">产品图片</td><td align=\"center\">产品名称</td><td align=\"center\">购买数量</td><td align=\"center\">产品单价 </td><td align=\"center\">小计</td></tr> ";
                                                sb3.AppendFormat(template, item.ordernumber, item.orderdate, item.deliverydate.ToString("yyyy-MM-dd"), item.contact, item.mobile, item.tel, item.deliveryI, item.deliveryII, item.orderstatestr, item.orderid, item.address, item.allmoney.ToString("f2"), item.paymoney.ToString("f2"));
                                                List<orderinfo> plist = order.getcartlistbyordernumber(item.ordernumber);
                                                for (int k = 0; k < plist.Count; k++)
                                                {
                                                    string ptemplate = "<tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td style=\"padding-left: 10px;\">{0}</td><td align=\"center\" class=\"oimg\"><a href=\"/PInfo/{1}\" target=\"_blank\"><img src=\"/Files/Product/{2}\" /></a></td><td align=\"center\">{3}</td><td align=\"center\">{4}</td><td align=\"center\">{5}</td><td align=\"center\">{6}</td></tr>";
                                                    sb3.AppendFormat(ptemplate, k + 1, plist[k].productid, plist[k].productimg, plist[k].productname, plist[k].buynum, plist[k].vipprice.ToString("f2"), (plist[k].vipprice * plist[k].buynum).ToString("f2"));
                                                }

                                            }
                                            sb3.Append("</table>");
                                            dyHTML = sb3.ToString();
                                            id3.Style.Value = "background:url(/Images/a.gif) no-repeat 0 -33px;color:White;";
                                            break;

                                        //本月订单明细
                                        case "4":
                                            int page4 = 1;
                                            if (Request.QueryString["page"] != null)
                                            {
                                                page4 = TypeParse.DbObjToInt(Request.QueryString["page"].ToString(), 1);
                                            }
                                            pageinfo pdata4 = new pageinfo();
                                            pdata4.curpageindex = page4;
                                            pdata4.pagesize = 10;
                                            pdata4.where = "a.deliveryIid=c.deliveryIid and a.deliveryIIid=d.deliveryIIid and DateDiff(Month,a.orderdate,GetDate())=0";
                                            pdata4.recordcount = order.getcountbycondition(" DateDiff(Month,userorder.orderdate,GetDate())=0");
                                            pdata4.tablename = "userorder a,deliveryI c,deliveryII d";
                                            pdata4.fieldlist = "a.orderid,a.orderstate,a.ordernumber,a.orderdate,a.deliverydate,a.allmoney,a.paymoney,a.contact,a.tel,a.mobile,a.address,c.deliveryI,d.deliveryII";
                                            pdata4.sorttype = 2;
                                            pdata4.primarykey = "orderid";
                                            pdata4.totalpagecount = (pdata4.recordcount % pdata4.pagesize == 0 ? pdata4.recordcount / pdata4.pagesize : pdata4.recordcount / pdata4.pagesize + 1);
                                            if (pdata4.totalpagecount == 0)
                                            {
                                                pdata4.totalpagecount = 1;
                                            }

                                            List<orderinfo> list4 = order.getorderlist(pdata4);
                                            StringBuilder sb4 = new StringBuilder();
                                            sb4.Append(" <h2>本月(" + DateTime.Now.ToString("yyyy-MM") + ")订单明细</h2>");
                                            foreach (orderinfo item in list4)
                                            {
                                                string template = " <table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" class=\"otb\"><tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td colspan=\"6\" style=\"padding-left: 10px;\"><span class=\"fb\">订单编号:{0}</span>&nbsp;&nbsp;下单日期:{1}&nbsp;&nbsp;送货日期:{2}</td></tr><tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td colspan=\"6\" style=\"padding-left: 10px;\">收货人:{3}&nbsp;&nbsp;手机号码:{4}&nbsp;&nbsp;固定电话:{5}&nbsp;&nbsp;大区:{6}&nbsp;&nbsp;小区:{7}&nbsp;&nbsp;订单状态:{8}<span class=\"fr\"><a href=\"javascript:editorder('{9}')\" class=\"cb mr5\">编辑</a></span></td></tr><tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td colspan=\"3\" style=\"padding-left: 10px;\">地址:{10}</td><td colspan=\"2\" align=\"center\">产品总额:¥{11}元</td><td align=\"center\">应付总额:<span class=\"fb red\">¥{12}元</span></td></tr><tr style=\"height: 30px; line-height: 30px; background-color:#efefef\"><td style=\"padding-left: 10px;\">序号</td><td align=\"center\">产品图片</td><td align=\"center\">产品名称</td><td align=\"center\">购买数量</td><td align=\"center\">产品单价 </td><td align=\"center\">小计</td></tr> ";
                                                sb4.AppendFormat(template, item.ordernumber, item.orderdate, item.deliverydate.ToString("yyyy-MM-dd"), item.contact, item.mobile, item.tel, item.deliveryI, item.deliveryII, item.orderstatestr, item.orderid, item.address, item.allmoney.ToString("f2"), item.paymoney.ToString("f2"));
                                                List<orderinfo> plist = order.getcartlistbyordernumber(item.ordernumber);
                                                for (int k = 0; k < plist.Count; k++)
                                                {
                                                    string ptemplate = "<tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td style=\"padding-left: 10px;\">{0}</td><td align=\"center\" class=\"oimg\"><a href=\"/PInfo/{1}\" target=\"_blank\"><img src=\"/Files/Product/{2}\" /></a></td><td align=\"center\">{3}</td><td align=\"center\">{4}</td><td align=\"center\">{5}</td><td align=\"center\">{6}</td></tr>";
                                                    sb4.AppendFormat(ptemplate, k + 1, plist[k].productid, plist[k].productimg, plist[k].productname, plist[k].buynum, plist[k].vipprice.ToString("f2"), (plist[k].vipprice * plist[k].buynum).ToString("f2"));
                                                }

                                            }
                                            sb4.Append("</table>");
                                            dyHTML = sb4.ToString();
                                            pageHTML = pagehelper.Pager(pdata4.curpageindex, pdata4.pagesize, pdata4.recordcount, PageMode.Numeric, 5);
                                            id4.Style.Value = "background:url(/Images/a.gif) no-repeat 0 -33px;color:White;";
                                            break;

                                        //所有订单明细
                                        case "5":
                                            int page5 = 1;
                                            if (Request.QueryString["page"] != null)
                                            {
                                                page5 = TypeParse.DbObjToInt(Request.QueryString["page"].ToString(), 1);
                                            }
                                            pageinfo pdata5 = new pageinfo();
                                            pdata5.curpageindex = page5;
                                            pdata5.pagesize = 10;
                                            pdata5.where = "a.deliveryIid=c.deliveryIid and a.deliveryIIid=d.deliveryIIid";
                                            pdata5.recordcount = order.getcount();
                                            pdata5.tablename = "userorder a,deliveryI c,deliveryII d";
                                            pdata5.fieldlist = "a.orderid,a.orderstate,a.ordernumber,a.orderdate,a.deliverydate,a.allmoney,a.paymoney,a.contact,a.tel,a.mobile,a.address,c.deliveryI,d.deliveryII";
                                            pdata5.sorttype = 2;
                                            pdata5.primarykey = "orderid";
                                            pdata5.totalpagecount = (pdata5.recordcount % pdata5.pagesize == 0 ? pdata5.recordcount / pdata5.pagesize : pdata5.recordcount / pdata5.pagesize + 1);
                                            if (pdata5.totalpagecount == 0)
                                            {
                                                pdata5.totalpagecount = 1;
                                            }

                                            List<orderinfo> list5 = order.getorderlist(pdata5);
                                            StringBuilder sb5 = new StringBuilder();
                                            sb5.Append(" <h2>所有订单明细</h2>");
                                            foreach (orderinfo item in list5)
                                            {
                                                string template = " <table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" class=\"otb\"><tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td colspan=\"6\" style=\"padding-left: 10px;\"><span class=\"fb\">订单编号:{0}</span>&nbsp;&nbsp;下单日期:{1}&nbsp;&nbsp;送货日期:{2}</td></tr><tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td colspan=\"6\" style=\"padding-left: 10px;\">收货人:{3}&nbsp;&nbsp;手机号码:{4}&nbsp;&nbsp;固定电话:{5}&nbsp;&nbsp;大区:{6}&nbsp;&nbsp;小区:{7}&nbsp;&nbsp;订单状态:{8}<span class=\"fr\"><a href=\"javascript:editorder('{9}')\" class=\"cb mr5\">编辑</a></span></td></tr><tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td colspan=\"3\" style=\"padding-left: 10px;\">地址:{10}</td><td colspan=\"2\" align=\"center\">产品总额:¥{11}元</td><td align=\"center\">应付总额:<span class=\"fb red\">¥{12}元</span></td></tr><tr style=\"height: 30px; line-height: 30px; background-color:#efefef\"><td style=\"padding-left: 10px;\">序号</td><td align=\"center\">产品图片</td><td align=\"center\">产品名称</td><td align=\"center\">购买数量</td><td align=\"center\">产品单价 </td><td align=\"center\">小计</td></tr> ";
                                                sb5.AppendFormat(template, item.ordernumber, item.orderdate, item.deliverydate.ToString("yyyy-MM-dd"), item.contact, item.mobile, item.tel, item.deliveryI, item.deliveryII, item.orderstatestr, item.orderid, item.address, item.allmoney.ToString("f2"), item.paymoney.ToString("f2"));
                                                List<orderinfo> plist = order.getcartlistbyordernumber(item.ordernumber);
                                                for (int k = 0; k < plist.Count; k++)
                                                {
                                                    string ptemplate = "<tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td style=\"padding-left: 10px;\">{0}</td><td align=\"center\" class=\"oimg\"><a href=\"/PInfo/{1}\" target=\"_blank\"><img src=\"/Files/Product/{2}\" /></a></td><td align=\"center\">{3}</td><td align=\"center\">{4}</td><td align=\"center\">{5}</td><td align=\"center\">{6}</td></tr>";
                                                    sb5.AppendFormat(ptemplate, k + 1, plist[k].productid, plist[k].productimg, plist[k].productname, plist[k].buynum, plist[k].vipprice.ToString("f2"), (plist[k].vipprice * plist[k].buynum).ToString("f2"));
                                                }

                                            }
                                            sb5.Append("</table>");
                                            dyHTML = sb5.ToString();
                                            pageHTML = pagehelper.Pager(pdata5.curpageindex, pdata5.pagesize, pdata5.recordcount, PageMode.Numeric, 5);
                                            id5.Style.Value = "background:url(/Images/a.gif) no-repeat 0 -33px;color:White;";
                                            break;

                                        //进行中订单
                                        case "6":
                                            int page6 = 1;
                                            if (Request.QueryString["page"] != null)
                                            {
                                                page6 = TypeParse.DbObjToInt(Request.QueryString["page"].ToString(), 1);
                                            }
                                            pageinfo pdata6 = new pageinfo();
                                            pdata6.curpageindex = page6;
                                            pdata6.pagesize = 10;
                                            pdata6.where = "a.deliveryIid=c.deliveryIid and a.deliveryIIid=d.deliveryIIid and a.orderstate=0";
                                            pdata6.recordcount = order.getcountbycondition("userorder.orderstate=0");
                                            pdata6.tablename = "userorder a,deliveryI c,deliveryII d";
                                            pdata6.fieldlist = "a.orderid,a.orderstate,a.ordernumber,a.orderdate,a.deliverydate,a.allmoney,a.paymoney,a.contact,a.tel,a.mobile,a.address,c.deliveryI,d.deliveryII";
                                            pdata6.sorttype = 2;
                                            pdata6.primarykey = "orderid";
                                            pdata6.totalpagecount = (pdata6.recordcount % pdata6.pagesize == 0 ? pdata6.recordcount / pdata6.pagesize : pdata6.recordcount / pdata6.pagesize + 1);
                                            if (pdata6.totalpagecount == 0)
                                            {
                                                pdata6.totalpagecount = 1;
                                            }

                                            List<orderinfo> list6 = order.getorderlist(pdata6);
                                            StringBuilder sb6 = new StringBuilder();
                                            sb6.Append(" <h2>进行中订单</h2>");
                                            foreach (orderinfo item in list6)
                                            {
                                                string template = " <table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" class=\"otb\"><tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td colspan=\"6\" style=\"padding-left: 10px;\"><span class=\"fb\">订单编号:{0}</span>&nbsp;&nbsp;下单日期:{1}&nbsp;&nbsp;送货日期:{2}</td></tr><tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td colspan=\"6\" style=\"padding-left: 10px;\">收货人:{3}&nbsp;&nbsp;手机号码:{4}&nbsp;&nbsp;固定电话:{5}&nbsp;&nbsp;大区:{6}&nbsp;&nbsp;小区:{7}&nbsp;&nbsp;订单状态:{8}<span class=\"fr\"><a href=\"javascript:editorder('{9}')\" class=\"cb mr5\">编辑</a></span></td></tr><tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td colspan=\"3\" style=\"padding-left: 10px;\">地址:{10}</td><td colspan=\"2\" align=\"center\">产品总额:¥{11}元</td><td align=\"center\">应付总额:<span class=\"fb red\">¥{12}元</span></td></tr><tr style=\"height: 30px; line-height: 30px; background-color:#efefef\"><td style=\"padding-left: 10px;\">序号</td><td align=\"center\">产品图片</td><td align=\"center\">产品名称</td><td align=\"center\">购买数量</td><td align=\"center\">产品单价 </td><td align=\"center\">小计</td></tr> ";
                                                sb6.AppendFormat(template, item.ordernumber, item.orderdate, item.deliverydate.ToString("yyyy-MM-dd"), item.contact, item.mobile, item.tel, item.deliveryI, item.deliveryII, item.orderstatestr, item.orderid, item.address, item.allmoney.ToString("f2"), item.paymoney.ToString("f2"));
                                                List<orderinfo> plist = order.getcartlistbyordernumber(item.ordernumber);
                                                for (int k = 0; k < plist.Count; k++)
                                                {
                                                    string ptemplate = "<tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td style=\"padding-left: 10px;\">{0}</td><td align=\"center\" class=\"oimg\"><a href=\"/PInfo/{1}\" target=\"_blank\"><img src=\"/Files/Product/{2}\" /></a></td><td align=\"center\">{3}</td><td align=\"center\">{4}</td><td align=\"center\">{5}</td><td align=\"center\">{6}</td></tr>";
                                                    sb6.AppendFormat(ptemplate, k + 1, plist[k].productid, plist[k].productimg, plist[k].productname, plist[k].buynum, plist[k].vipprice.ToString("f2"), (plist[k].vipprice * plist[k].buynum).ToString("f2"));
                                                }

                                            }
                                            sb6.Append("</table>");
                                            dyHTML = sb6.ToString();
                                            pageHTML = pagehelper.Pager(pdata6.curpageindex, pdata6.pagesize, pdata6.recordcount, PageMode.Numeric, 5);
                                            id6.Style.Value = "background:url(/Images/a.gif) no-repeat 0 -33px;color:White;";
                                            break;

                                        //已完成订单
                                        case "7":
                                            int page7 = 1;
                                            if (Request.QueryString["page"] != null)
                                            {
                                                page7 = TypeParse.DbObjToInt(Request.QueryString["page"].ToString(), 1);
                                            }
                                            pageinfo pdata7 = new pageinfo();
                                            pdata7.curpageindex = page7;
                                            pdata7.pagesize = 10;
                                            pdata7.where = "a.deliveryIid=c.deliveryIid and a.deliveryIIid=d.deliveryIIid and a.orderstate=10";
                                            pdata7.recordcount = order.getcountbycondition("userorder.orderstate=10");
                                            pdata7.tablename = "userorder a,deliveryI c,deliveryII d";
                                            pdata7.fieldlist = "a.orderid,a.orderstate,a.ordernumber,a.orderdate,a.deliverydate,a.allmoney,a.paymoney,a.contact,a.tel,a.mobile,a.address,c.deliveryI,d.deliveryII";
                                            pdata7.sorttype = 2;
                                            pdata7.primarykey = "orderid";
                                            pdata7.totalpagecount = (pdata7.recordcount % pdata7.pagesize == 0 ? pdata7.recordcount / pdata7.pagesize : pdata7.recordcount / pdata7.pagesize + 1);
                                            if (pdata7.totalpagecount == 0)
                                            {
                                                pdata7.totalpagecount = 1;
                                            }

                                            List<orderinfo> list7 = order.getorderlist(pdata7);
                                            StringBuilder sb7 = new StringBuilder();
                                            sb7.Append(" <h2>已完成订单</h2>");
                                            foreach (orderinfo item in list7)
                                            {
                                                string template = " <table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" class=\"otb\"><tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td colspan=\"7\" style=\"padding-left: 10px;\"><span class=\"fb\">订单编号:{0}</span>&nbsp;&nbsp;下单日期:{1}&nbsp;&nbsp;送货日期:{2}</td></tr><tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td colspan=\"6\" style=\"padding-left: 10px;\">收货人:{3}&nbsp;&nbsp;手机号码:{4}&nbsp;&nbsp;固定电话:{5}&nbsp;&nbsp;大区:{7}&nbsp;&nbsp;小区:{7}&nbsp;&nbsp;订单状态:{8}<span class=\"fr\"><a href=\"javascript:editorder('{9}')\" class=\"cb mr5\">编辑</a></span></td></tr><tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td colspan=\"3\" style=\"padding-left: 10px;\">地址:{10}</td><td colspan=\"2\" align=\"center\">产品总额:¥{11}元</td><td align=\"center\">应付总额:<span class=\"fb red\">¥{12}元</span></td></tr><tr style=\"height: 30px; line-height: 30px; background-color:#efefef\"><td style=\"padding-left: 10px;\">序号</td><td align=\"center\">产品图片</td><td align=\"center\">产品名称</td><td align=\"center\">购买数量</td><td align=\"center\">产品单价 </td><td align=\"center\">小计</td></tr> ";
                                                sb7.AppendFormat(template, item.ordernumber, item.orderdate, item.deliverydate.ToString("yyyy-MM-dd"), item.contact, item.mobile, item.tel, item.deliveryI, item.deliveryII, item.orderstatestr, item.orderid, item.address, item.allmoney.ToString("f2"), item.paymoney.ToString("f2"));
                                                List<orderinfo> plist = order.getcartlistbyordernumber(item.ordernumber);
                                                for (int k = 0; k < plist.Count; k++)
                                                {
                                                    string ptemplate = "<tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td style=\"padding-left: 10px;\">{0}</td><td align=\"center\" class=\"oimg\"><a href=\"/PInfo/{1}\" target=\"_blank\"><img src=\"/Files/Product/{2}\" /></a></td><td align=\"center\">{3}</td><td align=\"center\">{4}</td><td align=\"center\">{5}</td><td align=\"center\">{6}</td></tr>";
                                                    sb7.AppendFormat(ptemplate, k + 1, plist[k].productid, plist[k].productimg, plist[k].productname, plist[k].buynum, plist[k].vipprice.ToString("f2"), (plist[k].vipprice * plist[k].buynum).ToString("f2"));
                                                }

                                            }
                                            sb7.Append("</table>");
                                            dyHTML = sb7.ToString();
                                            pageHTML = pagehelper.Pager(pdata7.curpageindex, pdata7.pagesize, pdata7.recordcount, PageMode.Numeric, 5);
                                            id7.Style.Value = "background:url(/Images/a.gif) no-repeat 0 -33px;color:White;";
                                            break;

                                        //待处理订单
                                        case "8":
                                            int page8 = 1;
                                            if (Request.QueryString["page"] != null)
                                            {
                                                page8 = TypeParse.DbObjToInt(Request.QueryString["page"].ToString(), 1);
                                            }
                                            pageinfo pdata8 = new pageinfo();
                                            pdata8.curpageindex = page8;
                                            pdata8.pagesize = 100000;
                                            pdata8.where = "a.deliveryIid=c.deliveryIid and a.deliveryIIid=d.deliveryIIid and a.orderstate=44";
                                            pdata8.recordcount = order.getcountbycondition("userorder.orderstate=44");
                                            pdata8.tablename = "userorder a,deliveryI c,deliveryII d";
                                            pdata8.fieldlist = "a.orderid,a.orderstate,a.ordernumber,a.orderdate,a.deliverydate,a.allmoney,a.paymoney,a.contact,a.tel,a.mobile,a.address,c.deliveryI,d.deliveryII";
                                            pdata8.sorttype = 2;
                                            pdata8.primarykey = "orderid";
                                            pdata8.totalpagecount = (pdata8.recordcount % pdata8.pagesize == 0 ? pdata8.recordcount / pdata8.pagesize : pdata8.recordcount / pdata8.pagesize + 1);
                                            if (pdata8.totalpagecount == 0)
                                            {
                                                pdata8.totalpagecount = 1;
                                            }

                                            List<orderinfo> list8 = order.getorderlist(pdata8);
                                            StringBuilder sb8 = new StringBuilder();
                                            sb8.Append(" <h2>待处理订单</h2>");
                                            foreach (orderinfo item in list8)
                                            {
                                                string template = " <table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" class=\"otb\"><tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td colspan=\"8\" style=\"padding-left: 10px;\"><span class=\"fb\">订单编号:{0}</span>&nbsp;&nbsp;下单日期:{1}&nbsp;&nbsp;送货日期:{2}</td></tr><tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td colspan=\"6\" style=\"padding-left: 10px;\">收货人:{3}&nbsp;&nbsp;手机号码:{4}&nbsp;&nbsp;固定电话:{5}&nbsp;&nbsp;大区:{8}&nbsp;&nbsp;小区:{7}&nbsp;&nbsp;订单状态:{8}<span class=\"fr\"><a href=\"javascript:editorder('{9}')\" class=\"cb mr5\">编辑</a></span></td></tr><tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td colspan=\"3\" style=\"padding-left: 10px;\">地址:{10}</td><td colspan=\"2\" align=\"center\">产品总额:¥{11}元</td><td align=\"center\">应付总额:<span class=\"fb red\">¥{12}元</span></td></tr><tr style=\"height: 30px; line-height: 30px; background-color:#efefef\"><td style=\"padding-left: 10px;\">序号</td><td align=\"center\">产品图片</td><td align=\"center\">产品名称</td><td align=\"center\">购买数量</td><td align=\"center\">产品单价 </td><td align=\"center\">小计</td></tr> ";
                                                sb8.AppendFormat(template, item.ordernumber, item.orderdate, item.deliverydate.ToString("yyyy-MM-dd"), item.contact, item.mobile, item.tel, item.deliveryI, item.deliveryII, item.orderstatestr, item.orderid, item.address, item.allmoney.ToString("f2"), item.paymoney.ToString("f2"));
                                                List<orderinfo> plist = order.getcartlistbyordernumber(item.ordernumber);
                                                for (int k = 0; k < plist.Count; k++)
                                                {
                                                    string ptemplate = "<tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td style=\"padding-left: 10px;\">{0}</td><td align=\"center\" class=\"oimg\"><a href=\"/PInfo/{1}\" target=\"_blank\"><img src=\"/Files/Product/{2}\" /></a></td><td align=\"center\">{3}</td><td align=\"center\">{4}</td><td align=\"center\">{5}</td><td align=\"center\">{6}</td></tr>";
                                                    sb8.AppendFormat(ptemplate, k + 1, plist[k].productid, plist[k].productimg, plist[k].productname, plist[k].buynum, plist[k].vipprice.ToString("f2"), (plist[k].vipprice * plist[k].buynum).ToString("f2"));
                                                }

                                            }
                                            sb8.Append("</table>");
                                            dyHTML = sb8.ToString();
                                            pageHTML = pagehelper.Pager(pdata8.curpageindex, pdata8.pagesize, pdata8.recordcount, PageMode.Numeric, 5);
                                            id8.Style.Value = "background:url(/Images/a.gif) no-repeat 0 -33px;color:White;";
                                            break;
                                        default:
                                            break;

                                        #endregion
                                    }
                                }
                                break;

                            //第二列搜索 搜索订单
                            case "2":
                                int page_2 = 1;
                                if (Request.QueryString["page"] != null)
                                {
                                    page_2 = TypeParse.DbObjToInt(Request.QueryString["page"].ToString(), 1);
                                }
                                pageinfo pdata_2 = new pageinfo();
                                pdata_2.curpageindex = page_2;
                                pdata_2.pagesize = 100000;
                                string searctxt="";
                                string conditionstr1 = "a.deliveryIid=c.deliveryIid and a.deliveryIIid=d.deliveryIIid ";
                                string conditionstr="";
                                if (Request.QueryString["od1"] != null && Request.QueryString["od1"] != "" && Request.QueryString["od2"] != null && Request.QueryString["od2"] != "")
                                {
                                    DateTime od1date=TypeParse.DbObjToDateTime(Request.QueryString["od1"].ToString()+" 00:00:00",DateTime.Now);
                                    DateTime od2date = TypeParse.DbObjToDateTime(Request.QueryString["od2"].ToString() + " 23:59:59", DateTime.Now);
                                    conditionstr += " and a.orderdate>='"+od1date+"' and a.orderdate<='"+od2date+"'";
                                    searctxt += "开始日期:" + od1date.ToString() + ",结束日期:" + od2date.ToString();
                                }
                                if (Request.QueryString["ostateid"] != null && Request.QueryString["ostateid"] != "" && Request.QueryString["ostateid"] != "1000")
                                {
                                    int state = TypeParse.DbObjToInt(Request.QueryString["ostateid"], 0);
                                    conditionstr += " and a.orderstate=" + state;
                                    if (state == 0)
                                    {
                                        searctxt += "进行中订单";
                                    }
                                    if (state == 10)
                                    {
                                        searctxt += "已完成订单";
                                    }
                                    if (state == 44)
                                    {
                                        searctxt += "待处理订单";
                                    }
                                }
                                if (Request.QueryString["odIid"] != null && Request.QueryString["odIid"] != "" && Request.QueryString["odIid"] != "0")
                                {
                                    int odIid = TypeParse.DbObjToInt(Request.QueryString["odIid"], 0);
                                    conditionstr += " and a.deliveryIid=" + odIid;
                                    categoryinfo citem = category.getdeliveryIinfo(odIid);
                                    searctxt += "大区:" + citem.deliveryI;
                                }
                                if (Request.QueryString["odIIid"] != null && Request.QueryString["odIIid"] != "" && Request.QueryString["odIIid"] != "0")
                                {
                                    int odIIid = TypeParse.DbObjToInt(Request.QueryString["odIIid"], 0);
                                    conditionstr += " and a.deliveryIIid=" + odIIid;
                                    categoryinfo citem = category.getdeliveryIIinfo(odIIid);
                                    searctxt += "小区:" + citem.deliveryII;
                                }

                                pdata_2.where = conditionstr1 + conditionstr;
                                pdata_2.recordcount = order.getcountbycondition("");
                                pdata_2.tablename = "userorder a,deliveryI c,deliveryII d";
                                pdata_2.fieldlist = "a.orderid,a.orderstate,a.ordernumber,a.orderdate,a.deliverydate,a.allmoney,a.paymoney,a.contact,a.tel,a.mobile,a.address,c.deliveryI,d.deliveryII";
                                pdata_2.sorttype = 2;
                                pdata_2.primarykey = "orderid";
                                pdata_2.totalpagecount = (pdata_2.recordcount % pdata_2.pagesize == 0 ? pdata_2.recordcount / pdata_2.pagesize : pdata_2.recordcount / pdata_2.pagesize + 1);
                                if (pdata_2.totalpagecount == 0)
                                {
                                    pdata_2.totalpagecount = 1;
                                }

                                List<orderinfo> list_2 = order.getorderlist(pdata_2);
                                StringBuilder sb_2 = new StringBuilder();
                                sb_2.Append(" <h2>下单日期查询:("+searctxt+")</h2>");
                                foreach (orderinfo item in list_2)
                                {
                                    string template = " <table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" class=\"otb\"><tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td colspan=\"6\" style=\"padding-left: 10px;\"><span class=\"fb\">订单编号:{0}</span>&nbsp;&nbsp;下单日期:{1}&nbsp;&nbsp;送货日期:{2}</td></tr><tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td colspan=\"6\" style=\"padding-left: 10px;\">收货人:{3}&nbsp;&nbsp;手机号码:{4}&nbsp;&nbsp;固定电话:{5}&nbsp;&nbsp;大区:{6}&nbsp;&nbsp;小区:{7}&nbsp;&nbsp;订单状态:{8}<span class=\"fr\"><a href=\"javascript:editorder('{9}')\" class=\"cb mr5\">编辑</a></span></td></tr><tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td colspan=\"3\" style=\"padding-left: 10px;\">地址:{10}</td><td colspan=\"2\" align=\"center\">产品总额:¥{11}元</td><td align=\"center\">应付总额:<span class=\"fb red\">¥{12}元</span></td></tr><tr style=\"height: 30px; line-height: 30px; background-color:#efefef\"><td style=\"padding-left: 10px;\">序号</td><td align=\"center\">产品图片</td><td align=\"center\">产品名称</td><td align=\"center\">购买数量</td><td align=\"center\">产品单价 </td><td align=\"center\">小计</td></tr> ";
                                    sb_2.AppendFormat(template, item.ordernumber, item.orderdate, item.deliverydate.ToString("yyyy-MM-dd"), item.contact, item.mobile, item.tel, item.deliveryI, item.deliveryII, item.orderstatestr, item.orderid, item.address, item.allmoney.ToString("f2"), item.paymoney.ToString("f2"));
                                    List<orderinfo> plist = order.getcartlistbyordernumber(item.ordernumber);
                                    for (int k = 0; k < plist.Count; k++)
                                    {
                                        string ptemplate = "<tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td style=\"padding-left: 10px;\">{0}</td><td align=\"center\" class=\"oimg\"><a href=\"/PInfo/{1}\" target=\"_blank\"><img src=\"/Files/Product/{2}\" /></a></td><td align=\"center\">{3}</td><td align=\"center\">{4}</td><td align=\"center\">{5}</td><td align=\"center\">{6}</td></tr>";
                                        sb_2.AppendFormat(ptemplate, k + 1, plist[k].productid, plist[k].productimg, plist[k].productname, plist[k].buynum, plist[k].vipprice.ToString("f2"), (plist[k].vipprice * plist[k].buynum).ToString("f2"));
                                    }

                                }
                                sb_2.Append("</table>");
                                dyHTML = sb_2.ToString();
                                break;

                            //第三列搜索 搜索订单-配货日期
                            case "3":
                                int page_3 = 1;
                                if (Request.QueryString["page"] != null)
                                {
                                    page_3 = TypeParse.DbObjToInt(Request.QueryString["page"].ToString(), 1);
                                }
                                pageinfo pdata_3 = new pageinfo();
                                pdata_3.curpageindex = page_3;
                                pdata_3.pagesize = 100000;
                                string searctxt_3 = "";
                                string conditionstr1_3 = "a.deliveryIid=c.deliveryIid and a.deliveryIIid=d.deliveryIIid ";
                                string conditionstr_3 = "";
                                if (Request.QueryString["pod1"] != null && Request.QueryString["pod1"] != "" && Request.QueryString["pod2"] != null && Request.QueryString["pod2"] != "")
                                {
                                    DateTime od1date = TypeParse.DbObjToDateTime(Request.QueryString["pod1"].ToString() + " 00:00:00", DateTime.Now);
                                    DateTime od2date = TypeParse.DbObjToDateTime(Request.QueryString["pod2"].ToString() + " 23:59:59", DateTime.Now);
                                    conditionstr_3 += " and a.deliverydate>='" + od1date + "' and a.deliverydate<='" + od2date+"'";
                                    searctxt_3 += "开始日期:" + od1date.ToString() + ",结束日期:" + od2date.ToString();
                                }
                                if (Request.QueryString["postateid"] != null && Request.QueryString["postateid"] != "" && Request.QueryString["postateid"] != "1000")
                                {
                                    int state = TypeParse.DbObjToInt(Request.QueryString["postateid"], 0);
                                    conditionstr_3 += " and a.orderstate=" + state;
                                    if (state == 0)
                                    {
                                        searctxt_3 += "进行中订单";
                                    }
                                    if (state == 10)
                                    {
                                        searctxt_3 += "已完成订单";
                                    }
                                    if (state == 44)
                                    {
                                        searctxt_3 += "待处理订单";
                                    }
                                }
                                if (Request.QueryString["podIid"] != null && Request.QueryString["podIid"] != "" && Request.QueryString["podIid"] != "0")
                                {
                                    int odIid = TypeParse.DbObjToInt(Request.QueryString["podIid"], 0);
                                    conditionstr_3 += " and a.deliveryIid=" + odIid;
                                    categoryinfo citem = category.getdeliveryIinfo(odIid);
                                    searctxt_3 += "大区:" + citem.deliveryI;
                                }
                                if (Request.QueryString["podIIid"] != null && Request.QueryString["podIIid"] != "" && Request.QueryString["podIIid"] != "0")
                                {
                                    int odIIid = TypeParse.DbObjToInt(Request.QueryString["podIIid"], 0);
                                    conditionstr_3 += " and a.deliveryIIid=" + odIIid;
                                    categoryinfo citem = category.getdeliveryIIinfo(odIIid);
                                    searctxt_3 += "小区:" + citem.deliveryII;
                                }

                                pdata_3.where = conditionstr1_3 + conditionstr_3;
                                pdata_3.recordcount = order.getcountbycondition("");
                                pdata_3.tablename = "userorder a,deliveryI c,deliveryII d";
                                pdata_3.fieldlist = "a.orderid,a.orderstate,a.ordernumber,a.orderdate,a.deliverydate,a.allmoney,a.paymoney,a.contact,a.tel,a.mobile,a.address,c.deliveryI,d.deliveryII";
                                pdata_3.sorttype = 2;
                                pdata_3.primarykey = "orderid";
                                pdata_3.totalpagecount = (pdata_3.recordcount % pdata_3.pagesize == 0 ? pdata_3.recordcount / pdata_3.pagesize : pdata_3.recordcount / pdata_3.pagesize + 1);
                                if (pdata_3.totalpagecount == 0)
                                {
                                    pdata_3.totalpagecount = 1;
                                }

                                List<orderinfo> list_3 = order.getorderlist(pdata_3);
                                StringBuilder sb_3 = new StringBuilder();
                                sb_3.Append(" <h2>送货日期查询:(" + searctxt_3 + ")</h2>");
                                foreach (orderinfo item in list_3)
                                {
                                    string template = " <table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" class=\"otb\"><tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td colspan=\"6\" style=\"padding-left: 10px;\"><span class=\"fb\">订单编号:{0}</span>&nbsp;&nbsp;下单日期:{1}&nbsp;&nbsp;送货日期:{2}</td></tr><tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td colspan=\"6\" style=\"padding-left: 10px;\">收货人:{3}&nbsp;&nbsp;手机号码:{4}&nbsp;&nbsp;固定电话:{5}&nbsp;&nbsp;大区:{6}&nbsp;&nbsp;小区:{7}&nbsp;&nbsp;订单状态:{8}<span class=\"fr\"><a href=\"javascript:editorder('{9}')\" class=\"cb mr5\">编辑</a></span></td></tr><tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td colspan=\"3\" style=\"padding-left: 10px;\">地址:{10}</td><td colspan=\"2\" align=\"center\">产品总额:¥{11}元</td><td align=\"center\">应付总额:<span class=\"fb red\">¥{12}元</span></td></tr><tr style=\"height: 30px; line-height: 30px; background-color:#efefef\"><td style=\"padding-left: 10px;\">序号</td><td align=\"center\">产品图片</td><td align=\"center\">产品名称</td><td align=\"center\">购买数量</td><td align=\"center\">产品单价 </td><td align=\"center\">小计</td></tr> ";
                                    sb_3.AppendFormat(template, item.ordernumber, item.orderdate, item.deliverydate.ToString("yyyy-MM-dd"), item.contact, item.mobile, item.tel, item.deliveryI, item.deliveryII, item.orderstatestr, item.orderid, item.address, item.allmoney.ToString("f2"), item.paymoney.ToString("f2"));
                                    List<orderinfo> plist = order.getcartlistbyordernumber(item.ordernumber);
                                    for (int k = 0; k < plist.Count; k++)
                                    {
                                        string ptemplate = "<tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td style=\"padding-left: 10px;\">{0}</td><td align=\"center\" class=\"oimg\"><a href=\"/PInfo/{1}\" target=\"_blank\"><img src=\"/Files/Product/{2}\" /></a></td><td align=\"center\">{3}</td><td align=\"center\">{4}</td><td align=\"center\">{5}</td><td align=\"center\">{6}</td></tr>";
                                        sb_3.AppendFormat(ptemplate, k + 1, plist[k].productid, plist[k].productimg, plist[k].productname, plist[k].buynum, plist[k].vipprice.ToString("f2"), (plist[k].vipprice * plist[k].buynum).ToString("f2"));
                                    }

                                }
                                sb_3.Append("</table>");
                                dyHTML = sb_3.ToString();
                                break;

                            //第三列搜索  配货总量
                            case "8":
                                 string searctxt_8="";
                                 string conditionstr_8 = " and userorder.orderstate=0  ";
                                 if (Request.QueryString["phod1"] != null && Request.QueryString["phod1"] != "" && Request.QueryString["phod2"] != null && Request.QueryString["phod2"] != "")
                                {
                                    DateTime od1date=TypeParse.DbObjToDateTime(Request.QueryString["od1"].ToString()+" 00:00:00",DateTime.Now);
                                    DateTime od2date = TypeParse.DbObjToDateTime(Request.QueryString["od2"].ToString() + " 23:59:59", DateTime.Now);
                                    conditionstr_8 += " and userorder.orderdate>='" + od1date + "' and userorder.orderdate<='" + od2date+"'";
                                    searctxt_8 += "开始日期:" + od1date.ToString() + ",结束日期:" + od2date.ToString();
                                }
                                 if (Request.QueryString["phostateid"] != null && Request.QueryString["phostateid"] != "" && Request.QueryString["phostateid"] != "1000")
                                {
                                    int state = TypeParse.DbObjToInt(Request.QueryString["phostateid"], 0);
                                    conditionstr_8 += " and userorder.orderstate=" + state;
                                    if (state == 0)
                                    {
                                        searctxt_8 += "进行中订单";
                                    }
                                    if (state == 10)
                                    {
                                        searctxt_8 += "已完成订单";
                                    }
                                    if (state == 44)
                                    {
                                        searctxt_8 += "待处理订单";
                                    }
                                }
                                 if (Request.QueryString["phodIid"] != null && Request.QueryString["phodIid"] != "" && Request.QueryString["phodIid"] != "0")
                                {
                                    int odIid = TypeParse.DbObjToInt(Request.QueryString["phodIid"], 0);
                                    conditionstr_8 += " and userorder.deliveryIid=" + odIid;
                                    categoryinfo citem = category.getdeliveryIinfo(odIid);
                                    searctxt_8 += "大区:" + citem.deliveryI;
                                }
                                 if (Request.QueryString["phodIIid"] != null && Request.QueryString["phodIIid"] != "" && Request.QueryString["phodIIid"] != "0")
                                {
                                    int odIIid = TypeParse.DbObjToInt(Request.QueryString["phodIIid"], 0);
                                    conditionstr_8 += " and userorder.deliveryIIid=" + odIIid;
                                    categoryinfo citem = category.getdeliveryIIinfo(odIIid);
                                    searctxt_8 += "小区:" + citem.deliveryII;
                                }

                                List<orderinfo> polist = order.getphlist(conditionstr_8);
                                dysb.Append(" <h2>配货总量:(" + searctxt_8 + ")</h2>");
                                dysb.Append(" <table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" class=\"otb\"><tr style=\"height: 30px; line-height: 30px; background-color:#efefef\"><td align=\"center\">产品编号</td><td align=\"center\">产品名称</td> <td align=\"center\">产品图片</td><td align=\"center\">配货数量</td></tr>");
                                foreach (orderinfo item in polist)
                                {
                                    string template = "<tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td align=\"center\">{0}</td><td align=\"center\" class=\"oimg\"><img src=\"/Files/Product/{1}\" /></td><td align=\"center\">{2}</td><td align=\"center\"><span class=\"fb\">{3}</span></td></tr>";
                                    dysb.AppendFormat(template, item.productcode, item.productimg, item.productname, item.tjbuynum);
                                }
                                dysb.Append("</table>");

                                dyHTML = dysb.ToString();
                                break;

                            //根据订单号搜索
                            case "4":
                                int page_4 = 1;
                                if (Request.QueryString["page"] != null)
                                {
                                    page_4 = TypeParse.DbObjToInt(Request.QueryString["page"].ToString(), 1);
                                }
                                pageinfo pdata_4 = new pageinfo();
                                pdata_4.curpageindex = page_4;
                                pdata_4.pagesize = 100000;
                                string ordernumber = "";
                                if (Request.QueryString["ordernumber"] != null)
                                {
                                    ordernumber =HttpUtility.UrlDecode(Request.QueryString["ordernumber"].ToString());
                                }

                                pdata_4.where = "a.deliveryIid=c.deliveryIid and a.deliveryIIid=d.deliveryIIid and a.ordernumber='" + ordernumber + "'";
                                pdata_4.recordcount = order.getcountbycondition("userorder.ordernumber='" + ordernumber + "'");
                                pdata_4.tablename = "userorder a,deliveryI c,deliveryII d";
                                pdata_4.fieldlist = "a.orderid,a.orderstate,a.ordernumber,a.orderdate,a.deliverydate,a.allmoney,a.paymoney,a.contact,a.tel,a.mobile,a.address,c.deliveryI,d.deliveryII";
                                pdata_4.sorttype = 2;
                                pdata_4.primarykey = "orderid";
                                pdata_4.totalpagecount = (pdata_4.recordcount % pdata_4.pagesize == 0 ? pdata_4.recordcount / pdata_4.pagesize : pdata_4.recordcount / pdata_4.pagesize + 1);
                                if (pdata_4.totalpagecount == 0)
                                {
                                    pdata_4.totalpagecount = 1;
                                }

                                List<orderinfo> list_4 = order.getorderlist(pdata_4);
                                StringBuilder sb_4 = new StringBuilder();
                                sb_4.Append(" <h2>订单编号:(" + ordernumber + ")查询订单结果</h2>");
                                foreach (orderinfo item in list_4)
                                {
                                    string template = " <table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" class=\"otb\"><tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td colspan=\"6\" style=\"padding-left: 10px;\"><span class=\"fb\">订单编号:{0}</span>&nbsp;&nbsp;下单日期:{1}&nbsp;&nbsp;送货日期:{2}</td></tr><tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td colspan=\"6\" style=\"padding-left: 10px;\">收货人:{3}&nbsp;&nbsp;手机号码:{4}&nbsp;&nbsp;固定电话:{5}&nbsp;&nbsp;大区:{6}&nbsp;&nbsp;小区:{7}&nbsp;&nbsp;订单状态:{8}<span class=\"fr\"><a href=\"javascript:editorder('{9}')\" class=\"cb mr5\">编辑</a></span></td></tr><tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td colspan=\"3\" style=\"padding-left: 10px;\">地址:{10}</td><td colspan=\"2\" align=\"center\">产品总额:¥{11}元</td><td align=\"center\">应付总额:<span class=\"fb red\">¥{12}元</span></td></tr><tr style=\"height: 30px; line-height: 30px; background-color:#efefef\"><td style=\"padding-left: 10px;\">序号</td><td align=\"center\">产品图片</td><td align=\"center\">产品名称</td><td align=\"center\">购买数量</td><td align=\"center\">产品单价 </td><td align=\"center\">小计</td></tr> ";
                                    sb_4.AppendFormat(template, item.ordernumber, item.orderdate, item.deliverydate.ToString("yyyy-MM-dd"), item.contact, item.mobile, item.tel, item.deliveryI, item.deliveryII, item.orderstatestr, item.orderid, item.address, item.allmoney.ToString("f2"), item.paymoney.ToString("f2"));
                                    List<orderinfo> plist = order.getcartlistbyordernumber(item.ordernumber);
                                    for (int k = 0; k < plist.Count; k++)
                                    {
                                        string ptemplate = "<tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td style=\"padding-left: 10px;\">{0}</td><td align=\"center\" class=\"oimg\"><a href=\"/PInfo/{1}\" target=\"_blank\"><img src=\"/Files/Product/{2}\" /></a></td><td align=\"center\">{3}</td><td align=\"center\">{4}</td><td align=\"center\">{5}</td><td align=\"center\">{6}</td></tr>";
                                        sb_4.AppendFormat(ptemplate, k + 1, plist[k].productid, plist[k].productimg, plist[k].productname, plist[k].buynum, plist[k].vipprice.ToString("f2"), (plist[k].vipprice * plist[k].buynum).ToString("f2"));
                                    }

                                }
                                sb_4.Append("</table>");
                                dyHTML = sb_4.ToString();
                                break;

                            //根据订单号搜索
                            case "5":
                                int page_5 = 1;
                                if (Request.QueryString["page"] != null)
                                {
                                    page_5 = TypeParse.DbObjToInt(Request.QueryString["page"].ToString(), 1);
                                }
                                pageinfo pdata_5 = new pageinfo();
                                pdata_5.curpageindex = page_5;
                                pdata_5.pagesize = 100000;
                                string contact = "";
                                if (Request.QueryString["contact"] != null)
                                {
                                    contact = HttpUtility.UrlDecode(Request.QueryString["contact"].ToString());
                                }

                                pdata_5.where = "a.deliveryIid=c.deliveryIid and a.deliveryIIid=d.deliveryIIid and a.contact like '%" + contact + "%'";
                                pdata_5.recordcount = order.getcountbycondition("userorder.ordernumber like '%" + contact + "%'");
                                pdata_5.tablename = "userorder a,deliveryI c,deliveryII d";
                                pdata_5.fieldlist = "a.orderid,a.orderstate,a.ordernumber,a.orderdate,a.deliverydate,a.allmoney,a.paymoney,a.contact,a.tel,a.mobile,a.address,c.deliveryI,d.deliveryII";
                                pdata_5.sorttype = 2;
                                pdata_5.primarykey = "orderid";
                                pdata_5.totalpagecount = (pdata_5.recordcount % pdata_5.pagesize == 0 ? pdata_5.recordcount / pdata_5.pagesize : pdata_5.recordcount / pdata_5.pagesize + 1);
                                if (pdata_5.totalpagecount == 0)
                                {
                                    pdata_5.totalpagecount = 1;
                                }

                                List<orderinfo> list_5 = order.getorderlist(pdata_5);
                                StringBuilder sb_5 = new StringBuilder();
                                sb_5.Append(" <h2>收货人:(" + contact + ")查询订单结果</h2>");
                                foreach (orderinfo item in list_5)
                                {
                                    string template = " <table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" class=\"otb\"><tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td colspan=\"6\" style=\"padding-left: 10px;\"><span class=\"fb\">订单编号:{0}</span>&nbsp;&nbsp;下单日期:{1}&nbsp;&nbsp;送货日期:{2}</td></tr><tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td colspan=\"6\" style=\"padding-left: 10px;\">收货人:{3}&nbsp;&nbsp;手机号码:{4}&nbsp;&nbsp;固定电话:{5}&nbsp;&nbsp;大区:{6}&nbsp;&nbsp;小区:{7}&nbsp;&nbsp;订单状态:{8}<span class=\"fr\"><a href=\"javascript:editorder('{9}')\" class=\"cb mr5\">编辑</a></span></td></tr><tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td colspan=\"3\" style=\"padding-left: 10px;\">地址:{10}</td><td colspan=\"2\" align=\"center\">产品总额:¥{11}元</td><td align=\"center\">应付总额:<span class=\"fb red\">¥{12}元</span></td></tr><tr style=\"height: 30px; line-height: 30px; background-color:#efefef\"><td style=\"padding-left: 10px;\">序号</td><td align=\"center\">产品图片</td><td align=\"center\">产品名称</td><td align=\"center\">购买数量</td><td align=\"center\">产品单价 </td><td align=\"center\">小计</td></tr> ";
                                    sb_5.AppendFormat(template, item.ordernumber, item.orderdate, item.deliverydate.ToString("yyyy-MM-dd"), item.contact, item.mobile, item.tel, item.deliveryI, item.deliveryII, item.orderstatestr, item.orderid, item.address, item.allmoney.ToString("f2"), item.paymoney.ToString("f2"));
                                    List<orderinfo> plist = order.getcartlistbyordernumber(item.ordernumber);
                                    for (int k = 0; k < plist.Count; k++)
                                    {
                                        string ptemplate = "<tr style=\"height: 30px; line-height: 30px; background-color:#fff\"><td style=\"padding-left: 10px;\">{0}</td><td align=\"center\" class=\"oimg\"><a href=\"/PInfo/{1}\" target=\"_blank\"><img src=\"/Files/Product/{2}\" /></a></td><td align=\"center\">{3}</td><td align=\"center\">{4}</td><td align=\"center\">{5}</td><td align=\"center\">{6}</td></tr>";
                                        sb_5.AppendFormat(ptemplate, k + 1, plist[k].productid, plist[k].productimg, plist[k].productname, plist[k].buynum, plist[k].vipprice.ToString("f2"), (plist[k].vipprice * plist[k].buynum).ToString("f2"));
                                    }

                                }
                                sb_5.Append("</table>");
                                dyHTML = sb_5.ToString();
                                break;

                            default:
                                break;
                        }
                    }
                }
                else
                {
                    Response.Redirect("/Log");
                }

            }
        }
Exemple #12
0
 /// <summary>
 /// 得到产品
 /// </summary>
 /// <param name="pdata"></param>
 /// <returns></returns>
 public static List<productinfo> getproduct(pageinfo pdata)
 {
     List<productinfo> list = new List<productinfo>();
     try
     {
         DataTable dt = pagehelper.getpagedt(pdata);
         if (dt != null)
         {
             foreach (DataRow dr in dt.Rows)
             {
                 productinfo item = new productinfo();
                 item.productid = TypeParse.DbObjToInt(dr["productid"].ToString(), 0);
                 item.productname = TypeParse.DbObjToString(dr["productname"].ToString(), "");
                 item.vipprice =Convert.ToDecimal(TypeParse.DbObjToString(dr["vipprice"].ToString(),"100.00"));
                 item.productprice = Convert.ToDecimal(TypeParse.DbObjToString(dr["productprice"].ToString(), "100.00"));
                 item.productcode = TypeParse.DbObjToString(dr["productcode"].ToString(), "");
                 item.productbrief = TypeParse.DbObjToString(dr["productbrief"].ToString(), "");
                 item.productintroduce = TypeParse.DbObjToString(dr["productintroduce"].ToString(), "");
                 item.productimg = TypeParse.DbObjToString(dr["productimg"].ToString(), "");
                 item.smallcategoryid = TypeParse.DbObjToInt(dr["smallcategoryid"].ToString(), 0);
                 item.bigcategoryid = TypeParse.DbObjToInt(dr["bigcategoryid"].ToString(), 0);
                 item.smallcategory = TypeParse.DbObjToString(dr["smallcategory"].ToString(), "");
                 item.bigcategory = TypeParse.DbObjToString(dr["bigcategory"].ToString(), "");
                 item.brand = TypeParse.DbObjToString(dr["brand"].ToString(), "");
                 item.punit = TypeParse.DbObjToString(dr["punit"].ToString(), "");
                 item.adddate = TypeParse.DbObjToDateTime(dr["adddate"], DateTime.Now);
                 item.editdate = TypeParse.DbObjToDateTime(dr["editdate"], DateTime.Now);
                 item.salestate = TypeParse.DbObjToInt(dr["salestate"].ToString(), 0);
                 item.placeid = TypeParse.DbObjToInt(dr["placeid"].ToString(), 0);
                 item.place = TypeParse.DbObjToString(dr["place"].ToString(), "");
                 list.Add(item);
             }
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
     finally
     {
     }
     return list;
 }
Exemple #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                int allcount = user.getusernumbydate(0);
                int yearcount = user.getusernumbydate(1);
                int monthcount = user.getusernumbydate(2);
                int daycount = user.getusernumbydate(3);
                usertjHTML = "总会员:<span class=\"red\">" + allcount + "</span>个&nbsp;今年注册<span class=\"red\">" + yearcount + "</span>个&nbsp;本月注册<span class=\"red\">" + monthcount + "</span>个&nbsp;今日注册<span  class=\"red\">" + daycount + "</span>个&nbsp;";

                //账号类型
                List<userinfo> alist = user.getaccountstype();
                StringBuilder aselectsb = new StringBuilder();
                aselectsb.Append("<select id=\"atselect\" style=\"width:100px; border:solid 1px #cacaca; height:20px;z-index:100;\">");
                foreach (userinfo item in alist)
                {
                    string template = "<option value=\"{0}\">{1}</option>";
                    aselectsb.AppendFormat(template, item.atid, item.accountstype);
                }
                aselectsb.Append("</select>");
                atHTML = aselectsb.ToString();

                pageinfo pdata = new pageinfo();
                int page;
                if (Request.QueryString["page"] != null)
                {
                    page = TypeParse.DbObjToInt(Request.QueryString["page"].ToString(), 1);
                }
                else
                {
                    page = 1;
                }

                pdata.curpageindex = page;
                pdata.pagesize = 10;
                if (Request.QueryString["uinfo"] != null)
                {
                    string uinfo = HttpUtility.UrlDecode(Request.QueryString["uinfo"].ToString());
                    pdata.where = "userinfo.atid=accountstype.atid and ( userinfo.accounts like'%"+uinfo+"%' or userinfo.email like '%"+uinfo+"%')";
                }
                else if (Request.QueryString["atid"] != null)
                {
                    pdata.where = "userinfo.atid=accountstype.atid and userinfo.atid="+Request.QueryString["atid"].ToString();
                }
                else
                {
                    pdata.where = "userinfo.atid=accountstype.atid";
                }
                pdata.recordcount = allcount;
                pdata.tablename = "userinfo,accountstype";
                pdata.fieldlist = "userinfo.userid,userinfo.accounts,userinfo.email,userinfo.tel,userinfo.truename,userinfo.qq,userinfo.atid,userinfo.headerimg,userinfo.address,userinfo.mobile,userinfo.company,userinfo.adddate,accountstype.accountstype";
                pdata.sorttype = 2;
                pdata.primarykey = "userid";
                pdata.totalpagecount = (pdata.recordcount % pdata.pagesize == 0 ? pdata.recordcount / pdata.pagesize : pdata.recordcount / pdata.pagesize + 1);
                if (pdata.totalpagecount == 0)
                {
                    pdata.totalpagecount = 1;
                }

                List<userinfo> userlist = user.getUserList(pdata);

                StringBuilder sb = new StringBuilder();
                foreach (userinfo item in userlist)
                {
                    string template = "<tr><td height=\"20\" bgcolor=\"#FFFFFF\"><div align=\"center\" >{0}</div></td><td height=\"20\" bgcolor=\"#FFFFFF\"><div align=\"center\">{1}</div></td><td height=\"20\" bgcolor=\"#FFFFFF\"><div align=\"center\">{2}</div></td><td height=\"20\" bgcolor=\"#FFFFFF\"><div align=\"center\">{3}</div></td><td height=\"20\" bgcolor=\"#FFFFFF\"><div align=\"center\">{4}</div></td><td height=\"20\" bgcolor=\"#FFFFFF\"><div align=\"center\">{5}</div></td><td height=\"20\" bgcolor=\"#FFFFFF\"><div align=\"left\" style=\"padding:0 0 0 2px;\">{6}</div></td><td height=\"20\" bgcolor=\"#FFFFFF\"><div align=\"center\">{7}</div></td><td height=\"20\" bgcolor=\"#FFFFFF\"><div align=\"center\"><a href=\"javascript:edituser('{8}')\" style=\"color:blue;cursor:pointer;\">编辑</a> | <a href=\"javascript:deluser('{9}','{10}')\" style=\"color:blue;cursor:pointer;\">删除</a></div></td></tr>";
                    sb.AppendFormat(template, item.adddate, item.email, item.accounts, item.truename, item.tel, item.mobile, item.company, item.accountstype, item.userid,item.userid, pdata.curpageindex);
                }
                userlistHTML = sb.ToString();
                pageHTML = pagehelper.Pager(pdata.curpageindex, pdata.pagesize, pdata.recordcount, PageMode.Numeric, 5);
            }
        }
Exemple #14
0
 /// <summary>
 /// 得到送货地址
 /// </summary>
 /// <param name="pdata"></param>
 /// <returns></returns>
 public static List<addressinfo> getaddress(pageinfo pdata)
 {
     List<addressinfo> list = new List<addressinfo>();
     try
     {
         DataTable dt = pagehelper.getpagedt(pdata);
         if (dt != null)
         {
             foreach (DataRow dr in dt.Rows)
             {
                 addressinfo item = new addressinfo();
                 item.addressid = TypeParse.DbObjToInt(dr["addressid"].ToString(), 0);
                 item.address = TypeParse.DbObjToString(dr["address"].ToString(), "");
                 item.contact = TypeParse.DbObjToString(dr["contact"].ToString(), "");
                 item.mobile = TypeParse.DbObjToString(dr["mobile"].ToString(), "");
                 item.tel = TypeParse.DbObjToString(dr["tel"].ToString(), "");
                 item.userid = TypeParse.DbObjToString(dr["userid"].ToString(), "");
                 item.deliveryIid = TypeParse.DbObjToInt(dr["deliveryIid"].ToString(), 0);
                 item.deliveryIIid = TypeParse.DbObjToInt(dr["deliveryIIid"].ToString(), 0);
                 item.isdefault = TypeParse.DbObjToInt(dr["isdefault"].ToString(), 0);
                 list.Add(item);
             }
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
     finally
     {
     }
     return list;
 }
Exemple #15
0
 //得到网站内容列表
 public static List<websitetypeinfo> getwebsite(pageinfo pdata)
 {
     List<websitetypeinfo> list = new List<websitetypeinfo>();
     try
     {
         DataTable dt = pagehelper.getpagedt(pdata);
         if (dt != null)
         {
             foreach (DataRow dr in dt.Rows)
             {
                 websitetypeinfo item = new websitetypeinfo();
                 item.wsid = TypeParse.DbObjToInt(dr["wsid"].ToString(), 0);
                 item.wtid = TypeParse.DbObjToInt(dr["wtid"].ToString(), 0);
                 item.websitetype = TypeParse.DbObjToString(dr["websitetype"].ToString(), "");
                 item.websitecontent = TypeParse.DbObjToString(dr["websitecontent"].ToString(), "");
                 list.Add(item);
             }
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
     finally
     {
     }
     return list;
 }