protected void gv_Chan_RowUpdating(object sender, GridViewUpdateEventArgs e) { #region TextBox txt_DIS_QTY = (TextBox)gv_Chan.Rows[e.RowIndex].FindControl("txt_DIS_QTY"); try { ALOModel.MaintainDisRecord BCO = new ALOModel.MaintainDisRecord(ConnectionDB); int iDisQty; int.TryParse(txt_DIS_QTY.Text.Trim(), out iDisQty); ArrayList ParameterList = new ArrayList();//20091113 ParameterList.Clear(); ParameterList.Add(s_DIS_NO); ParameterList.Add(s_ITEM); ParameterList.Add(s_PERIOD); ParameterList.Add(gv_Chan.Rows[e.RowIndex].Cells[0].Text.Trim());//通路 ParameterList.Add(iDisQty);//實配數 ParameterList.Add(Session["UID"].ToString());//使用者 ParameterList.Add(s_SESSION_ID); bool bResult = BCO.UpdateDisChanTmp(ParameterList, null); if (!bResult) { throw new Exception("更新失敗!"); } else { RightMsgLabel.Text = "更新暫存檔成功"; up_Msg.Update(); } } catch (Exception ex) { ErrorMsgLabel.Text = ex.Message; up_Msg.Update(); } finally { gv_Chan.EditIndex = -1; //重新取得資料Binding QueryAllChanData(); } #endregion }