public void getbind() { //string table = "remittances r,withdraw w"; string table = @"remittances r left join memberinfo m1 on r.remitnumber = m1.Number "; //string clounm = "r.remittancesid,r.remitnumber as number,w.HkKhname as hkhname,w.Hkbankcard as hbankcard,w.khname as tkhname,w.bankcard as tbankcard,w.withdrawmoney,r.remittancesdate,w.shenhestate,r.id"; string clounm = @"r.shenhestate,r.actype,r.InvestJB,r.pricejb, m1. mobiletele,r.ReceivablesDate, r.remittancesid,r.remitnumber as rnumber,r.remittancesdate,r.RemitMoney,r.RemitCardtype,r.AliNo,r.WeiXNo,r.ID, r.bankcard,r.bankname,r.Khname,m1.Name as rname "; StringBuilder sb = new StringBuilder(); sb.Append(" 1=1 and shenhestate in(-1,0,1) "); if (txtnumber.Text.Trim() != "") { sb.Append(" and m1.mobiletele = '" + txtnumber.Text.Trim() + "'"); } if (txtbeigandate.Text.Trim() != "") { sb.Append(" and r.remittancesdate >= '" + txtbeigandate.Text.Trim() + " 00:00:00'"); } if (txtenddate.Text.Trim() != "") { sb.Append(" and r.remittancesdate <= '" + txtenddate.Text.Trim() + " 23:59:59'"); } if (DropDownList1.SelectedValue != "-2") { sb.Append(" and r.shenhestate=" + DropDownList1.SelectedValue); } Pager1.PageBind(0, 10, table, clounm, sb.ToString(), "r.id", "Repeater1"); }
public void getbind() { string table = "MemberAccount"; string clounm = "id, Number,HappenTime,HappenMoney,BalanceMoney,Direction,SfType,KmType,Remark "; StringBuilder sb = new StringBuilder(); sb.Append(" KmType =0 and Remark like '%违约' "); if (txtnumber.Text.Trim() != "") { sb.Append(" and r.remitnumber = '" + txtnumber.Text.Trim() + "'"); } if (txtbeigandate.Text.Trim() != "") { sb.Append(" and r.remittancesdate >= '" + txtbeigandate.Text.Trim() + " 00:00:00'"); } if (txtenddate.Text.Trim() != "") { sb.Append(" and r.remittancesdate <= '" + txtenddate.Text.Trim() + " 23:59:59'"); } object obj = DAL.DBHelper.ExecuteScalar("select sum(isnull(HappenMoney,0)) from " + table + " where " + sb); lblwyjzj.Text = Convert.ToDouble((obj == null || obj == DBNull.Value)?0:obj).ToString("0.00"); Pager1.PageBind(0, 10, table, clounm, sb.ToString(), "id", "Repeater1"); }
private void GetShopList() { StringBuilder sb = new StringBuilder(); string table = "V_DroppedMessage"; sb.Append(" Operator='" + Session["Member"].ToString() + "' and OperatorType=2 "); if (this.txtBeginTime.Text != "" && this.txtEndTime.Text != "") { string beginDate = this.txtBeginTime.Text.Trim() + " 00:00:00"; string endDate = this.txtEndTime.Text.Trim() + " 23:59:59"; if (Convert.ToDateTime(beginDate) > Convert.ToDateTime(endDate)) { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert("" + GetTran("000755", "起始时间不能大于终止之间") + "!")); return; } sb.Append(" and dateadd(hour," + BLL.other.Company.WordlTimeBLL.ConvertAddHours() + ",Senddate)>='" + beginDate + "'" + "and dateadd(hour," + BLL.other.Company.WordlTimeBLL.ConvertAddHours() + ",Senddate)<='" + endDate + "'"); } ViewState["SQLSTR"] = "select * from V_DroppedMessage where " + sb.ToString(); Pager1.Pageindex = 0; Pager1.PageSize = 10; Pager1.PageTable = table; Pager1.Condition = sb.ToString(); Pager1.PageColumn = "* "; Pager1.ControlName = "GridView1"; Pager1.PageCount = 0; Pager1.key = "id"; Pager1.PageBind(); }
public void getbind() { string table = @" withdraw w left join memberinfo m1 on w.number = m1.Number "; string clounm = @" w.id,w.pricejb, m1.mobiletele, w.shenhestate , w.auditingtime,w.actype, w.WithdrawTime,w.withdrawmoney,w.number,m1.Name as tname, w.InvestJB, w.DrawCardtype,w.AliNo,w.WeiXNo "; StringBuilder sb = new StringBuilder(); sb.Append(" 1=1 "); if (txtsnumber.Text.Trim() != "") { sb.Append(" and m1.mobiletele = '" + txtsnumber.Text.Trim() + "'"); } if (txtbeigandate.Text.Trim() != "") { sb.Append(" and w.WithdrawTime >= '" + txtbeigandate.Text.Trim() + " 00:00:00'"); } if (txtenddate.Text.Trim() != "") { sb.Append(" and w.WithdrawTime <= '" + txtenddate.Text.Trim() + " 23:59:59'"); } if (DropDownList1.SelectedValue != "-2") { sb.Append(" and w.shenhestate in(" + DropDownList1.SelectedValue + ")"); } else { sb.Append(" and w.shenhestate in(-1,0,1)"); } Pager1.PageBind(0, 10, table, clounm, sb.ToString(), "w.id", "Repeater1"); }
/// <summary> /// 查询按钮 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void BtnConfirm_Click(object sender, EventArgs e) { StringBuilder sb = new StringBuilder(); int docTpyeId = Convert.ToInt32(QueryInStorageBLL.GetDocTypeIDEByDocTypeCode("BY")); sb.Append(" 1=1 and a.DocTypeID=" + docTpyeId); ////判断国家 //UserControl_Country cou = Page.FindControl("Country1") as UserControl_Country; //if (cou.CID > 0) //{ // sb.Append(" and b.ID=" + cou.CID); //} //仓库 if (Convert.ToInt32(ddlcangku.SelectedValue) > 0) { sb.Append(" and a.WareHouseID=" + ddlcangku.SelectedValue); } //库位 if (Convert.ToInt32(ddlkuwei.SelectedValue) > 0) { sb.Append(" and a.DepotSeatID=" + ddlkuwei.SelectedValue); } string colunmns = " a.ID,a.DocTypeID,a.DocID,a.DocMakeTime,a.DocMaker,a.Client,d.warehousename,a.TotalMoney,c.seatname,a.TotalPV,a.ExpectNum,a.Note,a.StateFlag,a.CloseFlag,a.CloseDate,a.BatchCode,a.OriginalDocID,a.Address,a.Flag,a.Charged,a.Reason"; string table = "InventoryDoc a left outer join warehouse d on d.warehouseid=a.WareHouseID left outer join DepotSeat c on a.DepotSeatID=c.depotseatid"; ViewState["SQLSTR"] = "select " + colunmns + " from " + table + " where " + sb.ToString() + " order by a.ID desc"; Pager1.PageBind(0, 10, table, colunmns, sb.ToString(), "a.ID", "givDoc"); }
protected void Page_Load(object sender, EventArgs e) { Permissions.ComRedirect(Page, Permissions.redirUrl); Permissions.CheckManagePermission(EnumCompanyPermission.CustomerProviderViewEdit); if (!IsPostBack) { Pager1.PageBind(0, 10, "ProviderInfo", " ID,number,name,ForShort,linkman,Mobile,address,DutyNumber,remark ", " 1=1 ", "ID", "givProviderInfo"); } Translations_More(); }
protected void btnSearch_Click(object sender, EventArgs e) { string table = " h_mobilemsg hm "; string columns = " hm.Category,hm.ID,hm.CustomerID,hm.sendMsg,hm.senddate,hm.CustomerID,hm.mobile,hm.BillID,case hm.sucflag when '1' then '" + GetTran("000000", "成功") + "' else '" + GetTran("000000", "失败") + "' end as sucflag,SendNo,SendSmallNo "; string condition = getCondition(); string key = "hm.ID "; Pager1.PageBind(0, 10, table, columns, condition, key, "GridView1"); Translations(); }
public void bind() { string country = DropCurrency.SelectedItem.Text; ViewState["tj"] = "country='" + country + "'"; Pager1.PageBind(0, 10, @" (select a.ID,a.Number,a.LogisticsCompany,a.Principal,a.Telephone1, a.Telephone2,a.Telephone3,a.Telephone4,a.cpccode,b.Country,b.Province, b.City,a.StoreAddress,a.PostalCode,a.LicenceCode,a.bankcode, (select bankname from memberbank where bankcode = a.bankcode) as bank,a.BankCard,a.RigisterDate, a.Remark,a.Tax,a.Administer,a.LogisticsPerson,a.OperateIP,a.OperateNum from Logistics a left outer join city b on a.cpccode=b.cpccode ) t", " * ", " country='" + country + "' ", "id", "gvThirdLogistics"); }
protected void btn_Submit_Click1(object sender, EventArgs e) { if (DDPStatus.SelectedIndex != 0) { gvDisplaceGoods.Columns[0].Visible = false; gvDisplaceGoods.Columns[1].Visible = false; } else { gvDisplaceGoods.Columns[0].Visible = true; gvDisplaceGoods.Columns[1].Visible = true; } Pager1.PageBind(0, 10, "Replacement As d left outer join StoreInfo on d.storeid=StoreInfo.storeid left outer join storeorder on D.storeorderid=storeorder.storeorderid", " D.StoreID,DisplaceOrderID,RefundmentOrderID,D.StoreOrderID,D.ExpectNum,StateFlag,CloseFlag,OutTotalMoney,InTotalMoney,MakeDocDate,D.Remark ", getSQL(), "D.DisplaceOrderID", "gvDisplaceGoods"); }
/// <summary> /// 点击“查询”按钮,显示查询结果 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btn_Submit_Click(object sender, EventArgs e) { if (DDPStatus.SelectedIndex != 0) { gvRefundmentBrowse.Columns[0].Visible = false; gvRefundmentBrowse.Columns[1].Visible = false; } else { gvRefundmentBrowse.Columns[0].Visible = true; gvRefundmentBrowse.Columns[1].Visible = true; } BidnGridViewList(GetSQL()); Pager1.PageBind(0, 10, "RefundmentOrderDoc As D", "*", GetSQL(), "docid", "gvRefundmentBrowse"); }
public void GetBind() { string table = "memberinfo a,memberinfobalance1 b"; string clounms = "a.mobiletele,name,jackpot-out as ublc, pointAIn-pointAOut as ablc,pointbIn-pointbOut as bblc,pointcIn-pointcOut as cblc,pointdIn-pointdOut as dblc,pointeIn-pointeOut as eblc "; StringBuilder sb = new StringBuilder(); sb.Append(" 1=1 and a.number=b.number "); string number = ""; if (txtnumber.Text.Trim() != "") { string sql = "select mobiletele from MemberInfo where MobileTele='" + txtnumber.Text + "'"; DataTable shj = DBHelper.ExecuteDataTable(sql); if (shj.Rows.Count > 0) { number = shj.Rows[0][0].ToString(); } else { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert(' 无此手机号,请检查后再重新输入 !')</script>"); return; } sb.Append(" and a.MobileTele='" + number + "'"); } if (txtname.Text.Trim() != "") { sb.Append(" and name='" + Encryption.Encryption.GetEncryptionName(txtname.Text.Trim()) + "'"); } double money = 0; if (txtmoney.Text.Trim() != "") { bool b = double.TryParse(txtmoney.Text.Trim(), out money); if (!b) { ClientScript.RegisterStartupScript(this.GetType(), "success", "alert('输入的金额有误!');", true); return; } } if (DropDownList2.SelectedValue != "-1") { sb.Append(" and " + DropDownList1.SelectedValue + DropDownList2.SelectedValue + money); } Pager1.PageBind(0, 10, table, clounms, sb.ToString(), "id", "GridView1"); //translation(); }
protected void btnSearch_Click(object sender, EventArgs e) { string tj = " 1=1 and m.number=u.number "; if (txtBianhao.Text != "") { tj += " and u.number like '%" + txtBianhao.Text + "%' "; } if (txtOrderId.Text != "") { tj += " and u.orderid like '%" + txtOrderId.Text + "%' "; } //tj += " and "+ this.GetNumber(); GetBindGView(tj); Pager1.PageBind(0, 10, "updateexpect u,memberinfo m", "*", tj, "u.ID", "GridView1"); Translations(); }
protected void Page_Load(object sender, EventArgs e) { Permissions.ComRedirect(Page, Permissions.redirUrl); //检查相应权限 Response.Cache.SetExpires(DateTime.Now); Permissions.CheckManagePermission(EnumCompanyPermission.LogisticsDisplaceGoodsBrowse); AjaxPro.Utility.RegisterTypeForAjax(typeof(AjaxClass)); if (!IsPostBack) { BindddlWareHouseList(); returnedGoodsBLL.GetDepotSeat(ddlDepotSeat, ddlWareHouse.SelectedValue); DatePicker1.Visible = false; //gvDisplaceGoods.DataSource = bll.GetNoShenHe(getSQL()); //gvDisplaceGoods.DataBind(); Pager1.PageBind(0, 10, "Replacement As d inner join StoreInfo on d.storeid=StoreInfo.storeid ", " * ", getSQL(), "D.DisplaceOrderID", "gvDisplaceGoods"); } }
/// <summary> /// 模糊查询供货商信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSearch_Click(object sender, EventArgs e) { string name = txtName.Text.Trim().Replace("'", "");; string number = txtNumber.Text.Trim().Replace("'", ""); StringBuilder sb = new StringBuilder(); sb.Append(" 1=1 "); if (name.Length > 0) { sb.Append(" and Name like '%" + name + "%'"); } if (number.Length > 0) { sb.Append(" and Number like '%" + number + "%'"); } ViewState["wherepage"] = sb.ToString(); Pager1.PageBind(0, 10, "ProviderInfo", " ID,number,name,ForShort,linkman,Mobile,address,DutyNumber,remark ", sb.ToString(), "ID", "givProviderInfo"); Translations_More(); }
public void GetBind() { string table = "storeinfo"; string clounms = "storeid,name,TotalAccountMoney,(TotalAccountMoney-TotalOrderGoodMoney) as DHK,(TurnOverMoney-TurnOverGoodsMoney) as ZZK"; StringBuilder sb = new StringBuilder(); sb.Append(" 1=1 "); if (txtnumber.Text.Trim() != "") { sb.Append(" and storeid='" + this.txtnumber.Text.Trim() + "'"); } if (txtname.Text.Trim() != "") { sb.Append(" and name='" + Encryption.Encryption.GetEncryptionName(txtname.Text.Trim()) + "'"); } double money = 0; if (txtmoney.Text.Trim() != "") { bool b = double.TryParse(txtmoney.Text.Trim(), out money); if (!b) { ClientScript.RegisterStartupScript(this.GetType(), "success", "alert('输入的金额有误!');", true); return; } } if (DropDownList2.SelectedValue != "-1") { if (DropDownList1.SelectedValue == "1") { sb.Append(" and (TotalAccountMoney-TotalOrderGoodMoney)" + DropDownList2.SelectedValue + money); } else if (DropDownList1.SelectedValue == "2") { sb.Append(" and (TurnOverMoney-TurnOverGoodsMoney)" + DropDownList2.SelectedValue + money); } } Pager1.PageBind(0, 10, table, clounms, sb.ToString(), "id", "GridView1"); Translations(); }
protected void QueryWhere(string storeId, int volume, string condition, string compare, string content) { this.Pager1.Visible = true; //this.lbbaodanmoney.Text = new BLL.Registration_declarations.RegistermemberBLL().GetLeftRegisterMemberMoney(storeId); try { if (this.txtBox_OrderDateTimeEnd.Text.Trim() != "") { Convert.ToDateTime(txtBox_OrderDateTimeEnd.Text.Trim()); } if (this.txtBox_OrderDateTimeStart.Text.Trim() != "") { Convert.ToDateTime(txtBox_OrderDateTimeStart.Text.Trim()); } } catch { msg = "<script>alert('" + GetTran("000450", "日期格式输入错误!") + "');</scipt>"; return; } string endTime = this.txtBox_OrderDateTimeEnd.Text.Trim(); string startTime = this.txtBox_OrderDateTimeStart.Text.Trim(); string iszf = this.rtbiszf.SelectedValue; BLL.Registration_declarations.PagerParmsInit model = auditingMemberagainBLL.QueryWhere2(volume.ToString(), storeId, condition, compare, content, iszf, endTime, startTime); if (model.ErrInfo != null) { ScriptHelper.SetAlert(Page, model.ErrInfo); } else { // this.Pager1.PageBind(model.PageIndex, model.PageSize, model.PageTable, model.PageColumn, model.SqlWhere, model.Key, model.ControlName); //this.Pager1.PageSorting(1, model.PageSize, model.PageTable, model.PageColumn, model.SqlWhere, model.Key, model.ControlName); Pager1.PageBind(0, model.PageSize, model.PageTable, model.PageColumn, model.SqlWhere, model.Key, model.ControlName); } }
/// <summary> /// 初始化查询条件 /// </summary> private void GetShopList() { int Lev = Convert.ToInt32(BLL.CommonClass.CommonDataBLL.GetBalanceLevel(Session["Member"].ToString()).Rows[0][0]); string condition = "1<2 and DownTarget <> 1 and (DownMenberLev=0 or DownMenberLev=" + Lev + ")"; if (this.txt_member.Text != "") { condition += " and ResName like '%" + this.txt_member.Text.Trim().Replace("'", "") + "%'"; } if (this.Txt_Name.Text != "") { condition += " and FileName like '%" + this.Txt_Name.Text.Trim().Replace("'", "") + "%'"; } DataTable dt = DownLoadFilesBLL.GetResourcesInfoByConditions("*", condition); gvResources.DataSource = dt; gvResources.DataBind(); Pager1.PageBind(0, 10, " Resources", "ResID, ResName, FileName, ResDescription, ResSize, ResDateTime, ResTimes", condition, "ResID", "gvResources"); }
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { string storeOrderID = ((Label)GridView_Order.SelectedRow.FindControl("Lab_StoreOrderID")).Text; if (isButton == "sel") { Response.Redirect("OrderGoodsDetail.aspx?storeOrderID=" + storeOrderID); } else if (isButton == "del") { if (OrdersBrowseBLL.DelStoreOrderItem(storeOrderID)) { string condition = ""; if (ViewState["condition"] == null) { condition = "1=1"; } else { condition = ViewState["condition"].ToString(); } //刷新 Pager1.PageBind(0, 10, "StoreOrder so left outer join city on so.cpccode=city.cpccode ", @"StoreID,OrderGoodsID,ExpectNum,IsCheckOut, OrderType,InceptPerson,city.country,city.province,city.city, InceptAddress,PostalCode,TotalMoney,TotalPV,Telephone,Weight,Carriage ,OrderDateTime,Description", condition, "OrderGoodsID", "GridView_Order", "OrderDateTime", 0); ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000008", "删除成功") + "')</script>"); } else { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000417", "删除失败") + "')</script>"); } } }
private void Bind() { string condition = ""; if (Tbx_num.Text.Trim() != "") { condition = "A.storeid=B.storeid and A.storeid='" + Session["bianhao"] + "' and B.Number=C.Number and A.orderdatetime between '" + Session["Begin"] + "' and '" + Session["End"] + "'"; } else { condition = "A.storeid=B.storeid and B.Number=C.Number and A.orderdatetime between '" + Session["Begin"] + "' and '" + Session["End"] + "'"; } Pager1.PageBind(0, 10, "StoreOrder A ,StoreInfo B ,MemberInfo C ", @"a.storeid,c.name,a.ExpectNum,a.storeorderid, a.GeneOutBillPerson,a.orderdatetime,a.totalmoney,a.totalpv,a.ischeckout,a.isgeneoutbill,a.issent,a.isreceived ", condition, "a.StoreOrderID", "DataGrid1", "a.OrderDateTime", 0); string str = GetZJE(" and " + condition); if (str != "") { try { lab_cjezj.Text = double.Parse(str.Split(',')[0]).ToString(); lab_cjfzj.Text = double.Parse(str.Split(',')[1]).ToString(); } catch { lab_cjezj.Text = "未知"; lab_cjfzj.Text = "未知"; } } Translations(); ViewState["SQLSTR"] = "select a.storeid,c.name,a.ExpectNum,a.storeorderid, a.GeneOutBillPerson,a.orderdatetime,a.totalmoney,a.totalpv,a.ischeckout,a.isgeneoutbill,a.issent,a.isreceived from StoreOrder A ,StoreInfo B ,MemberInfo C where " + condition; }
private void GetShopList() { SqlConnection conn = new SqlConnection(DAL.DBHelper.connString); SqlCommand cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "MessageCheckCondition"; conn.Open(); if (Session["languageCode"].ToString() == "L001") { conditions += "and CountryCode!=1"; } else { conditions += "and CountryCode=1"; } string rtn = ""; string idlist = ""; //DataTable dt = DAL.DBHelper.ExecuteDataTable("select ID from MessageSend join MessageReadCondition on MessageSend.ID=MessageReadCondition.MessageID where " + conditions + "and MessageReadCondition.ConditionLevel=(select levelint from memberinfo where number='" + Session["Member"].ToString() + "')"); DataTable dt = DAL.DBHelper.ExecuteDataTable("select ID from MessageSend where " + conditions); foreach (DataRow row in dt.Rows) { cmd.Parameters.Clear(); cmd.Parameters.Add("@MessageSendID", SqlDbType.Int).Value = Convert.ToInt32(row["ID"]); cmd.Parameters.Add("@number", SqlDbType.VarChar).Value = Session["Member"].ToString(); cmd.Parameters.Add("@type", SqlDbType.Char).Value = '2'; cmd.Parameters.Add("@rtn", SqlDbType.Char, 1).Direction = ParameterDirection.Output; cmd.ExecuteNonQuery(); rtn = cmd.Parameters["@rtn"].Value.ToString(); if (rtn.Equals("1")) { idlist += row["ID"].ToString() + ","; } } conn.Close(); idlist = idlist.TrimEnd(",".ToCharArray()); //对自己本身的公告查询 string sql1 = "SELECT ma.MessageID FROM dbo.MessageReadCondition AS ma,dbo.MessageSend AS me WHERE ma.MessageID=me.ID and DropFlag=0 and me.SenderRole=0 and me.Receive='*' and me.LoginRole=2 and ma.ConditionLeader='" + Session["Member"].ToString() + "'"; DataTable dt1 = DAL.DBHelper.ExecuteDataTable(sql1); if (dt1.Rows.Count > 0) { for (int i = 0; i < dt1.Rows.Count; i++) { idlist += "," + dt1.Rows[i]["MessageID"].ToString(); } } idlist = idlist.TrimStart(",".ToCharArray()); string where = ""; if (!idlist.Equals("")) { where = "ID in(" + idlist + ") and MessageType='a'"; } else { where = "1=2"; } Pager1.PageBind(0, 10, "MessageSend", "ID, LoginRole, Receive, InfoTitle, Content, SenderRole, Sender, Senddate, DropFlag, ReadFlag", conditions + " and " + where, "id", "gvMessageSend"); }
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { if (isButton == "出库") { if (DropCurrery.SelectedItem != null) { string currency = DropCurrery.SelectedItem.Value; string storeOrderID = ((Label)GridView_BillOutOrder.SelectedRow.FindControl("Lab_StoreOrderID")).Text; Response.Redirect("Outstock.aspx?StoreOrderID=" + storeOrderID + "&title=" + GetTran("001164", "请填写出库单") + "&enable=N&isBut=CK&source=ck&Country=" + currency); } else { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000058", "请选择国家") + "');</script>"); } } else if (isButton == "查看") { string storeOrderID = ((Label)GridView_BillOutOrder.SelectedRow.FindControl("Lab_StoreOrderID")).Text; Response.Redirect("ViewStoreOrderD.aspx?storeOrderID=" + storeOrderID); } else if (isButton == "s查看") { string storeOrderID = ((Label)GridView2_BilloutOrder.SelectedRow.FindControl("sLab_StoreOrderID")).Text; Response.Redirect("ViewStoreOrder.aspx?storeOrderID=" + storeOrderID); } else if (isButton == "撤单") { string storeorderid = ((Label)GridView2_BilloutOrder.SelectedRow.FindControl("sLab_StoreOrderID")).Text; DataTable dt = DBHelper.ExecuteDataTable("select docid from InventoryDoc where StoreOrderID='" + storeorderid + "'"); int i = 0; foreach (DataRow dr in dt.Rows) { List <InventoryDocDetailsModel> l_ddm = new List <InventoryDocDetailsModel>(); DataTable l_odm = InventoryDocDetailsBLL.GetInventoryDocDetailsByDocID(dr[0].ToString()); //BillOutOrderBLL.GetOrderDetailModelList(dr[0].ToString()); foreach (DataRow row in l_odm.Rows) { InventoryDocDetailsModel ddm = new InventoryDocDetailsModel(); ddm.ProductID = Convert.ToInt32(row["ProductId"]); ddm.ProductQuantity = Convert.ToDouble(row["ProductQuantity"]); ddm.UnitPrice = Convert.ToDouble(row["UnitPrice"]); ddm.PV = Convert.ToDouble(row["PV"]); ddm.ProductTotal = Convert.ToDouble(row["totalPrice"]); ddm.MeasureUnit = ""; l_ddm.Add(ddm); } if (BillOutOrderBLL.SetQuashBillOutOrder(dr[0].ToString(), l_ddm, storeorderid)) { i++; } } if (i > 0) { GridView_BillOutOrder.Visible = false; GridView2_BilloutOrder.Visible = true; ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("001168", "撤单成功!") + "');</script>"); Pager1.PageBind(0, 10, " StoreOrder so left outer join city on so.cpccode=city.cpccode ", @" isSent,StoreID,StoreOrderID,OutStorageOrderID,ExpectNum, OrderType, TotalMoney,TotalPv,IsCheckOut,PayMentDateTime,InceptPerson,InceptAddress,Telephone,Weight,Carriage,OrderDateTime,city.country,city.province,city.city, Description ", ViewState["condition"].ToString(), "StoreOrderID", "GridView2_BilloutOrder", "OrderDateTime", 0); } else { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("001171", "撤单失败!") + "');</script>"); } } }
/// <summary> /// 一般单据查询 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btn_Submit_Click(object sender, EventArgs e) { string condition = ""; string currency = ""; if (DropCurrery.SelectedItem != null) { currency = DropCurrery.SelectedItem.Text; } string tiaoj = DropDownList_Items.SelectedItem.Value; string fh = DropDownList_condition.Text; string keyword = ""; if (DropDownList_Items.SelectedIndex == 7) { keyword = txtBox_rq.Text.Trim(); } else { keyword = TextBox4.Text.Trim().Replace("'", "").Replace("〖", "[").Replace("〗", "]"); } string status = DropDownList1.SelectedValue; if (String.IsNullOrEmpty(keyword)) { condition = "so.IsCheckOut='Y' and so.isAuditing='Y' and (select country from city where cpccode=so.cpccode)='" + currency + "' and " + status; } else { string pjtj = ""; if (fh == "like") { if (tiaoj == "so.InceptPerson") { pjtj = tiaoj + " like '%" + Encryption.Encryption.GetEncryptionName(keyword) + "%'"; } else if (tiaoj == "so.InceptAddress") { pjtj = tiaoj + " like '%" + Encryption.Encryption.GetEncryptionAddress(keyword) + "%'"; } else { pjtj = tiaoj + " like '%" + keyword + "%'"; } } else { if (tiaoj == "so.TotalMoney" || tiaoj == "so.Carriage") { try { keyword = keyword.Replace(",", ""); Convert.ToDouble(keyword); } catch { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000443", "只能输入数字") + "')</script>"); return; } } if (DropDownList_Items.SelectedIndex == 7)//用于日期等于 { if (DropDownList_condition.SelectedItem.Value.Trim() == "=") { pjtj = "dateadd(hour," + BLL.other.Company.WordlTimeBLL.ConvertAddHours() + "," + tiaoj + ")" + " >= '" + keyword + " 00:00:00' and " + "dateadd(hour," + BLL.other.Company.WordlTimeBLL.ConvertAddHours() + "," + tiaoj + ")" + " <= '" + keyword + " 23:59:59'"; } else if (DropDownList_condition.SelectedItem.Value.Trim() == ">") { pjtj = "dateadd(hour," + BLL.other.Company.WordlTimeBLL.ConvertAddHours() + "," + tiaoj + ")" + DropDownList_condition.SelectedItem.Value + "'" + keyword + " 23:59:59'"; } else if (DropDownList_condition.SelectedItem.Value.Trim() == ">=") { pjtj = "dateadd(hour," + BLL.other.Company.WordlTimeBLL.ConvertAddHours() + "," + tiaoj + ")" + DropDownList_condition.SelectedItem.Value + "'" + keyword + " 00:00:00'"; } else if (DropDownList_condition.SelectedItem.Value.Trim() == "<") { pjtj = "dateadd(hour," + BLL.other.Company.WordlTimeBLL.ConvertAddHours() + "," + tiaoj + ")" + DropDownList_condition.SelectedItem.Value + "'" + keyword + " 00:00:00'"; } else if (DropDownList_condition.SelectedItem.Value.Trim() == "<=") { pjtj = "dateadd(hour," + BLL.other.Company.WordlTimeBLL.ConvertAddHours() + "," + tiaoj + ")" + DropDownList_condition.SelectedItem.Value + "'" + keyword + " 23:59:59'"; } } else { pjtj = tiaoj + DropDownList_condition.SelectedItem.Value + "'" + keyword + "'"; } } condition = "so.IsCheckOut='Y' and so.isAuditing='Y' and (select country from city where cpccode=so.cpccode)='" + currency + "' and " + pjtj + " and " + status; } condition = condition.Replace("〖Country〗", "(select country from city where cpccode=so.cpccode)"); condition = condition.Replace("〖Province〗", "(select Province from city where cpccode=so.cpccode)"); condition = condition.Replace("〖City〗", "(select City from city where cpccode=so.cpccode)"); ViewState["condition"] = condition; if (DropDownList1.SelectedValue == "so.isGeneOutBill='A'") { ViewState["GridViewID"] = "GridView2_BillOutOrder"; GridView_BillOutOrder.Visible = false; GridView2_BilloutOrder.Visible = true; Pager1.PageBind(0, 10, @"StoreOrder so left outer join city on so.cpccode=city.cpccode left join memberorder m on so.storeorderid=m.orderid", @"so.isSent,so.StoreID,so.StoreOrderID,so.ExpectNum, so.OrderType,m.number , so.TotalMoney,so.TotalPv,so.AuditingDate,so.IsCheckOut,so.PayMentDateTime,so.InceptPerson,so.InceptAddress,so.Telephone,so.Weight,so.Carriage,so.OrderDateTime,city.country,city.province,city.city,city.Xian, so.Description ", condition, "so.StoreOrderID", "GridView2_BilloutOrder", "so.OrderDateTime", 0); Panel1.Visible = false; ViewState["SQLSTR"] = @"select so.isSent,so.StoreID,so.StoreOrderID,so.ExpectNum, so.OrderType,m.number , so.TotalMoney,so.TotalPv,so.AuditingDate,so.IsCheckOut,so.PayMentDateTime,so.InceptPerson,so.InceptAddress,so.Telephone,so.Weight,so.Carriage,so.OrderDateTime,city.country,city.province,city.city,city.Xian, so.Description from StoreOrder so left outer join city on so.cpccode=city.cpccode left join memberorder m on so.storeorderid=m.orderid where " + condition + " order by so.OrderDateTime desc,so.StoreOrderID desc"; } else { ViewState["GridViewID"] = "GridView_BillOutOrder"; GridView2_BilloutOrder.Visible = false; GridView_BillOutOrder.Visible = true; Pager1.PageBind(0, 10, @"StoreOrder so left outer join city on so.cpccode=city.cpccode left join memberorder m on so.storeorderid=m.orderid", @"m.number,so.isSent,so.StoreID,so.StoreOrderID,so.ExpectNum, so.OrderType, so.TotalMoney,so.TotalPv,so.AuditingDate,so.IsCheckOut,so.PayMentDateTime,so.InceptPerson,so.InceptAddress,so.Telephone,so.Weight,so.Carriage,so.OrderDateTime,city.country,city.province,city.city,city.Xian, so.Description ", condition, "so.StoreOrderID", "GridView_BillOutOrder", "so.OrderDateTime", 0); Panel1.Visible = true; ViewState["SQLSTR"] = @"select m.number,so.isSent,so.StoreID,so.StoreOrderID,so.ExpectNum, so.OrderType, so.TotalMoney,so.TotalPv,so.AuditingDate,so.IsCheckOut,so.PayMentDateTime,so.InceptPerson,so.InceptAddress,so.Telephone,so.Weight,so.Carriage,so.OrderDateTime,city.country,city.province,city.city,city.Xian, so.Description from StoreOrder so left outer join city on so.cpccode=city.cpccode left join memberorder m on so.storeorderid=m.orderid where " + condition + " order by so.OrderDateTime desc,so.StoreOrderID desc"; } SetFanY(); }
public void getbind() { StringBuilder sb = new StringBuilder(); if (ddlhistory.SelectedValue == "0") { sb.Append(" 1=1 and (hchaoshi>0 or tchaoshi>0)"); if (txtnumber.Text.Trim() != "") { if (DropDownList1.SelectedValue == "0") { sb.Append(" and hnumber = '" + txtnumber.Text.Trim() + "'"); } else if (DropDownList1.SelectedValue == "1") { sb.Append(" and tnumber = '" + txtnumber.Text.Trim() + "'"); } else { sb.Append(" and (tnumber = '" + txtnumber.Text.Trim() + "' or hnumber = '" + txtnumber.Text.Trim() + "')"); } } if (DropDownList2.SelectedValue != "-1") { sb.Append(" and " + DropDownList2.SelectedValue); } sb.Append(" and shenhestate!=20"); string clounmname = "case when hstate=0 and hchaoshi>0 then 1 else 0 end as hzr,case when tstate=0 and tchaoshi>0 then 1 else 0 end as tzr ,*"; string tablename = @"(select w.HkDjdate,w.TxDjdate,w.auditingtime, w.iscl,w.id as wid,remitnumber as hnumber,w.HkDj as hstate,w.TxDj as tstate,r.shenHestate as shenst,case when w.HkDj=1 then datediff(mi,w.auditingtime,dateadd(hh,-10,w.HkDjdate)) else datediff(mi,w.auditingtime,dateadd(hh,-2,getutcdate())) end as hchaoshi, r.remitmoney as hmoney,w.HkJs as hshuoming,w.TxJs as hshuoming1, auditingtime as ctime,w.TxDjdate as hctime,r.remark as hremark,w.number as tnumber, case when w.TxDj=1 and w.HkDj=0 then datediff(mi,dateadd(hh,2,w.auditingtime),w.TxDjdate)when w.TxDj=0 and w.HkDj=0 then datediff(mi,dateadd(hh,2,w.auditingtime),getutcdate()) when w.TxDj=1 and w.HkDj=1 then datediff(mi,w.HkDjdate,dateadd(hh,-24,w.TxDjdate)) else datediff(mi,w.HkDjdate,dateadd(hh,-24,getdate())) end as tchaoshi,w.withdrawmoney as tmoney,isnull(w.khname,'')+w.bankname+w.bankcard as bankinfo,w.shenhestate ,r.hkpzImglj from withdraw w,remittances r where w.hkid=r.id and w.shenhestate not in(0,99,-1) and Jfcl=0 and w.isjl=1) as t"; Pager1.PageBind(0, 10, tablename, clounmname, sb.ToString(), "wid", "Repeater1"); } else if (ddlhistory.SelectedValue == "1") { sb.Append(" 1=1 and (hchaoshi>0 or tchaoshi>0)"); if (txtnumber.Text.Trim() != "") { if (DropDownList1.SelectedValue == "0") { sb.Append(" and hnumber = '" + txtnumber.Text.Trim() + "'"); } else if (DropDownList1.SelectedValue == "1") { sb.Append(" and tnumber = '" + txtnumber.Text.Trim() + "'"); } else { sb.Append(" and (tnumber = '" + txtnumber.Text.Trim() + "' or hnumber = '" + txtnumber.Text.Trim() + "')"); } } if (DropDownList2.SelectedValue != "-1") { sb.Append(" and " + DropDownList2.SelectedValue); } // sb.Append(" and shenhestate!=20"); string clounmname = "case when hstate=0 and hchaoshi>0 then 1 else 0 end as hzr,case when tstate=0 and tchaoshi>0 then 1 else 0 end as tzr ,*"; string tablename = @"(select w.HkDjdate,w.TxDjdate,w.auditingtime, w.iscl,w.id as wid,remitnumber as hnumber,w.HkDj as hstate,w.TxDj as tstate,r.shenHestate as shenst,case when w.HkDj=1 then datediff(mi,w.auditingtime,dateadd(hh,-10,w.HkDjdate)) else datediff(mi,w.auditingtime,dateadd(hh,-2,getutcdate())) end as hchaoshi, r.remitmoney as hmoney,w.HkJs as hshuoming,w.TxJs as hshuoming1, auditingtime as ctime,w.TxDjdate as hctime,r.remark as hremark,w.number as tnumber, case when w.TxDj=1 and w.HkDj=0 then datediff(mi,dateadd(hh,2,w.auditingtime),w.TxDjdate)when w.TxDj=0 and w.HkDj=0 then datediff(mi,dateadd(hh,2,w.auditingtime),getutcdate()) when w.TxDj=1 and w.HkDj=1 then datediff(mi,w.HkDjdate,dateadd(hh,-24,w.TxDjdate)) else datediff(mi,w.HkDjdate,dateadd(hh,-24,getdate())) end as tchaoshi,w.withdrawmoney as tmoney,isnull(w.khname,'')+w.bankname+w.bankcard as bankinfo,w.shenhestate ,r.hkpzImglj from withdraw w,remittances r where w.hkid=r.id and w.shenhestate not in(0,99,-1) and iscl=1 and w.isjl=1) as t"; Pager1.PageBind(0, 10, tablename, clounmname, sb.ToString(), "wid", "Repeater1"); } }
protected void getbtCon() { //// string condition = ""; string currency = ""; if (DropCurrency.SelectedItem != null) { currency = DropCurrency.SelectedItem.Text; } string tiaoj = DropDownList_Items.SelectedItem.Value; string fh = DropDownList_condition.Text; string keyword = ""; keyword = txtBox_keyWords.Text.Trim().Replace("'", "").Replace("〖", "[").Replace("〗", "]"); string totalDataStart = txtBox_OrderDateTimeStart.Text.Trim(); string totalDataEnd = txtBox_OrderDateTimeEnd.Text.Trim(); string consignmentDateStart = txtBox_ConsignmentDateTimeStart.Text.Trim(); string consignmentDateEnd = txtBox_ConsignmentDateTimeEnd.Text.Trim(); if (String.IsNullOrEmpty(keyword)) { condition = "(select country from city where cpccode=so.cpccode)='" + currency + "' and 1=1"; } else { string pjtj = ""; if (fh == "like") { if (tiaoj == "InceptPerson") { pjtj = tiaoj + " like '%" + Encryption.Encryption.GetEncryptionName(keyword) + "%'"; } else if (tiaoj == "InceptAddress") { pjtj = tiaoj + " like '%" + Encryption.Encryption.GetEncryptionAddress(keyword) + "%'"; } else { pjtj = tiaoj + " like '%" + keyword + "%'"; } } else { if (tiaoj == "TotalMoney" || tiaoj == "Carriage") { try { keyword = keyword.Replace(",", ""); Convert.ToDouble(keyword); if (keyword.Length > 8) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("006912", "输入金额太大!") + "')</script>"); return; } } catch { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000443", "只能输入数字") + "')</script>"); return; } } pjtj = tiaoj + DropDownList_condition.SelectedItem.Value + "'" + keyword + "'"; } condition = "(select country from city where cpccode=so.cpccode)='" + currency + "' and " + pjtj; } try { if (totalDataStart != "") { Convert.ToDateTime(totalDataStart); condition = condition + " and dateadd(hour," + Session["WTH"].ToString() + ",OrderDateTime)>='" + totalDataStart + " 00:00:00'"; } if (totalDataEnd != "") { Convert.ToDateTime(totalDataEnd); condition = condition + " and dateadd(hour," + Session["WTH"].ToString() + ",OrderDateTime)<='" + totalDataEnd + " 23:59:59'"; } if (consignmentDateStart != "") { Convert.ToDateTime(consignmentDateStart); condition = condition + " and dateadd(hour," + Session["WTH"].ToString() + ",ConsignmentDateTime)>='" + consignmentDateStart + " 00:00:00'"; } if (consignmentDateEnd != "") { Convert.ToDateTime(consignmentDateEnd); condition = condition + " and dateadd(hour," + Session["WTH"].ToString() + ",ConsignmentDateTime)<='" + consignmentDateEnd + " 23:59:59'"; } } catch { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000450", "日期格式错误,请重新输入!") + "')</script>"); return; } //首页链接过来的调用这个 if (type == 1) { if (Request.QueryString["type"] != null) { condition = condition + " and isCheckOut='N'"; } } condition = condition.Replace("〖Country〗", "(select country from city where cpccode=so.cpccode)"); condition = condition.Replace("〖Province〗", "(select Province from city where cpccode=so.cpccode)"); condition = condition.Replace("〖City〗", "(select City from city where cpccode=so.cpccode)"); ViewState["condition"] = condition; Pager1.PageBind(0, 10, "StoreOrder so left outer join city on so.cpccode=city.cpccode ", @"feedback,StoreID,StoreOrderID,ExpectNum,IsCheckOut,IsSent,IsReceived, OrderType,InceptPerson,city.country,city.province,city.city, InceptAddress,PostalCode,TotalMoney,TotalPV,Telephone,Weight,Carriage,ConveyanceCompany ,OrderDateTime,ConsignmentDateTime,Description", condition, "StoreOrderID", "GridView_Order", "OrderDateTime", 0); }
/// <summary> /// 绑定数据 /// </summary> /// <param name="condation"></param> public void GetBindGView(string condation) { Pager1.PageBind(0, 10, "updateexpect u,memberinfo m", "*", condation, "u.ID", "GridView1"); }
/// <summary> /// 查询 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btn_Submit_Click(object sender, EventArgs e) { string currency = ""; if (DropCurrency.SelectedItem != null) { currency = DropCurrency.SelectedItem.Text; } string tiaoj = DropDownList1.SelectedItem.Value; string fh = DropDownList_condition.Text; string keyword = ""; if (DropDownList1.SelectedIndex == 10) { keyword = txtBox_rq.Text.Trim(); } else { keyword = TextBox4.Text.Trim().Replace("'", "").Replace("〖", "[").Replace("〗", "]"); } string isSent = DropDownList_Items.Text; string condition = ""; if (String.IsNullOrEmpty(keyword)) { condition = "so.IsCheckOut='Y' and so.isAuditing='Y' and (select country from city where cpccode=so.cpccode)='" + currency + "' and " + isSent; } else { string pjtj = ""; if (fh == "like") { if (tiaoj == "so.InceptPerson") { pjtj = tiaoj + " like '%" + Encryption.Encryption.GetEncryptionName(keyword) + "%'"; } else if (tiaoj == "ity.Address") { pjtj = tiaoj + " like '%" + Encryption.Encryption.GetEncryptionAddress(keyword) + "%'"; } else { pjtj = tiaoj + " like '%" + keyword + "%'"; } } else { if (tiaoj == "ity.TotalMoney" || tiaoj == "Carriage") { try { keyword = keyword.Replace(",", ""); Convert.ToDouble(keyword); if (keyword.Length > 8) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("006912", "输入金额太大!") + " ')</script>"); return; } } catch { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000443") + "')</script>"); return; } } if (DropDownList1.SelectedIndex == 10)//用于日期等于 { if (DropDownList_condition.SelectedItem.Value.Trim() == "=") { pjtj = "dateadd(hour," + BLL.other.Company.WordlTimeBLL.ConvertAddHours() + "," + tiaoj + ")" + " >= '" + keyword + " 00:00:00' and " + "dateadd(hour," + BLL.other.Company.WordlTimeBLL.ConvertAddHours() + "," + tiaoj + ")" + " <= '" + keyword + " 23:59:59'"; } else if (DropDownList_condition.SelectedItem.Value.Trim() == ">") { pjtj = "dateadd(hour," + BLL.other.Company.WordlTimeBLL.ConvertAddHours() + "," + tiaoj + ")" + DropDownList_condition.SelectedItem.Value + "'" + keyword + " 23:59:59'"; } else if (DropDownList_condition.SelectedItem.Value.Trim() == ">=") { pjtj = "dateadd(hour," + BLL.other.Company.WordlTimeBLL.ConvertAddHours() + "," + tiaoj + ")" + DropDownList_condition.SelectedItem.Value + "'" + keyword + " 00:00:00'"; } else if (DropDownList_condition.SelectedItem.Value.Trim() == "<") { pjtj = "dateadd(hour," + BLL.other.Company.WordlTimeBLL.ConvertAddHours() + "," + tiaoj + ")" + DropDownList_condition.SelectedItem.Value + "'" + keyword + " 00:00:00'"; } else if (DropDownList_condition.SelectedItem.Value.Trim() == "<=") { pjtj = "dateadd(hour," + BLL.other.Company.WordlTimeBLL.ConvertAddHours() + "," + tiaoj + ")" + DropDownList_condition.SelectedItem.Value + "'" + keyword + " 23:59:59'"; } } else { pjtj = tiaoj + DropDownList_condition.SelectedItem.Value + "'" + keyword + "'"; } } condition = "so.IsCheckOut='Y' and so.isAuditing='Y' and (select country from city where cpccode=so.cpccode)='" + currency + "' and " + pjtj + " and " + isSent; } condition = condition.Replace("〖Country〗", "(select country from city where cpccode=so.cpccode)"); condition = condition.Replace("〖Province〗", "(select Province from city where cpccode=so.cpccode)"); condition = condition.Replace("〖City〗", "(select City from city where cpccode=so.cpccode)"); //2009-11-13 ViewState["condition"] = condition; if (DropDownList_Items.SelectedItem.Value.Trim() == "ity.IsSend=0") { Session["GridViewID"] = "GridView1_CompanyConsign"; GridView1_CompanyConsign.Visible = true; GridView2_CompanyConsign.Visible = false; btn_Select.Enabled = true; Panel1.Visible = true; Pager1.PageBind(0, 10, @" InventoryDoc ity left outer join dbo.StoreOrder so on so.StoreOrderid=ity.StoreOrderid left outer join WareHouse wh on wh.WareHouseID=ity.inWareHouseID left outer join DepotSeat ds on ds.DepotSeatID=ity.inDepotSeatID and ity.inWareHouseID=ds.WareHouseID left outer join city on so.cpccode=city.cpccode left outer join MemberOrder mo on so.storeorderid=mo.OrderId left outer join MemberInfo mi on mo.Number=mi.Number", @"mi.Number,mi.Name,mi.Name as PetName,so.StoreID,so.StoreOrderID,ity.docid,so.IsAuditing,so.OrderDateTime,so.ExpectNum,so.PayMentDateTime,city.country,city.province,city.city,city.Xian, so.IsCheckOut,so.IsSent,so.OrderType, ity.TotalMoney,ity.TotalPV,ity.client,so.Weight,so.Carriage,so.ForeCastArriveDateTime,so.InceptPerson, ity.Address,so.PostalCode,so.Telephone,so.ConveyanceMode,so.ConveyanceCompany, wh.WareHouseName,ds.SeatName", condition, "ity.docid", "GridView1_CompanyConsign", "ity.docmaketime", 0); ViewState["SQLSTR"] = @"select mi.Number,mi.Name,mi.Name as PetName,so.StoreID,so.StoreOrderID,ity.docid,so.IsAuditing,so.OrderDateTime,so.ExpectNum,so.PayMentDateTime,city.country,city.province,city.city,city.Xian, so.IsCheckOut,so.IsSent,so.OrderType, ity.TotalMoney,ity.TotalPV,ity.client,so.Weight,so.Carriage,so.ForeCastArriveDateTime,so.InceptPerson, ity.Address,so.PostalCode,so.Telephone,so.ConveyanceMode,so.ConveyanceCompany, wh.WareHouseName,ds.SeatName from InventoryDoc ity left outer join dbo.StoreOrder so on so.StoreOrderid=ity.StoreOrderid left outer join WareHouse wh on wh.WareHouseID=ity.inWareHouseID left outer join DepotSeat ds on ds.DepotSeatID=ity.inDepotSeatID and ity.inWareHouseID=ds.WareHouseID left outer join city on so.cpccode=city.cpccode left outer join MemberOrder mo on so.storeorderid=mo.OrderId left outer join MemberInfo mi on mo.Number=mi.Number where " + condition + " order by ity.docmaketime desc,ity.docid desc"; } else { Session["GridViewID"] = "GridView2_CompanyConsign"; GridView1_CompanyConsign.Visible = false; GridView2_CompanyConsign.Visible = true; btn_Select.Enabled = false; Panel1.Visible = false; Pager1.PageBind(0, 10, @" InventoryDoc ity left outer join StoreOrder so on so.StoreOrderid=ity.StoreOrderid left outer join WareHouse wh on wh.WareHouseID=ity.inWareHouseID left outer join DepotSeat ds on ds.DepotSeatID=ity.inDepotSeatID and ity.inWareHouseID=ds.WareHouseID left outer join city on so.cpccode=city.cpccode left outer join MemberOrder mo on so.storeorderid=mo.OrderId left outer join MemberInfo mi on mo.Number=mi.Number", @"mi.Number,mi.Name,mi.Name as PetName,so.StoreID,so.StoreOrderID,ity.client,ity.docid,so.IsAuditing,so.OrderDateTime,so.ExpectNum,so.PayMentDateTime,city.country,city.province,city.city,city.Xian, so.IsCheckOut,so.IsSent,so.OrderType, ity.TotalMoney,ity.TotalPV,so.Weight,so.Carriage,so.ForeCastArriveDateTime,so.InceptPerson, ity.Address,so.PostalCode,so.Telephone,so.ConveyanceMode,so.ConveyanceCompany, wh.WareHouseName,ds.SeatName", condition, "ity.docid", "GridView2_CompanyConsign", "ity.docmaketime", 0); ViewState["SQLSTR"] = @"select mi.Number,mi.Name,mi.Name as PetName,so.StoreID,so.StoreOrderID,ity.client,ity.docid,so.IsAuditing,so.OrderDateTime,so.ExpectNum,so.PayMentDateTime,city.country,city.province,city.city,city.Xian, so.IsCheckOut,so.IsSent,so.OrderType, ity.TotalMoney,ity.TotalPV,so.Weight,so.Carriage,so.ForeCastArriveDateTime,so.InceptPerson, ity.Address,so.PostalCode,so.Telephone,so.ConveyanceMode,so.ConveyanceCompany, wh.WareHouseName,ds.SeatName from InventoryDoc ity left outer join StoreOrder so on so.StoreOrderid=ity.StoreOrderid left outer join WareHouse wh on wh.WareHouseID=ity.inWareHouseID left outer join DepotSeat ds on ds.DepotSeatID=ity.inDepotSeatID and ity.inWareHouseID=ds.WareHouseID left outer join city on so.cpccode=city.cpccode left outer join MemberOrder mo on so.storeorderid=mo.OrderId left outer join MemberInfo mi on mo.Number=mi.Number where " + condition + " order by ity.docmaketime desc,ity.docid desc"; } SetFanY(); }
protected void Button1_Click(object sender, EventArgs e) { string condition = ""; string currency = ""; if (DropCurrency.SelectedItem != null) { currency = DropCurrency.SelectedItem.Text; } string tiaoj = DropDownList_Items.SelectedItem.Value; string fh = DropDownList_condition.Text; //string keyword = txtBox_keyWords.Text.Trim(); string keyword = ""; //if (DropDownList_Items.SelectedIndex == 11 || DropDownList_Items.SelectedIndex == 9 || DropDownList_Items.SelectedIndex == 10) // keyword = txtBox_rq.Text.Trim(); //else keyword = txtBox_keyWords.Text.Trim().Replace("'", "").Replace("〖", "[").Replace("〗", "]"); string totalDataStart = txtBox_OrderDateTimeStart.Text.Trim(); string totalDataEnd = txtBox_OrderDateTimeEnd.Text.Trim(); string consignmentDateStart = txtBox_ConsignmentDateTimeStart.Text.Trim(); string consignmentDateEnd = txtBox_ConsignmentDateTimeEnd.Text.Trim(); if (String.IsNullOrEmpty(keyword)) { condition = "(select country from city where cpccode=so.cpccode)='" + currency + "' and 1=1"; } else { string pjtj = ""; if (fh == "like") { if (tiaoj == "InceptPerson") { pjtj = tiaoj + " like '%" + Encryption.Encryption.GetEncryptionName(keyword) + "%'"; } else if (tiaoj == "InceptAddress") { pjtj = tiaoj + " like '%" + Encryption.Encryption.GetEncryptionAddress(keyword) + "%'"; } else { pjtj = tiaoj + " like '%" + keyword + "%'"; } } else { if (tiaoj == "TotalMoney" || tiaoj == "Carriage") { try { keyword = keyword.Replace(",", ""); Convert.ToDouble(keyword); if (keyword.Length > 8) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('金额输入太大!')</script>"); return; } } catch { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000443", "只能输入数字") + "')</script>"); return; } } if (tiaoj == "ExpectNum") { try { Convert.ToInt32(keyword); } catch { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000443", "只能输入数字") + "')</script>"); return; } } pjtj = tiaoj + DropDownList_condition.SelectedItem.Value + "'" + keyword + "'"; } condition = "(select country from city where cpccode=so.cpccode)='" + currency + "' and " + pjtj + " and 1=1"; } try { if (totalDataStart != "") { Convert.ToDateTime(totalDataStart); condition = condition + " and dateadd(hour," + BLL.other.Company.WordlTimeBLL.ConvertAddHours() + ",OrderDateTime)>='" + totalDataStart + " 00:00:00'"; } if (totalDataEnd != "") { Convert.ToDateTime(totalDataEnd); condition = condition + " and dateadd(hour," + BLL.other.Company.WordlTimeBLL.ConvertAddHours() + ",OrderDateTime)<='" + totalDataEnd + " 23:59:59'"; } if (consignmentDateStart != "") { Convert.ToDateTime(consignmentDateStart); condition = condition + " and dateadd(hour," + BLL.other.Company.WordlTimeBLL.ConvertAddHours() + ",ConsignmentDateTime)>='" + consignmentDateStart + " 00:00:00'"; } if (consignmentDateEnd != "") { Convert.ToDateTime(consignmentDateEnd); condition = condition + " and dateadd(hour," + BLL.other.Company.WordlTimeBLL.ConvertAddHours() + ",ConsignmentDateTime)<='" + consignmentDateEnd + " 23:59:59'"; } } catch { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000450", "日期格式错误,请重新输入!") + "')</script>"); return; } condition = condition.Replace("〖Country〗", "(select country from city where cpccode=so.cpccode)"); condition = condition.Replace("〖Province〗", "(select Province from city where cpccode=so.cpccode)"); condition = condition.Replace("〖City〗", "(select City from city where cpccode=so.cpccode)"); ViewState["condition"] = condition; Pager1.PageBind(0, 10, "dbo.StoreOrder so left outer join city on so.cpccode=city.cpccode", @"StoreID, StoreOrderID, ExpectNum,IsCheckOut,IsSent,IsReceived ,InceptPerson,InceptAddress,PostalCode,kuaididh,Telephone,TotalMoney,city.country,city.province,city.city,ConveyanceCompany ,TotalPV,Telephone,Weight,OrderDateTime,ConsignmentDateTime", condition, "StoreOrderID", "GridView_WuliuStateShow", "OrderDateTime", 0); SetFanY(); }
protected void getbtCon() { //// string condition = ""; string currency = ""; if (DropCurrency.SelectedItem != null) { currency = DropCurrency.SelectedItem.Text; } string tiaoj = DropDownList_Items.SelectedItem.Value; string fh = DropDownList_condition.Text; string keyword = ""; //if (DropDownList_Items.SelectedIndex == 8 || DropDownList_Items.SelectedIndex == 9 || DropDownList_Items.SelectedIndex == 10) // keyword = txtBox_rq.Text.Trim(); //else keyword = txtBox_keyWords.Text.Trim().Replace("'", "").Replace("〖", "[").Replace("〗", "]"); string totalDataStart = txtBox_OrderDateTimeStart.Text.Trim(); string totalDataEnd = txtBox_OrderDateTimeEnd.Text.Trim(); string consignmentDateStart = txtBox_ConsignmentDateTimeStart.Text.Trim(); string consignmentDateEnd = txtBox_ConsignmentDateTimeEnd.Text.Trim(); if (String.IsNullOrEmpty(keyword)) { condition = "(select country from city where cpccode=so.cpccode)='" + currency + "' and fahuoorder=''"; } else { string pjtj = ""; if (fh == "like") { if (tiaoj == "InceptPerson") { pjtj = tiaoj + " like '%" + Encryption.Encryption.GetEncryptionName(keyword) + "%'"; } else if (tiaoj == "InceptAddress") { pjtj = tiaoj + " like '%" + Encryption.Encryption.GetEncryptionAddress(keyword) + "%'"; } else { pjtj = tiaoj + " like '%" + keyword + "%'"; } } else { if (tiaoj == "TotalMoney" || tiaoj == "Carriage") { try { keyword = keyword.Replace(",", ""); Convert.ToDouble(keyword); } catch { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000443", "只能输入数字") + "')</script>"); return; } } pjtj = tiaoj + DropDownList_condition.SelectedItem.Value + "'" + keyword + "'"; } condition = "(select country from city where cpccode=so.cpccode)='" + currency + "' and " + pjtj; } try { if (totalDataStart != "") { Convert.ToDateTime(totalDataStart); condition = condition + " and dateadd(hour," + BLL.other.Company.WordlTimeBLL.ConvertAddHours() + ",OrderDateTime)>='" + totalDataStart + " 00:00:00'"; } if (totalDataEnd != "") { Convert.ToDateTime(totalDataEnd); condition = condition + " and dateadd(hour," + BLL.other.Company.WordlTimeBLL.ConvertAddHours() + ",OrderDateTime)<='" + totalDataEnd + " 23:59:59'"; } if (consignmentDateStart != "") { Convert.ToDateTime(consignmentDateStart); condition = condition + " and dateadd(hour," + BLL.other.Company.WordlTimeBLL.ConvertAddHours() + ",ConsignmentDateTime)>='" + consignmentDateStart + " 00:00:00'"; } if (consignmentDateEnd != "") { Convert.ToDateTime(consignmentDateEnd); condition = condition + " and dateadd(hour," + BLL.other.Company.WordlTimeBLL.ConvertAddHours() + ",ConsignmentDateTime)<='" + consignmentDateEnd + " 23:59:59'"; } } catch { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000450", "日期格式错误,请重新输入!") + "')</script>"); return; } //首页链接过来的调用这个 if (type == 1) { if (Request.QueryString["type"] != null) { condition = condition + " and isCheckOut='N'"; } } condition += " and IsCheckOut='Y' "; if (this.DDLSendWay.SelectedValue != "-1") { condition += " And SendWay=" + DDLSendWay.SelectedValue; } condition = condition.Replace("〖Country〗", "(select country from city where cpccode=so.cpccode)"); condition = condition.Replace("〖Province〗", "(select Province from city where cpccode=so.cpccode)"); condition = condition.Replace("〖City〗", "(select City from city where cpccode=so.cpccode)"); ViewState["condition"] = condition; //Response.Write(condition); Pager1.PageBind(0, 10, "ordergoods so left outer join city on so.cpccode=city.cpccode ", @"StoreID,OrderGoodsID,ExpectNum,IsCheckOut, OrderType,InceptPerson,city.country,city.province,city.city, (city.province+city.city+InceptAddress) as InceptAddress,PostalCode,TotalMoney,TotalPV,Telephone,Weight,Carriage ,OrderDateTime,Description,case SendWay when 0 then '0' else '1' end as SendWay", condition, "OrderGoodsID", "GridView_Order", "OrderDateTime", 0); /* * GridView_Order.DataSource=DBHelper.ExecuteDataTable(@"select feedback,StoreID,StoreOrderID,OutStorageOrderID,ExpectNum,IsCheckOut,IsSent,IsReceived, * case OrderType when 1 then N'การ หมุนเวียน สินค้า' when 0 then N'การ หมุนเวียน สินค้า' when 2 * then N'การ หมุนเวียน สินค้า' end as OrderType,InceptPerson,city.country,city.province,city.city, * InceptAddress,PostalCode,TotalMoney,TotalPV,Telephone,Weight,Carriage,ConveyanceCompany * ,OrderDateTime,ConsignmentDateTime,Description from * StoreOrder so left outer join city on so.cpccode=city.cpccode "); * GridView_Order.DataBind(); */ }