/// <summary> /// SAP库存收发货 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnToSAPData_Click(object sender, EventArgs e) { DMWJEXECUTE services = new DMWJEXECUTE(); try { //库存收发货 string strResult = ""; strResult = services.SAPConverMaterialOutInStock(this.stockUpBillNo.Text, this.mark.Text); if (strResult == "1") { this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert(\"SAP库存收发货成功!\");", true); } else if (strResult.Split('&')[0] == "0") { this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert(\"" + strResult.Split('&')[1] + "\");", true); } } catch (Exception ex) { this.ClientScript.RegisterStartupScript(this.GetType(), "ShowErr", "ShowErr(\"" + Server.UrlEncode(ex.Message) + "\",3);", true); return; } finally { services.Dispose(); } }
/// <summary> /// SAP库存收发货 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnToSAPData_Click(object sender, EventArgs e) { DMWJEXECUTE services = new DMWJEXECUTE(); try { //获取选中的数据Id foreach (GridViewRow gvrow in this.grid.Rows) { //库存收发货 string strStockUpBillNo = "", strResult = ""; string mark = ""; strStockUpBillNo = this.grid.DataKeys[gvrow.RowIndex]["stockUpBillNo"].ToString(); mark = this.grid.DataKeys[gvrow.RowIndex]["mark"].ToString(); strResult = services.SAPConverMaterialOutInStock(strStockUpBillNo,mark); if (strResult == "1") { this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert(\"SAP库存收发货成功!\");", true); } else if (strResult.Split('&')[0] == "0") { this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert(\"" + strResult.Split('&')[1] + "\");", true); } } } catch (Exception ex) { this.ClientScript.RegisterStartupScript(this.GetType(), "ShowErr", "ShowErr(\"" + Server.UrlEncode(ex.Message) + "\",3);", true); return; } finally { services.Dispose(); } }