# 批次檔(T) ### 負責選好資料後按鈕點下去會觸發SP去更動資料庫或是撈資料也有可能是doQuOther ==Stored Proceduce =>**資料庫的預存程式-先寫好的程式**== # 寫法 ## cshtml * 沒有master From只有Search From ## Controller ```csharp= DBController dBController = new DBController(); Hashtable hashtable = new Hashtable(); string sql = "Update TEXT SET name=@NAME where id=@ID"; hashtable.Add("@ID", new StructureSQLParameter (a_Search.ID, SqlDbType.Int)); hashtable.Add("@NAME", new StructureSQLParameter (a_Search.NAME, SqlDbType.NVarChar)); var datas = dBController.FillDataTable (sql, hashtable).AsEnumerable(); ``` * 需要繼承IApiController.==T== * **沒有CRUD** * 要留著==SearchClass==因為cshtml有Search From * 將需要更改的資料存放在sql * DBController模組負責與資料庫連線 * Hashtable 負責sql語法 ## JS ```javascript= $scope.ID = ""; //--開始執行批次處理 batchOKing $scope.$on("batchOKing", function (e, a_arg) { if (isEmpty($scope.searchData.ID)) { a_arg.cancel = true; a_arg.message = "[ID]不可空白!"; setFocusByName('stxtCOMM_NO') } //清空回傳單號 $scope.ID = ""; }) $scope.$on("batchOKed", function (e, a_arg) { //將回傳單號放入欄位 $scope.ID = a_arg.oldRow["ID"]; a_arg.isShowMessage = false;//不顯示成功訊息 }) ``` ###### tags: `實習筆記`