protected void Page_Load(object sender, EventArgs e) { Permissions.ComRedirect(Page, Permissions.redirUrl); Response.Cache.SetExpires(DateTime.Now); Permissions.CheckManagePermission(EnumCompanyPermission.LogisticsCompanyConsignOut); this.DataBind(); if (!IsPostBack) { string storeOrderID = Request.QueryString["StoreOrderID"].ToString(); TextBox3.Text = GetTran("001711", "订单发货"); //DataTable dt = BillOutOrderBLL.GetWareHouseName(); DataTable dt = BillOutOrderBLL.GetWareHouseName_Currency("1"); if (dt.Rows.Count == 0) { Response.Write("<script>alert('" + GetTran("001293", "你没有仓库权限,所以不能查看此页面") + "')</script>"); Response.End(); return; } string sql = "select inWareHouseID,inDepotSeatID,storeorderid from InventoryDoc where docid='" + storeOrderID + "'"; DataTable wd = DBHelper.ExecuteDataTable(sql); ViewState["storeorderid"] = wd.Rows[0][2].ToString(); DropDownList1.DataTextField = "WareHouseName"; DropDownList1.DataValueField = "WareHouseID"; DropDownList1.DataSource = dt; DropDownList1.DataBind(); DropDownList1.SelectedValue = wd.Rows[0][0] == null ? "1" : wd.Rows[0][0].ToString(); DropDownList1.Enabled = false; string wareHouseID = DropDownList1.SelectedItem.Value; DropDownList2.DataTextField = "SeatName"; DropDownList2.DataValueField = "DepotSeatID"; DropDownList2.DataSource = CompanyConsignBLL.GetDepotSeat(wareHouseID); DropDownList2.DataBind(); DropDownList2.Enabled = false; DropDownList2.SelectedValue = wd.Rows[0][1] == null ? "1" : wd.Rows[0][1].ToString(); string admin = Session["Company"].ToString(); string[] arrtime = DateTime.Now.ToString("yyyy-MM-dd").Split('-'); string timestr = arrtime[0]; if (arrtime[1].Length == 1) { timestr = timestr + "0" + arrtime[1]; } else { timestr = timestr + arrtime[1]; } if (arrtime[2].Length == 1) { timestr = timestr + "0" + arrtime[2]; } else { timestr = timestr + arrtime[2]; } TextBox1.Text = timestr; TextBox2.Text = ViewState["storeorderid"].ToString(); TextBox4.Text = admin; TextBox5.Text = storeOrderID; DataTable dtt = DBHelper.ExecuteDataTable("select Number,LogisticsCompany from Logistics"); DropDownList3.DataTextField = "LogisticsCompany"; DropDownList3.DataValueField = "Number"; DropDownList3.DataSource = dtt; DropDownList3.DataBind(); ////用于已出库的单不允许选择库位 //SqlDataReader dr = DAL.DBHelper.ExecuteReader("select IsGeneOutBill,OutStorageOrderID from StoreOrder where StoreOrderID='" + Request.QueryString["StoreOrderID"] + "'"); //if (dr.Read()) //{ // if (dr["IsGeneOutBill"].ToString().ToLower() == "y") // { // SqlDataReader dr2 = DAL.DBHelper.ExecuteReader("select Note,inWareHouseID,inDepotSeatID from InventoryDoc where DocId='" + dr["OutStorageOrderID"] + "'"); // dr.Close(); // if (dr2.Read()) // { // DropDownList1.SelectedValue = dr2["inWareHouseID"].ToString().Trim(); // string bdwareHouseID = DropDownList1.SelectedItem.Value; // DropDownList2.DataSource = null; // DropDownList2.DataTextField = "SeatName"; // DropDownList2.DataValueField = "DepotSeatID"; // DropDownList2.DataSource = CompanyConsignBLL.GetDepotSeat(bdwareHouseID); // DropDownList2.DataBind(); // } // TextBox6.Text = dr2["Note"].ToString(); // dr2.Close(); // DropDownList1.Enabled = false; // DropDownList2.Enabled = false; // } //} } }
protected void loadData() { string storeOrderID = Request.QueryString["StoreOrderID"]; Label1.Text = Request.QueryString["title"].ToString(); string isEnabledDropDownList = Request.QueryString["enable"].ToString().Replace("'", "").Replace("-", "").Replace("/*", ""); string isButton = Request.QueryString["isBut"].ToString().Replace("'", "").Replace("-", "").Replace("/*", ""); if (isEnabledDropDownList == "Y") { DropDownList1.Enabled = false; DropDownList2.Enabled = false; fhck.Visible = false; } if (isButton == "CK") { TextBox3.Text = GetTran("001294", "订单出库"); } else { Button1.Visible = false; TextBox3.Text = GetTran("001711", "订单发货"); } if (storeOrderID.EndsWith(",")) { storeOrderID = storeOrderID.Substring(0, storeOrderID.Length - 1); } string allStoreOrderID = ("'" + storeOrderID + "'").Replace(",", "','"); string sql = "select w.WareHouseid,d.DepotSeatid from storeorder s join city c on s.cpccode=c.cpccode join DepotSeat d on c.DepotSeatid=d.DepotSeatid join WareHouse w on d.WareHouseid=w.WareHouseid where storeorderid in(" + allStoreOrderID + ")"; DataTable dt = BillOutOrderBLL.GetWareHouseName_Currency("1"); if (dt.Rows.Count == 0) { Response.Write("<script>alert('" + GetTran("001293", "你没有仓库权限,所以不能查看此页面") + "')</script>"); Response.End(); return; } DropDownList1.DataSource = dt; DropDownList1.DataBind(); string wareHouseID = DropDownList1.SelectedItem.Value; DropDownList2.DataSource = CompanyConsignBLL.GetDepotSeat(wareHouseID); DropDownList2.DataBind(); string admin = Session["Company"].ToString(); string[] arrtime = DateTime.Now.ToString("yyyy-MM-dd").Split('-'); string timestr = arrtime[0]; if (arrtime[1].Length == 1) { timestr = timestr + "0" + arrtime[1]; } else { timestr = timestr + arrtime[1]; } if (arrtime[2].Length == 1) { timestr = timestr + "0" + arrtime[2]; } else { timestr = timestr + arrtime[2]; } TextBox1.Text = timestr; TextBox2.Text = storeOrderID; TextBox4.Text = admin; TextBox5.Text = storeOrderID; string bind = "select p.productid,productcode,productname,quantity,price,pv ,outbillquantity,(quantity-outbillquantity) as [count] from orderdetail o " + " join product p on o.productid=p.productid where storeorderid='" + Request.QueryString["StoreOrderID"] + "'"; DataTable dt2 = DBHelper.ExecuteDataTable(bind); Repeater1.DataSource = dt2; Repeater1.DataBind(); Translations(); }