1 2 3 4 5 6 7 8 9 | var hid = new SqlParameter { ParameterName = "HistoryId" , Value = history.Id, Direction = ParameterDirection.Input }; var sid = new SqlParameter { ParameterName = "StoreId" , Value = StoreId, Direction = ParameterDirection.Input }; var qrcode = new SqlParameter { ParameterName = "QRCode" , Value = strQRCode, Direction = ParameterDirection.Input }; var guidcode = new SqlParameter { ParameterName = "GUIDCode" , Value = strGUIDCode, Direction = ParameterDirection.Input }; var result = new SqlParameter { ParameterName = "Result" , Value = 0, Direction = ParameterDirection.Output }; db.Database.ExecuteSqlCommand( "exec @Result = OptStock @HistoryId,@StoreId,@QRCode,@GUIDCode" , hid, sid, qrcode, guidcode, result); model.Status = ( int )result.Value; |