//获取数据 protected string getData() { currentPage = Convert.ToInt32(Request["page"]); if (currentPage == 0) { currentPage = 1; } string bookIsbn = Request["bookIsbn"]; string bookName = Request["bookName"]; string supplier = Request["supplier"]; string time = Request["time"]; string userName = Request["userName"]; string userregion = Request["userregion"]; string resource = Request["resource"]; User user = (User)Session["user"]; int regionId = user.ReginId.RegionId; string tjType = Request["type"]; string where = ""; int type = 0; if (tjType == "CK") { type = 0; } if (tjType == "RK") { type = 1; } if (tjType == "TH") { type = 2; } if ((bookIsbn == "" || bookIsbn == null) && (bookName == "" || bookName == null) && (supplier == "" || supplier == null) && (time == "" || time == null) && (userName == "" || userName == null) && (userregion == "" || userregion == null) && (resource == "" || resource == null)) { string tjRegion = Request["region"]; string tjuserName = Request["userName"]; string tjHeadId = Request["singleHeadId"]; string tjtime = Request["time"]; if (tjRegion != "null" && tjRegion != "" && tjRegion != null) { where += " and regionName='" + tjRegion + "'"; } if (tjuserName != "null" && tjuserName != "" && tjuserName != null) { where += " and userName='******'"; } if (tjHeadId != "null" && tjHeadId != "" && tjHeadId != null) { where += " and singleHeadId='" + tjHeadId + "'"; } if (tjtime != "null" && tjtime != "" && tjtime != null) { string[] sArray = tjtime.Split('至'); string startTime = sArray[0]; string endTime = sArray[1]; where += " and time BETWEEN '" + startTime + "' and '" + endTime + "'"; } } else { if (bookIsbn != null && bookIsbn != "") { where += " and isbn='" + bookIsbn + "'"; } if (bookName != null && bookName != "") { where += " and bookName like '%" + bookName + "%'"; } if (supplier != null && supplier != "") { where += " and supplier='" + supplier + "'"; } if (time != null && time != "") { string[] sArray = time.Split('至'); string startTime = sArray[0]; string endTime = sArray[1]; where += " and time BETWEEN '" + startTime + "' and '" + endTime + "'"; } //if (time != null && time != "") //{ // where += " and time like '" + time + "%'"; //} if (userName != null && userName != "") { where += " and userName='******'"; } if (userregion != null && userregion != "") { where += " and userRegion='" + userregion + "'"; } if (resource != null && resource != "") { where += " and regionName='" + resource + "'"; } currentPage = Convert.ToInt32(Request["page"]); if (currentPage == 0) { currentPage = 1; } } string userId = user.UserId; TableBuilder tbd = new TableBuilder(); tbd.StrTable = "v_stockstatistics"; tbd.OrderBy = "id"; if (isAdmin) { tbd.StrColumnlist = "id,type,userName,bookName,ISBN,bookNum,sum(number) as number,sum(totalPrice) as totalPrice ,sum(realPrice) as realPrice,regionName,supplier,time,userRegion"; tbd.StrWhere = "type=" + type + where + " group by userName,bookName,ISBN,bookNum,regionName,userRegion"; } else { tbd.StrColumnlist = "id,type,userName,bookName,ISBN,bookNum,sum(number) as number,sum(totalPrice) as totalPrice ,sum(realPrice) as realPrice,regionName,supplier,time"; tbd.StrWhere = "regionId=" + regionId + where + " and type=" + type + " group by userName,bookName,ISBN,bookNum,regionName"; } tbd.IntPageSize = pageSize; tbd.IntPageNum = currentPage; //获取展示的用户数据 DataSet ds = bookbll.selectBypage(tbd, out totalCount, out intPageCount); //获取供应商 //dsSupplier = bookbll.selectSupplier(); //获取组织 //dsRegion = regionBll.select(); //获取制单员 //dsUser = bookbll.selectZdy(); //获取来源组织/收货组织 //dsSource = bookbll.selectSource(); StringBuilder sb = new StringBuilder(); int j = ds.Tables[0].Rows.Count; for (int i = 0; i < j; i++) { DataRow dr = ds.Tables[0].Rows[i]; sb.Append("<tr><td>" + (i + 1 + ((currentPage - 1) * pageSize)) + "</td>"); sb.Append("<td>" + dr["bookNum"].ToString() + "</td >"); sb.Append("<td>" + dr["ISBN"].ToString() + "</td >"); sb.Append("<td>" + dr["bookName"].ToString() + "</td >"); sb.Append("<td>" + dr["supplier"].ToString() + "</td >"); sb.Append("<td>" + dr["number"].ToString() + "</td >"); sb.Append("<td>" + dr["totalPrice"].ToString() + "</td >"); sb.Append("<td>" + dr["realPrice"].ToString() + "</td>"); sb.Append("<td>" + dr["regionName"].ToString() + "</td>"); sb.Append("<td>" + dr["userName"].ToString() + "</td>"); if (isAdmin) { sb.Append("<td>" + dr["userRegion"].ToString() + "</td>"); } sb.Append("<td>" + dr["time"].ToString() + "</td></tr>"); } sb.Append("<input type='hidden' value='" + intPageCount + "' id='intPageCount' />"); string op = Request["op"]; if (op == "paging") { Response.Write(sb.ToString() + "|:" + sjNum + "|:" + sbNum + "|:" + total + "|:" + real); Response.End(); } return(sb.ToString()); }
protected string getData() { string bookISBN = Request["bookISBN"]; string bookName = Request["bookName"]; string stockNumber = Request["stockNumber"]; string supplier = Request["supplier"]; string price = Request["price"]; if (user.RoleId.RoleName == "超级管理员") { string area = Request["bookArea"]; currentPage = Convert.ToInt32(Request["page"]); if (currentPage == 0) { currentPage = 1; } if (supplier != "" && supplier != null) { if (search == "" || search == null) { search = "supplier like '%" + supplier + "%'"; } else { search += " and supplier like '%" + supplier + "%'"; } } if (bookName != "" && bookName != null) { if (search == "" || search == null) { search = "bookName like '%" + bookName + "%'"; } else { search += " and bookName like '%" + bookName + "%'"; } } if (bookISBN != "" && bookISBN != null) { if (search == "" || search == null) { search = "ISBN like '%" + bookISBN + "%'"; } else { search += " and ISBN like '%" + bookISBN + "%'"; } } if (area != "" && area != null) { if (search == "" || search == null) { search = "regionName like '%" + area + "%'"; } else { search += " and regionName like '%" + area + "%'"; } } if (stockNumber != "" && stockNumber != null) { string[] sArray = stockNumber.Split('于'); string type = sArray[0]; string number = sArray[1]; if (search == "" || search == null) { if (type == "小") { search = "stockNum < '" + number + "'"; } else if (type == "等") { search = "stockNum = '" + number + "'"; } else { search = "stockNum > '" + number + "'"; } } else { if (type == "小") { search += " and stockNum < '" + number + "'"; } else if (type == "等") { search += " and stockNum = '" + number + "'"; } else { search += " and stockNum > '" + number + "'"; } } } if (price != "" && price != null) { string[] sArray = price.Split('于'); string type = sArray[0]; string number = sArray[1]; if (search == "" || search == null) { if (type == "小") { search = "price < '" + number + "'"; } else if (type == "等") { search = "price = '" + number + "'"; } else { search = "price > '" + number + "'"; } } else { if (type == "小") { search += " and price < '" + number + "'"; } else if (type == "等") { search += " and price = '" + number + "'"; } else { search += " and price > '" + number + "'"; } } } } else { string region = "regionId=" + user.ReginId.RegionId; if (search == "" || search == null) { search += region; } currentPage = Convert.ToInt32(Request["page"]); if (currentPage == 0) { currentPage = 1; } string area = Request["bookArea"]; currentPage = Convert.ToInt32(Request["page"]); if (currentPage == 0) { currentPage = 1; } if (supplier != "" && supplier != null) { search += " and supplier like '%" + supplier + "%'"; } if (bookName != "" && bookName != null) { search += " and bookName like '%" + bookName + "%'"; } if (bookISBN != "" && bookISBN != null) { search += " and ISBN = '" + bookISBN + "'"; } if (stockNumber != "" && stockNumber != null) { string[] sArray = stockNumber.Split('于'); string type = sArray[0]; string number = sArray[1]; if (type == "小") { search += " and stockNum < '" + number + "'"; } else if (type == "等") { search += " and stockNum = '" + number + "'"; } else { search += " and stockNum > '" + number + "'"; } } if (price != "" && price != null) { string[] sArray = price.Split('于'); string type = sArray[0]; string number = sArray[1]; if (type == "小") { search += " and price < '" + number + "'"; } else if (type == "等") { search += " and price = '" + number + "'"; } else { search += " and price > '" + number + "'"; } } } //获取分页数据 TableBuilder tbd = new TableBuilder(); tbd.StrTable = "V_Stock"; tbd.OrderBy = "ISBN"; tbd.StrColumnlist = "ISBN,bookName,supplier,price,regionName,stockNum,shelvesName"; tbd.IntPageSize = pageSize; tbd.StrWhere = search; tbd.IntPageNum = currentPage; //获取展示的用户数据 ds = bookbll.selectBypage(tbd, out totalCount, out intPageCount); //获取供应商 //dsSupplier = bookbll.selectSupplier(); int j = ds.Tables[0].Rows.Count; if (ds == null) { j = 0; } //生成table StringBuilder sb = new StringBuilder(); j = ds.Tables[0].Rows.Count; for (int i = 0; i < j; i++) { DataRow dr = ds.Tables[0].Rows[i]; sb.Append("<tr><td>" + dr["ISBN"].ToString() + "</td>"); sb.Append("<td>" + dr["bookName"].ToString() + "</td >"); sb.Append("<td>" + dr["supplier"].ToString() + "</td >"); sb.Append("<td>" + dr["price"].ToString() + "</td >"); sb.Append("<td>" + dr["regionName"].ToString() + "</td >"); sb.Append("<td>" + dr["shelvesName"].ToString() + "</td >"); sb.Append("<td>" + dr["stockNum"].ToString() + "</td></tr>"); } sb.Append("<input type='hidden' value='" + intPageCount + "' id='intPageCount' />"); string op = Request["op"]; if (op == "paging") { Response.Write(sb.ToString()); Response.End(); } return(sb.ToString()); }
/// <summary> /// 获取数据 /// </summary> protected string getData() { currentPage = Convert.ToInt32(Request["page"]); if (currentPage == 0) { currentPage = 1; } string bookName = Request["bookName"]; string bookNum = Request["bookNum"]; string bookISBN = Request["bookISBN"]; string discount = Request["discount"]; string discount2 = Request["discount2"]; string bookGys = Request["bookGys"]; if (bookName != "" && bookName != null) { if (search == "" || search == null) { search += "bookName like '%" + bookName + "%'"; } else { search += " and bookName like '%" + bookName + "%'"; } } if (bookNum != "" && bookNum != null) { if (search == "" || search == null) { search += "bookNum like '%" + bookNum + "%'"; } else { search += " and bookNum like '%" + bookNum + "%'"; } } if (bookISBN != "" && bookISBN != null) { if (search == "" || search == null) { search += "isbn like '%" + bookISBN + "%'"; } else { search += " and isbn like '%" + bookISBN + "%'"; } } if (discount != "" && discount != null) { string[] sArray = discount.Split('于'); string type = sArray[0]; string number = sArray[1]; try { if (search == "" || search == null) { if (type == "小") { search = "remarks < '" + number + "'"; } else if (type == "等") { search = "remarks = '" + number + "'"; } else { search = "remarks > '" + number + "'"; } } else { if (type == "小") { search += " and remarks < '" + number + "'"; } else if (type == "等") { search += " and remarks = '" + number + "'"; } else { search += " and remarks > '" + number + "'"; } } } catch { Response.Write("数据库存在不符合格式的数据"); Response.End(); } } if (discount2 != "" && discount2 != null) { string[] sArray = discount2.Split('于'); string type = sArray[0]; string number = sArray[1]; try { if (search == "" || search == null) { if (type == "小") { search = "author < '" + number + "'"; } else if (type == "等") { search = "author = '" + number + "'"; } else { search = "author > '" + number + "'"; } } else { if (type == "小") { search += " and author < '" + number + "'"; } else if (type == "等") { search += " and author = '" + number + "'"; } else { search += " and author > '" + number + "'"; } } } catch { Response.Write("数据库存在不符合格式的数据"); Response.End(); } } if (bookGys != "" && bookGys != null) { if (search == "" || search == null) { search += "supplier like '%" + bookGys + "%'"; } else { search += " and supplier like '%" + bookGys + "%'"; } } //if ((bookName == "" || bookName == null) && (bookNum == null || bookNum == "") && (bookISBN == null || bookISBN == "")) //{ // search = ""; //} //else if ((bookName != "" && bookName != null) && (bookNum == null || bookNum == "") && (bookISBN == null || bookISBN == "")) //{ // search = String.Format(" bookName like '%{0}%'", bookName); //} //else if ((bookName == "" || bookName == null) && (bookNum != "" && bookNum != null) && (bookISBN == null || bookISBN == "")) //{ // search = "bookNum like '%" + bookNum + "%'"; //} //else if ((bookName == "" || bookName == null) && (bookISBN != "" && bookISBN != null) && (bookNum == null || bookNum == "")) //{ // search = "ISBN like '%" + bookISBN + "%'"; //} //else if ((bookName == "" || bookName == null) && (bookISBN != "" && bookISBN != null) && (bookNum != null && bookNum != "")) //{ // search = "bookNum like '%" + bookNum + "%' and ISBN like '%" + bookISBN + "%'"; //} //else if ((bookName != "" && bookName != null) && (bookNum != null && bookNum != "") && (bookISBN == null || bookISBN == "")) //{ // search = String.Format(" bookName like '%{0}%' and bookNum like '{1}'", bookName, bookNum); //} //else if ((bookName != "" && bookName != null) && (bookNum == null || bookNum == "") && (bookISBN != null && bookISBN != "")) //{ // search = String.Format(" bookName like '%{0}%' and ISBN like '%{1}%'", bookName, bookISBN); //} //else //{ // search = String.Format(" bookName like '%{0}%' and bookNum like '%{1}%' and ISBN like '%{2}%'", bookName, bookNum, bookISBN); //} //获取分页数据 TableBuilder tbd = new TableBuilder(); tbd.StrTable = "T_BookBasicData"; tbd.OrderBy = "bookNum"; tbd.StrColumnlist = "bookNum,ISBN,bookName,publishTime,price,supplier,catalog,author,remarks,dentification"; tbd.IntPageSize = pageSize; tbd.StrWhere = search; tbd.IntPageNum = currentPage; //获取展示的用户数据 ds = bookbll.selectBypage(tbd, out totalCount, out intPageCount); //获取供应商 //dsSupplier = bookbll.selectSupplier(); //生成table StringBuilder sb = new StringBuilder(); int j = ds.Tables[0].Rows.Count; for (int i = 0; i < j; i++) { DataRow dr = ds.Tables[0].Rows[i]; sb.Append("<tr><td>" + (i + 1 + ((currentPage - 1) * pageSize)) + "</td>"); sb.Append("<td>" + dr["bookNum"].ToString() + "</td>"); sb.Append("<td>" + dr["bookName"].ToString() + "</td >"); sb.Append("<td>" + dr["price"].ToString() + "</td >"); sb.Append("<td>" + dr["publishTime"].ToString() + "</td >"); sb.Append("<td>" + dr["supplier"].ToString() + "</td >"); sb.Append("<td>" + dr["ISBN"].ToString() + "</td>"); sb.Append("<td>" + dr["catalog"].ToString() + "</td>"); sb.Append("<td>" + dr["author"].ToString() + "</td >"); sb.Append("<td>" + dr["remarks"].ToString() + "</td>"); sb.Append("<td>" + dr["dentification"].ToString() + "</td>"); if (funcBook) { sb.Append("<td>" + "<button class='btn btn-danger btn-sm btn-delete'><i class='fa fa-trash-o fa-lg'></i></button></td></tr>"); } } sb.Append("<input type='hidden' value='" + intPageCount + "' id='intPageCount' />"); string op = Request["op"]; if (op == "paging") { Response.Write(sb.ToString()); Response.End(); } return(sb.ToString()); }
//public String Summary() //{ // Customer custom = (Customer)Session["custom"]; // userName = custom.CustomerName; // int cusId = custom.CustomerId; // //string search = ""; // string search = "(state=1 or state=2) and deleteState=0 and customerID=" + cusId; // string bookName = Request["bookName"]; // string source = Request["source"]; // string isbn = Request["isbn"]; // string time = Request["time"]; // if (bookName != "" && bookName != null) // { // search = search + " and bookName like '%" + bookName + "%'"; // } // if (source != "" && source != null) // { // search = search + " and regionName like '%" + source + "%'"; // } // if (isbn != "" && isbn != null) // { // search = search + " and ISBN like '%" + isbn + "%'"; // } // if (time != null && time != "") // { // string[] sArray = time.Split('至'); // string startTime = sArray[0]; // string endTime = sArray[1]; // if (search != null && search != "") // { // search += " and dateTime BETWEEN'" + startTime + "' and '" + endTime + "'"; // } // else // { // search += "dateTime BETWEEN'" + startTime + "' and '" + endTime + "'"; // } // } // //获取汇总数据 // customerPurchaseBll cpBll = new customerPurchaseBll(); // DataSet sumDs = cpBll.getSummary(cusId, search); // kindsNum = int.Parse(sumDs.Tables[0].Rows[0]["kindsNum"].ToString()); // if (kindsNum > 0) // { // allNum = int.Parse(sumDs.Tables[0].Rows[0]["alln"].ToString()); // allRealPrice = sumDs.Tables[0].Rows[0]["arp"].ToString(); // allTotalPrice = sumDs.Tables[0].Rows[0]["atp"].ToString(); // } // StringBuilder srb = new StringBuilder(); // srb.Append("<table class='table table_stock text-center' id='sumTable' style='display:none'>"); // srb.Append("<tr class='text-nowrap'>"); // srb.Append("<td><span>书籍种数:</span></td>"); // srb.Append("<td><input type='text' value='" + kindsNum + "' class='form-control' disabled id='kinds'></td>"); // srb.Append("<td><span>书本总数:</span></td>"); // srb.Append("<td><input type='text' value='" + allNum + "' class='form-control' disabled id='alln'></td>"); // srb.Append("<td><span>总码洋:</span></td>"); // srb.Append("<td><input type='text' value='" + Convert.ToDouble(allTotalPrice).ToString("F2") + "' class='form-control' disabled id='allt'></td>"); // srb.Append("<td><span>总实洋:</span></td>"); // srb.Append("<td><input type='text' value='" + Convert.ToDouble(allRealPrice).ToString("F2") + "' class='form-control' disabled id='allr'></td></tr>"); // srb.Append("</table>"); // string op = Request["op"]; // if (op == "paging") // { // Response.Write(srb.ToString()); // //Response.End(); // } // return srb.ToString(); //} protected string getData() { Customer custom = (Customer)Session["custom"]; userName = custom.CustomerName; int cusId = custom.CustomerId; //string search = ""; string search = "(state=1 or state=2) and deleteState=0 and customerID=" + cusId; string bookName = Request["bookName"]; string source = Request["source"]; string isbn = Request["isbn"]; string time = Request["time"]; if (bookName != "" && bookName != null) { search = search + " and bookName like '%" + bookName + "%'"; } if (source != "" && source != null) { search = search + " and regionName like '%" + source + "%'"; } if (isbn != "" && isbn != null) { search = search + " and ISBN like '%" + isbn + "%'"; } if (time != null && time != "") { string[] sArray = time.Split('至'); string startTime = sArray[0]; string endTime = sArray[1]; if (search != null && search != "") { search += " and dateTime BETWEEN'" + startTime + "' and '" + endTime + "'"; } else { search += "dateTime BETWEEN'" + startTime + "' and '" + endTime + "'"; } } //else //{ // search = "deleteState=0 and bookName like '%" + bookName + "%' and regionName='"+ source + "' and customerID=" + cusId; //} //获取汇总数据 customerPurchaseBll cpBll = new customerPurchaseBll(); DataSet sumDs = cpBll.getSummary(cusId, search); kindsNum = int.Parse(sumDs.Tables[0].Rows[0]["kindsNum"].ToString()); if (kindsNum > 0) { allNum = int.Parse(sumDs.Tables[0].Rows[0]["alln"].ToString()); allRealPrice = sumDs.Tables[0].Rows[0]["arp"].ToString(); allTotalPrice = sumDs.Tables[0].Rows[0]["atp"].ToString(); } currentPage = Convert.ToInt32(Request["page"]); if (currentPage == 0) { currentPage = 1; } DataSet ds; //获取分页数据 TableBuilder tbd = new TableBuilder(); tbd.StrTable = "V_SaleMonomer"; tbd.OrderBy = "saleIdMonomerId"; tbd.StrColumnlist = "bookName,ISBN,saleHeadId,saleHeadId,saleIdMonomerId,unitPrice,number,totalPrice,realPrice,realDiscount,dateTime,regionName"; tbd.IntPageSize = pageSize; tbd.StrWhere = search; tbd.IntPageNum = currentPage; //获取展示的用户数据 ds = bookbll.selectBypage(tbd, out totalCount, out intPageCount); //获取团采地点 customerPurchaseBll customerPurchaseBll = new customerPurchaseBll(); dtRegion = customerPurchaseBll.getRegionSaleMonomer(); //生成table StringBuilder sb = new StringBuilder(); int j = ds.Tables[0].Rows.Count; for (int i = 0; i < j; i++) { DataRow dr = ds.Tables[0].Rows[i]; sb.Append("<tr><td>" + dr["saleHeadId"].ToString() + "</td >"); sb.Append("<td>" + dr["ISBN"].ToString() + "</td >"); sb.Append("<td>" + dr["bookName"].ToString() + "</td>"); sb.Append("<td>" + dr["unitPrice"].ToString() + "</td >"); sb.Append("<td>" + dr["number"].ToString() + "</td >"); sb.Append("<td>" + dr["totalPrice"].ToString() + "</td >"); sb.Append("<td>" + dr["realPrice"].ToString() + "</td>"); sb.Append("<td>" + dr["realDiscount"].ToString() + "</td>"); sb.Append("<td>" + dr["regionName"].ToString() + "</td>"); sb.Append("<td>" + dr["dateTime"].ToString() + "</td></tr>"); } //sb.Append("<tr class='text-nowrap' style='display:none'>"); //sb.Append("<td><span>书籍种数:</span></td>"); //sb.Append("<td><input type='hidden' value='" + kindsNum + "' class='form-control' disabled id='kinds'></td>"); //sb.Append("<td><span>书本总数:</span></td>"); //sb.Append("<td><input type='text' value='" + allNum + "' class='form-control' disabled id='alln'></td>"); //sb.Append("<td><span>总码洋:</span></td>"); //sb.Append("<td><input type='text' value='" + Convert.ToDouble(allTotalPrice).ToString("F2") + "' class='form-control' disabled id='allt'></td>"); //sb.Append("<td><span>总实洋:</span></td>"); //sb.Append("<td><input type='text' value='" + Convert.ToDouble(allRealPrice).ToString("F2") + "' class='form-control' disabled id='allr'></td></tr>"); sb.Append("<input type='hidden' value='" + intPageCount + "' id='intPageCount' />"); sb.Append("<input type='hidden' value='" + kindsNum + "' id='kinds' />"); sb.Append("<input type='hidden' value='" + allNum + "' id='alln' />"); if (kindsNum > 0) { sb.Append("<input type='hidden' value='" + Convert.ToDouble(allTotalPrice).ToString("F2") + "' id='allt' />"); sb.Append("<input type='hidden' value='" + Convert.ToDouble(allRealPrice).ToString("F2") + "' id='allr' />"); } else { sb.Append("<input type='hidden' value='" + allTotalPrice + "' id='allt' />"); sb.Append("<input type='hidden' value='" + allRealPrice + "' id='allr' />"); } string op = Request["op"]; if (op == "paging") { Response.Write(sb.ToString()); Response.End(); } return(sb.ToString()); }